Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2094: Allow ObjGroup broadcast to selected nodes #2210

Merged
merged 5 commits into from
Nov 8, 2023

Conversation

JacobDomagala
Copy link
Contributor

@JacobDomagala JacobDomagala commented Nov 7, 2023

Fixes #2094


#include "common/test_harness.h"
#include <vt/transport.h>

#include <fmt-vt/core.h>

using namespace vt;
using namespace vt::tests::perf::common;

struct MyTest : PerfTestHarness { };

struct NodeObj {
  void handler(int, int b) {
  }
};

VT_PERF_TEST(MyTest, test_objgroup_send) {
  using namespace ::vt::group::region;

  const auto num_nodes = vt::theContext()->getNumNodes();

  auto proxy = vt::theObjGroup()->makeCollective<NodeObj>(
    "test_objgroup_local_send");

  List::ListType range;
  for(NodeType n = 0; n < num_nodes - 1; ++n){
    range.push_back(n);
  }

  if (theContext()->getNode() == 0) {

    for(auto& node : range){
      proxy[node].send<&NodeObj::handler>(10, 20);
    }

    for(auto& node : range){
      proxy[node].send<&NodeObj::handler>(10, 20);
    }
  }

  vt::theCollective()->barrier();
}

VT_PERF_TEST(MyTest, test_objgroup_multicast) {
  using namespace ::vt::group::region;

  const auto num_nodes = vt::theContext()->getNumNodes();

  auto proxy = vt::theObjGroup()->makeCollective<NodeObj>(
    "test_objgroup_local_send");

  List::ListType range;
  for(NodeType n = 0; n < num_nodes - 1; ++n){
    range.push_back(n);
  }

  if (theContext()->getNode() == 0) {
    proxy.multicast<&NodeObj::handler>(
      std::make_unique<List>(range), 10, 20);

    proxy.multicast<&NodeObj::handler>(
      std::make_unique<List>(range), 10, 20);
  }

  vt::theCollective()->barrier();
}

VT_PERF_TEST_MAIN()

SEND

image


MULTICAST

image

@JacobDomagala JacobDomagala self-assigned this Nov 7, 2023
Copy link

github-actions bot commented Nov 7, 2023

Pipelines results

PR tests (gcc-12, ubuntu, mpich)

Build for 7fb28eb (2023-11-08 16:05:39 UTC)

Compilation - successful

Testing - passed

Build log


PR tests (clang-9, ubuntu, mpich)

Build for 7fb28eb (2023-11-08 16:05:39 UTC)

Compilation - successful

Testing - passed

Build log


PR tests (gcc-9, ubuntu, mpich, zoltan, json schema test)

Build for 7fb28eb (2023-11-08 16:05:39 UTC)

Compilation - successful

Testing - passed

Build log


PR tests (clang-13, ubuntu, mpich)

Build for 7fb28eb (2023-11-08 16:05:39 UTC)

Compilation - successful

Testing - passed

Build log


PR tests (clang-12, ubuntu, mpich)

Build for 7fb28eb (2023-11-08 16:05:39 UTC)

Compilation - successful

Testing - passed

Build log


PR tests (gcc-10, ubuntu, openmpi, no LB)

Build for 7fb28eb (2023-11-08 16:05:39 UTC)

Compilation - successful

Testing - passed

Build log


PR tests (clang-11, ubuntu, mpich)

Build for 7fb28eb (2023-11-08 16:05:39 UTC)

Compilation - successful

Testing - passed

Build log


PR tests (clang-14, ubuntu, mpich)

Build for 7fb28eb (2023-11-08 16:05:39 UTC)

Compilation - successful

Testing - passed

Build log


PR tests (gcc-8, ubuntu, mpich, address sanitizer)

Build for 7fb28eb (2023-11-08 16:05:39 UTC)

Compilation - successful

Testing - passed

Build log


PR tests (clang-10, ubuntu, mpich)

Build for 7fb28eb (2023-11-08 16:05:39 UTC)

Compilation - successful

Testing - passed

Build log


PR tests (gcc-11, ubuntu, mpich, trace runtime, coverage)

Build for 7fb28eb (2023-11-08 16:05:39 UTC)

Compilation - successful

Testing - passed

Build log


PR tests (intel icpc, ubuntu, mpich)

Build for 7fb28eb (2023-11-08 16:05:39 UTC)

Compilation - successful

Testing - passed

Build log


PR tests (nvidia cuda 11.2, gcc-9, ubuntu, mpich)

Build for 7fb28eb (2023-11-08 16:05:39 UTC)

/vt/src/vt/pipe/pipe_manager.impl.h(133): warning: missing return statement at end of non-void function "vt::pipe::PipeManager::makeSend<f,Target>(Target) [with f=&vt::vrt::collection::lb::GreedyLB::collectHandler, Target=vt::objgroup::proxy::ProxyElm<vt::vrt::collection::lb::GreedyLB>]"
          detected during:
            instantiation of "auto vt::pipe::PipeManager::makeSend<f,Target>(Target) [with f=&vt::vrt::collection::lb::GreedyLB::collectHandler, Target=vt::objgroup::proxy::ProxyElm<vt::vrt::collection::lb::GreedyLB>]" 
/vt/src/vt/objgroup/proxy/proxy_objgroup.impl.h(200): here
            instantiation of "vt::objgroup::proxy::Proxy<ObjT>::PendingSendType vt::objgroup::proxy::Proxy<ObjT>::reduce<f,Op,Target,Args...>(Target, Args &&...) const [with ObjT=vt::vrt::collection::lb::GreedyLB, f=&vt::vrt::collection::lb::GreedyLB::collectHandler, Op=vt::collective::PlusOp, Target=vt::objgroup::proxy::ProxyElm<vt::vrt::collection::lb::GreedyLB>, Args=<vt::vrt::collection::lb::GreedyPayload>]" 
/vt/src/vt/vrt/collection/balance/greedylb/greedylb.cc(222): here

/vt/src/vt/pipe/pipe_manager.impl.h(133): warning: missing return statement at end of non-void function "vt::pipe::PipeManager::makeSend<f,Target>(Target) [with f=&MyObj::handler, Target=vt::objgroup::proxy::ProxyElm<MyObj>]"
          detected during instantiation of "auto vt::pipe::PipeManager::makeSend<f,Target>(Target) [with f=&MyObj::handler, Target=vt::objgroup::proxy::ProxyElm<MyObj>]" 
/vt/examples/callback/callback.cc(147): here

/vt/src/vt/pipe/pipe_manager.impl.h(133): warning: missing return statement at end of non-void function "vt::pipe::PipeManager::makeSend<f,Target>(Target) [with f=&colHan, Target=vt::vrt::collection::VrtElmProxy<MyCol, vt::Index1D>]"
          detected during instantiation of "auto vt::pipe::PipeManager::makeSend<f,Target>(Target) [with f=&colHan, Target=vt::vrt::collection::VrtElmProxy<MyCol, vt::Index1D>]" 
/vt/examples/callback/callback.cc(153): here

/vt/src/vt/pipe/pipe_manager.impl.h(133): warning: missing return statement at end of non-void function "vt::pipe::PipeManager::makeSend<f,Target>(Target) [with f=&MyObj::handler, Target=vt::objgroup::proxy::ProxyElm<MyObj>]"
          detected during instantiation of "auto vt::pipe::PipeManager::makeSend<f,Target>(Target) [with f=&MyObj::handler, Target=vt::objgroup::proxy::ProxyElm<MyObj>]" 
/vt/examples/callback/callback.cc(147): here

/vt/src/vt/pipe/pipe_manager.impl.h(133): warning: missing return statement at end of non-void function "vt::pipe::PipeManager::makeSend<f,Target>(Target) [with f=&colHan, Target=vt::vrt::collection::VrtElmProxy<MyCol, vt::Index1D>]"
          detected during instantiation of "auto vt::pipe::PipeManager::makeSend<f,Target>(Target) [with f=&colHan, Target=vt::vrt::collection::VrtElmProxy<MyCol, vt::Index1D>]" 
/vt/examples/callback/callback.cc(153%0D%0A%0D%0A%0D%0A ==> And there is more. Read log. <==

Build log


@JacobDomagala JacobDomagala force-pushed the 2094-allow-bcast-to-selected-nodes branch from c00f9ba to bc52c44 Compare November 7, 2023 17:20
Comment on lines 141 to 147
// This will work for list-type ranges only
nodes->sort();
auto& range = nodes->makeList();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will fail for ShallowList. But I don't see the reason why user would want to use 'ShallowList' for range of nodes 🤔

@JacobDomagala JacobDomagala force-pushed the 2094-allow-bcast-to-selected-nodes branch from bc52c44 to d7c70af Compare November 7, 2023 17:29
@JacobDomagala JacobDomagala force-pushed the 2094-allow-bcast-to-selected-nodes branch 2 times, most recently from 1b2a658 to 797debf Compare November 8, 2023 16:05
@JacobDomagala JacobDomagala marked this pull request as ready for review November 8, 2023 16:05
@JacobDomagala JacobDomagala force-pushed the 2094-allow-bcast-to-selected-nodes branch from 797debf to 7fb28eb Compare November 8, 2023 16:05
Copy link
Collaborator

@lifflander lifflander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great to me!

@lifflander lifflander merged commit 09159cc into develop Nov 8, 2023
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to broadcast message to subset of object group?
2 participants