diff --git a/examples/callback/callback_context.cc b/examples/callback/callback_context.cc index 2f8573c9a9..a1d08bea59 100644 --- a/examples/callback/callback_context.cc +++ b/examples/callback/callback_context.cc @@ -105,7 +105,7 @@ int main(int argc, char** argv) { auto this_node = vt::theContext()->getNode(); - if (this_node == vt::NodeT{0}) { + if (this_node == 0) { my_global_ctx.x = 1283; // Make a callback that triggers the callback with a context @@ -114,7 +114,7 @@ int main(int argc, char** argv) { ); auto const default_proxy = vt::theObjGroup()->getDefault(); - default_proxy[vt::NodeT{1}].send(cb); + default_proxy[1].send(cb); } vt::finalize(); diff --git a/examples/collection/migrate_collection.cc b/examples/collection/migrate_collection.cc index ad96c2aa4a..fffa90c9d1 100644 --- a/examples/collection/migrate_collection.cc +++ b/examples/collection/migrate_collection.cc @@ -73,7 +73,7 @@ static void doWork(Hello* col) { static void migrateToNext(Hello* col) { auto this_node = vt::theContext()->getNode(); auto num_nodes = vt::theContext()->getNumNodes(); - vt::NodeT next_node = (this_node + vt::NodeT{1}) % num_nodes; + auto next_node = (this_node + 1) % num_nodes; fmt::print("{}: migrateToNext: idx={}\n", this_node, col->getIndex()); col->migrate(next_node); diff --git a/examples/collection/polymorphic_collection.cc b/examples/collection/polymorphic_collection.cc index d794fc93e1..026e8f159c 100644 --- a/examples/collection/polymorphic_collection.cc +++ b/examples/collection/polymorphic_collection.cc @@ -141,7 +141,7 @@ void Hello::doWork() { static void migrateToNext(Hello* col) { auto this_node = vt::theContext()->getNode(); auto num_nodes = vt::theContext()->getNumNodes(); - vt::NodeT next_node = (this_node + vt::NodeT{1}) % num_nodes; + auto const next_node = (this_node + 1) % num_nodes; fmt::print("{}: migrateToNext: idx={}\n", this_node, col->getIndex()); col->migrate(next_node); @@ -165,12 +165,12 @@ int main(int argc, char** argv) { vtAbortIf(num_elms % num_nodes != 0, "Must be even number of elements per rank"); auto const num_per = num_elms / num_nodes; if (this_node % 2 == 0) { - for (int i = this_node.get()*num_per; i < (this_node.get()+1)*num_per; i++) { + for (int i = this_node*num_per; i < (this_node+1)*num_per; i++) { vt::Index1D idx{i}; elms.emplace_back(idx, std::make_unique>(InitialConsTag{})); } } else if (this_node % 2 == 1) { - for (int i = this_node.get()*num_per; i < (this_node.get()+1)*num_per; i++) { + for (int i = this_node*num_per; i < (this_node+1)*num_per; i++) { vt::Index1D idx{i}; elms.emplace_back(idx, std::make_unique>(InitialConsTag{})); } diff --git a/examples/collection/transpose.cc b/examples/collection/transpose.cc index 55213e2786..e12f2ee61c 100644 --- a/examples/collection/transpose.cc +++ b/examples/collection/transpose.cc @@ -41,6 +41,7 @@ //@HEADER */ +#include "vt/configs/types/types_node.h" #include #include @@ -284,7 +285,7 @@ vt::NodeT my_map(IndexT* idx, IndexT* max_idx, vt::NodeT num_nodes) { } } -static void solveGroupSetup(vt::NodeT this_node, vt::VirtualProxyType coll_proxy) { +static void solveGroupSetup(vt::BaseNodeType this_node, vt::VirtualProxyType coll_proxy) { auto const& is_even_node = this_node % 2 == 0; // This is how you would explicitly create/get a new communicator for this diff --git a/examples/hello_world/hello_reduce.cc b/examples/hello_world/hello_reduce.cc index 69a11bee89..c7b6575743 100644 --- a/examples/hello_world/hello_reduce.cc +++ b/examples/hello_world/hello_reduce.cc @@ -52,10 +52,10 @@ void reduceResult(int result, double result2) { int main(int argc, char** argv) { vt::initialize(argc, argv); - vt::NodeType const root = 0; + vt::NodeT const root(0); auto r = vt::theCollective()->global(); - r->reduce(vt::Node{root}, 50, 52.334); + r->reduce(root, 50, 52.334); vt::finalize(); return 0; diff --git a/examples/hello_world/objgroup.cc b/examples/hello_world/objgroup.cc index 62aee09f2b..7124a924fe 100644 --- a/examples/hello_world/objgroup.cc +++ b/examples/hello_world/objgroup.cc @@ -70,10 +70,10 @@ int main(int argc, char** argv) { vt::theCollective()->barrier(); - if (this_node == vt::NodeT{0}) { - proxy[vt::NodeT{0}].send<&MyObjGroup::handler>(5,10); + if (this_node == 0) { + proxy[0].send<&MyObjGroup::handler>(5,10); if (num_nodes > 1) { - proxy[vt::NodeT{1}].send<&MyObjGroup::handler>(10,20); + proxy[1].send<&MyObjGroup::handler>(10,20); } // Broadcast to all nodes @@ -83,7 +83,7 @@ int main(int argc, char** argv) { // Create list of nodes and multicast to them List::ListType range; - for (vt::NodeType node = 0; node < num_nodes; ++node) { + for (int32_t node = 0; node < num_nodes; ++node) { if (node % 2 == 0) { range.push_back(node); } diff --git a/sketches/test.cc b/sketches/test.cc index decf0d3157..106d99db46 100644 --- a/sketches/test.cc +++ b/sketches/test.cc @@ -7,8 +7,8 @@ using namespace vt; struct ParticleCollection : vt::VirtualCollectionContext { std::vector particles; - NodeType initial_map_to_node(index i) { - + NodeT initial_map_to_node(index i) { + } }; diff --git a/sketches/test_program1.cc b/sketches/test_program1.cc index 06562c1239..333474ef6b 100644 --- a/sketches/test_program1.cc +++ b/sketches/test_program1.cc @@ -5,8 +5,8 @@ using namespace vt; -NodeType this_node = -1; -NodeType num_nodes = -1; +NodeT this_node = -1; +NodeT num_nodes = -1; HandlerType test_msg_han = 0; HandlerType test_msg_han2 = 0; EpochType test_epoch = -1; diff --git a/src/vt/collective/barrier/barrier.cc b/src/vt/collective/barrier/barrier.cc index cc5549bacb..c3af21bad5 100644 --- a/src/vt/collective/barrier/barrier.cc +++ b/src/vt/collective/barrier/barrier.cc @@ -109,7 +109,7 @@ BarrierType Barrier::newNamedCollectiveBarrier() { BarrierType Barrier::newNamedBarrier() { BarrierType const next_barrier = cur_named_barrier_++; - NodeT const cur_node = theContext()->getNode(); + NodeT const cur_node = theContext()->getNodeStrong(); BarrierType const cur_node_shift = static_cast(cur_node) << 32; BarrierType const barrier_name = next_barrier | cur_node_shift; return barrier_name; diff --git a/src/vt/collective/collective_alg.cc b/src/vt/collective/collective_alg.cc index 387e65d0ff..d1533e8307 100644 --- a/src/vt/collective/collective_alg.cc +++ b/src/vt/collective/collective_alg.cc @@ -146,7 +146,7 @@ static void broadcastConsensus( reenter_counter_++; - auto const this_node = theContext()->getNode(); + auto const this_node = theContext()->getNodeStrong(); TagType consensus_scope = no_tag; TagType consensus_tag = no_tag; bool consensus_is_user_tag = false; diff --git a/src/vt/collective/collective_ops.cc b/src/vt/collective/collective_ops.cc index b69d7d1122..0568943bf1 100644 --- a/src/vt/collective/collective_ops.cc +++ b/src/vt/collective/collective_ops.cc @@ -238,7 +238,7 @@ RuntimePtrType CollectiveAnyOps::initialize( // If appConfig is not nullptr, compare CLI arguments with user-defined ones, // and report overwritten ones. - if (appConfig && theContext()->getNode() == 0) { + if (appConfig && theContext()->getNodeStrong() == 0) { printOverwrittens(*rt->getAppConfig(), *appConfig); } diff --git a/src/vt/collective/reduce/reduce.h b/src/vt/collective/reduce/reduce.h index cadf9ac25a..377e74eb0c 100644 --- a/src/vt/collective/reduce/reduce.h +++ b/src/vt/collective/reduce/reduce.h @@ -181,10 +181,10 @@ struct Reduce : virtual collective::tree::Tree { template class Op = NoneOp, typename... Params > - PendingSendType reduce(Node root, Params&&... params); + PendingSendType reduce(NodeT root, Params&&... params); template - PendingSendType reduce(Node root, Params&&... params); + PendingSendType reduce(NodeT root, Params&&... params); /** * \brief Reduce a message up the tree diff --git a/src/vt/collective/reduce/reduce.impl.h b/src/vt/collective/reduce/reduce.impl.h index 77b0ff8d50..76c33cc0be 100644 --- a/src/vt/collective/reduce/reduce.impl.h +++ b/src/vt/collective/reduce/reduce.impl.h @@ -89,14 +89,14 @@ template < template class Op, typename... Params > -Reduce::PendingSendType Reduce::reduce(Node root, Params&&... params) { +Reduce::PendingSendType Reduce::reduce(NodeT root, Params&&... params) { using Tuple = typename FuncTraits::TupleType; using OpT = Op; return reduce(root, std::forward(params)...); } template -Reduce::PendingSendType Reduce::reduce(Node root, Params&&... params) { +Reduce::PendingSendType Reduce::reduce(NodeT root, Params&&... params) { using Tuple = typename FuncTraits::TupleType; using MsgT = ReduceTMsg; using GetReduceStamp = collective::reduce::GetReduceStamp; @@ -299,7 +299,7 @@ void Reduce::startReduce(detail::ReduceStamp id, bool use_num_contrib) { state_.erase(lookup); if (isRoot()) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); if (root != this_node) { vt_debug_print( normal, reduce, diff --git a/src/vt/collective/scatter/scatter.impl.h b/src/vt/collective/scatter/scatter.impl.h index 21c9ffd14d..617994a684 100644 --- a/src/vt/collective/scatter/scatter.impl.h +++ b/src/vt/collective/scatter/scatter.impl.h @@ -59,7 +59,7 @@ void Scatter::scatter( std::size_t const& total_size, std::size_t const& max_proc_size, FuncSizeType size_fn, FuncDataType data_fn ) { - auto const num_nodes = theContext()->getNumNodes(); + auto const num_nodes = theContext()->getNumNodesStrong(); auto const elm_size = max_proc_size; auto const combined_size = static_cast(num_nodes * elm_size); auto scatter_msg = @@ -90,7 +90,7 @@ void Scatter::scatter( ); vtAssert(nptr == ptr + combined_size, "nptr must match size"); auto const& handler = auto_registry::makeScatterHandler(); - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); scatter_msg->user_han = handler; if (this_node != root_node) { theMsg()->sendMsg( diff --git a/src/vt/collective/tree/tree.cc b/src/vt/collective/tree/tree.cc index 2d47e80755..be03b525d7 100644 --- a/src/vt/collective/tree/tree.cc +++ b/src/vt/collective/tree/tree.cc @@ -81,7 +81,7 @@ bool Tree::isRoot() const { } Tree::NodeListType Tree::getChildren(NodeT node) const { - auto const& num_nodes = theContext()->getNumNodes(); + auto const& num_nodes = theContext()->getNumNodesStrong(); auto const& c1_ = node * 2 + 1; auto const& c2_ = node * 2 + 2; NodeListType children; @@ -133,8 +133,8 @@ void Tree::foreachChild(NumLevelsType level, OperationType op) const { void Tree::setupTree() { if (not set_up_tree_) { - auto const& this_node_ = theContext()->getNode(); - auto const& num_nodes_ = theContext()->getNumNodes(); + auto const& this_node_ = theContext()->getNodeStrong(); + auto const& num_nodes_ = theContext()->getNumNodesStrong(); auto const& c1_ = this_node_ * 2 + 1; auto const& c2_ = this_node_ * 2 + 2; @@ -157,8 +157,8 @@ void Tree::setupTree() { } Tree::NumLevelsType Tree::numLevels() const { - auto const& num_nodes = theContext()->getNumNodes(); - auto const& levels = std::log2(num_nodes.get()); + auto const num_nodes = theContext()->getNumNodesStrong(); + auto const levels = std::log2(num_nodes.get()); return levels; } diff --git a/src/vt/configs/arguments/args.cc b/src/vt/configs/arguments/args.cc index 4bebfb6b7b..ea30947fa1 100644 --- a/src/vt/configs/arguments/args.cc +++ b/src/vt/configs/arguments/args.cc @@ -797,7 +797,7 @@ namespace { static std::string buildRankFile(std::string const& file) { std::string name = file; std::size_t rank = name.find("%p"); - auto str_rank = std::to_string(theContext()->getNode()); + auto str_rank = std::to_string(theContext()->getNodeStrong()); if (rank == std::string::npos) { name = name + str_rank; } else { diff --git a/src/vt/configs/error/stack_out.cc b/src/vt/configs/error/stack_out.cc index 4b046f7383..7378a0d120 100644 --- a/src/vt/configs/error/stack_out.cc +++ b/src/vt/configs/error/stack_out.cc @@ -176,8 +176,8 @@ std::string prettyPrintStack(DumpStackType const& stack) { auto magenta = ::vt::debug::magenta(); auto yellow = ::vt::debug::yellow(); auto vt_pre = ::vt::debug::vtPre(); - auto node = ::vt::theContext()->getNode(); - auto node_str = ::vt::debug::proc(node); + auto node = ::vt::theContext()->getNodeStrong(); + auto node_str = ::vt::debug::proc(NodeT{node}); auto prefix = vt_pre + node_str + " "; auto separator = fmt::format("{}{}{:-^120}{}\n", prefix, yellow, "", reset); auto title_node = fmt::format("on Node {}", node); diff --git a/src/vt/context/context.cc b/src/vt/context/context.cc index 8adb6ada61..802f2e8938 100644 --- a/src/vt/context/context.cc +++ b/src/vt/context/context.cc @@ -109,7 +109,7 @@ NodeT Context::getFromNodeCurrentTask() const { } } #endif - return getNode(); + return getNodeStrong(); } #if vt_check_enabled(trace_enabled) @@ -133,19 +133,19 @@ namespace vt { namespace debug { NodeT preNode() { #if !vt_check_enabled(trace_only) return ::vt::curRT != nullptr and ::vt::curRT->isLive() ? - theContext()->getNode() : + theContext()->getNodeStrong() : NodeT{-1}; #else - return theContext() ? theContext()->getNode() : NodeT{-1}; + return theContext() ? theContext()->getNodeStrong() : NodeT{-1}; #endif } NodeT preNodes() { #if !vt_check_enabled(trace_only) return ::vt::curRT != nullptr and ::vt::curRT->isLive() ? - theContext()->getNumNodes() : + theContext()->getNumNodesStrong() : NodeT{-1}; #else - return theContext() ? theContext()->getNode() : NodeT{-1}; + return theContext() ? theContext()->getNodeStrong() : NodeT{-1}; #endif } diff --git a/src/vt/context/context.h b/src/vt/context/context.h index 180bc3e1cf..2b1dc6e687 100644 --- a/src/vt/context/context.h +++ b/src/vt/context/context.h @@ -102,6 +102,8 @@ struct Context : runtime::component::Component { */ inline BaseNodeType getNode() const { return thisNode_; } + inline NodeT getNodeStrong() const { return thisNode_; } + /** * \brief Get the number of nodes (analogous to MPI's num ranks) being used * @@ -111,6 +113,7 @@ struct Context : runtime::component::Component { */ inline BaseNodeType getNumNodes() const { return numNodes_; } + inline NodeT getNumNodesStrong() const { return numNodes_; } /** * \brief Get the MPI communicator being used by VT in a given runtime * instance @@ -143,7 +146,7 @@ struct Context : runtime::component::Component { * the node that sent the message to trigger the current runnable. * * \note If a task is not currently running, this will return the this node - * ---equivalent to \c theContext()->getNode() + * ---equivalent to \c theContext()->getNodeStrong() * * For the current task that is executing, get the node that sent the message * that caused this runnable to execute. Note, for collection handlers this diff --git a/src/vt/elm/elm_id_bits.cc b/src/vt/elm/elm_id_bits.cc index 636ea860e8..dacb3f727f 100644 --- a/src/vt/elm/elm_id_bits.cc +++ b/src/vt/elm/elm_id_bits.cc @@ -53,7 +53,7 @@ namespace vt { namespace elm { bool migratable, NodeT curr_node ) { auto const seq_id = theNodeLBData()->getNextElm(); - auto const home_node = theContext()->getNode(); + auto const home_node = theContext()->getNodeStrong(); return createCollectionImpl(migratable, seq_id, home_node, curr_node); } @@ -70,7 +70,7 @@ namespace vt { namespace elm { ) { ElementIDType ret = 0; setObjGroup(ret, proxy, node); - auto const this_node = theContext()->getNode(); + auto const this_node = theContext()->getNodeStrong(); return ElementIDStruct{ret, this_node}; } diff --git a/src/vt/epoch/epoch_manip.cc b/src/vt/epoch/epoch_manip.cc index 83df89b007..d71ae904ff 100644 --- a/src/vt/epoch/epoch_manip.cc +++ b/src/vt/epoch/epoch_manip.cc @@ -88,7 +88,7 @@ EpochManip::EpochManip() /*static*/ EpochType EpochManip::generateRootedEpoch( eEpochCategory const& category ) { - auto const root_node = theContext()->getNode(); + auto const root_node = theContext()->getNodeStrong(); return generateEpoch(true,root_node,category); } @@ -103,7 +103,7 @@ EpochType EpochManip::getNextCollectiveEpoch( EpochType EpochManip::getNextRootedEpoch( eEpochCategory const& category ) { - auto const root_node = theContext()->getNode(); + auto const root_node = theContext()->getNodeStrong(); auto const arch_epoch = getNextRootedEpoch(category, root_node); return getTerminatedWindow(arch_epoch)->allocateNewEpoch(); } diff --git a/src/vt/event/event.cc b/src/vt/event/event.cc index 4b68ab46e4..4d3189e52a 100644 --- a/src/vt/event/event.cc +++ b/src/vt/event/event.cc @@ -80,7 +80,7 @@ void AsyncEvent::initialize() { } EventType AsyncEvent::attachAction(EventType const& event, ActionType callable) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); auto trigger = [=]{ callable(); @@ -154,7 +154,7 @@ EventType AsyncEvent::attachAction(EventType const& event, ActionType callable) auto const& node = theEvent()->getOwningNode(event); vtAssert( - node == theContext()->getNode(), "NodeT must be identical" + node == theContext()->getNodeStrong(), "NodeT must be identical" ); auto send_back_fun = [=]{ @@ -173,7 +173,7 @@ EventType AsyncEvent::attachAction(EventType const& event, ActionType callable) normal, event, "checkEventFinishedHan:: event={}, node={}, " "this_node={}, complete={}, sent_from_node={}\n", - event, node, theContext()->getNode(), static_cast(is_complete), + event, node, theContext()->getNodeStrong(), static_cast(is_complete), msg->sent_from_node_ ); @@ -264,10 +264,10 @@ AsyncEvent::EventHolderType& AsyncEvent::getEventHolder(EventType const& event) vt_debug_print( verbose, event, "theEvent: theEventHolder: node={}, event={}, owning_node={}\n", - theContext()->getNode(), event, owning_node + theContext()->getNodeStrong(), event, owning_node ); - if (owning_node != theContext()->getNode()) { + if (owning_node != theContext()->getNodeStrong()) { vtAssert(0, "Event does not belong to this node"); } @@ -293,7 +293,7 @@ AsyncEvent::EventStateType AsyncEvent::testEventComplete(EventType const& event) return EventStateType::EventWaiting; } } else { - if (getOwningNode(event) == theContext()->getNode()) { + if (getOwningNode(event) == theContext()->getNodeStrong()) { return EventStateType::EventReady; } else { return EventStateType::EventRemote; diff --git a/src/vt/group/collective/group_collective_finished.cc b/src/vt/group/collective/group_collective_finished.cc index 2ad60ac8dc..33693def1a 100644 --- a/src/vt/group/collective/group_collective_finished.cc +++ b/src/vt/group/collective/group_collective_finished.cc @@ -59,7 +59,7 @@ void InfoColl::CollSetupFinished::operator()(FinishedReduceMsg* msg) { vtAssert( iter != theGroup()->local_collective_group_info_.end(), "Must exist" ); - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); auto info = iter->second.get(); if ( info->known_root_node_ != this_node and diff --git a/src/vt/group/collective/group_collective_msg.h b/src/vt/group/collective/group_collective_msg.h index 7eb9563b0c..2a954c8edf 100644 --- a/src/vt/group/collective/group_collective_msg.h +++ b/src/vt/group/collective/group_collective_msg.h @@ -86,7 +86,7 @@ struct GroupCollectiveInfoMsg : MsgT { bool is_in_group = false; bool is_static_ = true; ::vt::NodeT child_node_ = {}; - ::vt::NodeT subtree_size_ = 0; + ::vt::NodeT subtree_size_ = NodeT{0}; CountType extra_nodes_ = 0; CountType level_ = 0; }; diff --git a/src/vt/group/collective/group_info_collective.cc b/src/vt/group/collective/group_info_collective.cc index 4859cd836f..d2b748ba7d 100644 --- a/src/vt/group/collective/group_info_collective.cc +++ b/src/vt/group/collective/group_info_collective.cc @@ -70,8 +70,8 @@ namespace vt { namespace group { void InfoColl::setupCollectiveSingular() { - auto const& this_node = theContext()->getNode(); - auto const& num_nodes = theContext()->getNumNodes(); + auto const& this_node = theContext()->getNodeStrong(); + auto const& num_nodes = theContext()->getNumNodesStrong(); auto const& in_group = is_in_group; vtAssert(num_nodes == vt::NodeT{1}, "This method handles single node case"); if (in_group) { @@ -110,7 +110,7 @@ void InfoColl::freeComm() { } void InfoColl::setupCollective() { - auto const& num_nodes = theContext()->getNumNodes(); + auto const& num_nodes = theContext()->getNumNodesStrong(); auto const& group_ = getGroupID(); vtAssert(!collective_ , "Collective should not be initialized"); @@ -143,7 +143,7 @@ void InfoColl::setupCollective() { // group creation is a collective invocation. theGroup()->collective_scope_.mpiCollectiveWait( [in_group,this]{ - auto const this_node_impl = theContext()->getNode(); + auto const this_node_impl = theContext()->getNodeStrong(); auto const cur_comm = theContext()->getComm(); int32_t const group_color = in_group; MPI_Comm_split(cur_comm, group_color, this_node_impl, &mpi_group_comm_); @@ -223,7 +223,7 @@ void InfoColl::setupCollective() { if (collective_->getInitialChildren() == 0) { auto const& size = static_cast<::vt::NodeT >(is_in_group ? 1 : 0); - auto const& child = theContext()->getNode(); + auto const& child = theContext()->getNodeStrong(); auto msg = makeMessage( group_, up_tree_cont_, in_group, size, child ); @@ -271,7 +271,7 @@ void InfoColl::upTree() { if (is_root) { if (is_in_group) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); for (auto&& msg : msg_in_group) { span_children_.push_back(msg->getChild()); } @@ -363,7 +363,7 @@ void InfoColl::upTree() { * Case where we have an approx. a balanced tree: send up the tree like * usual */ - auto const child = theContext()->getNode(); + auto const child = theContext()->getNodeStrong(); auto const total_subtree = static_cast<::vt::NodeT >(subtree_ + subtree_this); auto const level = msg_in_group.size() == 2 ? msg_in_group[0]->getLevel() + 1 : 0; @@ -388,7 +388,7 @@ void InfoColl::upTree() { * bypassing this node that is null: thus, forward the non-null's child's * message up the initial spanning tree */ - auto const child = theContext()->getNode(); + auto const child = theContext()->getNodeStrong(); auto const extra = static_cast( msg_in_group.size() ); @@ -422,7 +422,7 @@ void InfoColl::upTree() { * child in the spanning tree because that will create a stick-like graph, * loosing efficiency! */ - auto const child = theContext()->getNode(); + auto const child = theContext()->getNodeStrong(); auto const extra = 1; subtree_ -= msg_in_group[0]->getSubtreeSize(); @@ -459,7 +459,7 @@ void InfoColl::upTree() { auto const extra = static_cast(msg_in_group.size() / 2); - auto const child = theContext()->getNode(); + auto const child = theContext()->getNodeStrong(); auto tree_iter = msg_list.rbegin(); for (int i = 0; i < extra; i++) { @@ -527,7 +527,7 @@ RemoteOperationIDType InfoColl::makeCollectiveContinuation( } void InfoColl::newRoot(GroupCollectiveMsg* msg) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); vt_debug_print( normal, group, @@ -701,7 +701,7 @@ void InfoColl::finalize() { buf[0] = '\0'; int cur = 0; for (auto&& elm : collective_->span_children_) { - cur += snprintf(buf + cur, max_buffer_length - cur, "%d,", elm); + cur += snprintf(buf + cur, max_buffer_length - cur, "%d,", elm.get()); } auto const& num_children = collective_->span_children_.size(); diff --git a/src/vt/group/global/group_default.cc b/src/vt/group/global/group_default.cc index a143f86a2f..6d188cbf0b 100644 --- a/src/vt/group/global/group_default.cc +++ b/src/vt/group/global/group_default.cc @@ -102,7 +102,7 @@ namespace vt { namespace group { namespace global { default_group_->spanning_tree_ = std::make_unique( collective::tree::tree_cons_tag_t ); - default_group_->this_node_ = theContext()->getNode(); + default_group_->this_node_ = theContext()->getNodeStrong(); vtAssert(phase == 0, "Must be first phase when initializing spanning tree"); } } @@ -156,7 +156,7 @@ namespace vt { namespace group { namespace global { // Destination is where the broadcast originated from auto const& dest = envelopeGetDest(msg->env); auto const& num_children = default_group_->spanning_tree_->getNumChildren(); - auto const node = theContext()->getNode(); + auto const node = theContext()->getNodeStrong(); auto const root_node = NodeT {0}; auto const is_root_of_tree = node == root_node; bool const send_to_root = is_root && !is_root_of_tree; diff --git a/src/vt/group/global/group_default.impl.h b/src/vt/group/global/group_default.impl.h index 3594396f82..9c19613727 100644 --- a/src/vt/group/global/group_default.impl.h +++ b/src/vt/group/global/group_default.impl.h @@ -57,7 +57,7 @@ template * handler> /*static*/ void DefaultGroup::sendPhaseMsg( PhaseType const& phase, NodeT const& node ) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); if (this_node == node) { auto msg = makeMessage(); envelopeSetTag(msg.get()->env, phase); diff --git a/src/vt/group/group_info.impl.h b/src/vt/group/group_info.impl.h index 66c9cabd0e..bc60fe288b 100644 --- a/src/vt/group/group_info.impl.h +++ b/src/vt/group/group_info.impl.h @@ -68,7 +68,7 @@ template /*static*/ void Info::groupSetupHandler(MsgT* msg) { using RangeType = typename MsgT::RangeType; - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); auto const& group_size = msg->getCount(); auto const& group_total_size = msg->getTotalCount(); auto const& group_root = msg->getRoot(); diff --git a/src/vt/group/group_manager.cc b/src/vt/group/group_manager.cc index e23862841f..fda913eb1a 100644 --- a/src/vt/group/group_manager.cc +++ b/src/vt/group/group_manager.cc @@ -78,7 +78,7 @@ GroupType GroupManager::newGroupCollective( } GroupType GroupManager::newGroupCollectiveLabel(GroupCollectiveLabelTagType) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); auto next_id = next_collective_group_id_++; auto const& id = GroupIDBuilder::createGroupID(next_id,this_node,true,true); return id; @@ -88,7 +88,7 @@ GroupType GroupManager::newCollectiveGroup( bool const is_in_group, bool const is_static, ActionGroupType action, bool make_mpi_group ) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); auto new_id = next_collective_group_id_++; bool const is_collective = true; auto const& group = GroupIDBuilder::createGroupID( @@ -104,7 +104,7 @@ GroupType GroupManager::newCollectiveGroup( GroupType GroupManager::newLocalGroup( RegionPtrType in_region, bool const is_static, ActionGroupType action ) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); auto new_id = next_group_id_++; bool const is_collective = false; auto const& group = GroupIDBuilder::createGroupID( @@ -329,7 +329,7 @@ EventType GroupManager::sendGroupCollective( } if (in_group && group_ready) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); auto const& dest = envelopeGetDest(msg->env); auto const& is_bcast = envelopeIsBcast(msg->env); auto const& is_group_collective = GroupIDBuilder::isCollective(group); @@ -437,7 +437,7 @@ EventType GroupManager::sendGroup( bool const is_root, bool* const deliver ) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); auto const& msg = base.get(); auto const& group = envelopeGetGroup(msg->env); auto const& dest = envelopeGetDest(msg->env); diff --git a/src/vt/group/msg/group_msg.h b/src/vt/group/msg/group_msg.h index 6ecb53a6e8..2265cda63a 100644 --- a/src/vt/group/msg/group_msg.h +++ b/src/vt/group/msg/group_msg.h @@ -91,27 +91,27 @@ template struct GroupInfoMsg : MsgT { GroupInfoMsg() = default; GroupInfoMsg( - NodeT const& in_root_node, NodeT const& in_num_nodes, + NodeT const in_root_node, size_t const in_num_nodes, GroupType const& in_group, RemoteOperationIDType in_op, - NodeT const& in_total_num_nodes, - NodeT const& in_parent_node = {} + size_t const in_total_num_nodes, + NodeT const in_parent_node = {} ) : MsgT(in_group, in_op), root_node_(in_root_node), num_nodes_(in_num_nodes), total_num_nodes_(in_total_num_nodes), parent_node_(in_parent_node) { } NodeT getRoot() const { return root_node_; } - NodeT getCount() const { return num_nodes_; } - NodeT getTotalCount() const { return total_num_nodes_; } + size_t getCount() const { return num_nodes_; } + size_t getTotalCount() const { return total_num_nodes_; } NodeT getParent() const { return parent_node_; } bool isStatic() const { return is_static_; } private: - NodeT root_node_ = {}; - NodeT num_nodes_ = {}; - NodeT total_num_nodes_ = {}; - bool is_static_ = true; - NodeT parent_node_ = {}; + NodeT root_node_ = {}; + size_t num_nodes_ = {}; + size_t total_num_nodes_ = {}; + bool is_static_ = true; + NodeT parent_node_ = {}; }; struct GroupListMsg : GroupInfoMsg> { diff --git a/src/vt/group/region/group_range.h b/src/vt/group/region/group_range.h index 548405f3ab..26289fd81d 100644 --- a/src/vt/group/region/group_range.h +++ b/src/vt/group/region/group_range.h @@ -79,9 +79,9 @@ struct Range : Region { friend struct RangeData; private: - BoundType const lo_ = BoundType{}; - BoundType const hi_ = BoundType{}; - BoundType const stride_ = BoundType{1}; + BoundTypeInternal const lo_ = BoundTypeInternal{}; + BoundTypeInternal const hi_ = BoundTypeInternal{}; + BoundTypeInternal const stride_ = BoundTypeInternal{1}; bool made_list_ = false; ListType list_; }; diff --git a/src/vt/group/region/group_region.h b/src/vt/group/region/group_region.h index a7ac3de450..8e18f2d777 100644 --- a/src/vt/group/region/group_region.h +++ b/src/vt/group/region/group_region.h @@ -41,6 +41,7 @@ //@HEADER */ +#include "vt/configs/types/types_node.h" #if !defined INCLUDED_VT_GROUP_REGION_GROUP_REGION_H #define INCLUDED_VT_GROUP_REGION_GROUP_REGION_H @@ -56,7 +57,8 @@ namespace vt { namespace group { namespace region { struct Region { - using BoundType = NodeT; + using BoundType = BaseNodeType; + using BoundTypeInternal = NodeT; using SizeType = size_t; using RegionPtr = Region*; using RegionUPtrType = std::unique_ptr; @@ -79,7 +81,7 @@ struct Region { struct ListHash { size_t operator()(const Region::ListType& v) const { - std::hash hasher; + std::hash hasher; size_t seed = 0; for (const auto i : v) { seed ^= hasher(i) + 0x9e3779b9 + (seed << 6) + (seed >> 2); diff --git a/src/vt/group/rooted/group_info_rooted.cc b/src/vt/group/rooted/group_info_rooted.cc index bfa494b517..f2a58b2810 100644 --- a/src/vt/group/rooted/group_info_rooted.cc +++ b/src/vt/group/rooted/group_info_rooted.cc @@ -83,7 +83,7 @@ void InfoRooted::setupRooted() { size >= static_cast(min_region_size), "Size of the region must be at least min_region_size" ); - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); region_->sort(); if (region_->isList() || size < max_region_list_size) { diff --git a/src/vt/messaging/active.cc b/src/vt/messaging/active.cc index 53017a9a79..a7cee24c76 100644 --- a/src/vt/messaging/active.cc +++ b/src/vt/messaging/active.cc @@ -73,7 +73,7 @@ ActiveMessenger::ActiveMessenger() in_progress_data_irecv(trace_irecv_polling_dm), in_progress_ops(trace_asyncop), # endif - this_node_(theContext()->getNode()) + this_node_(theContext()->getNodeStrong()) { // Register counters for AM/DM message sends and number of bytes amSentCounterGauge = diagnostic::CounterGauge{ diff --git a/src/vt/messaging/active.h b/src/vt/messaging/active.h index 7a61547acc..93dfdcf5c2 100644 --- a/src/vt/messaging/active.h +++ b/src/vt/messaging/active.h @@ -568,7 +568,7 @@ struct ActiveMessenger : runtime::component::PollableComponent template [[deprecated("size must be set in makeMessageSz, use regular sendMsg")]] PendingSendType sendMsgSz( - NodeT dest, + BaseNodeType dest, HandlerType han, MsgPtrThief msg, ByteType msg_size, @@ -589,7 +589,7 @@ struct ActiveMessenger : runtime::component::PollableComponent */ template PendingSendType sendMsg( - NodeT dest, + BaseNodeType dest, HandlerType han, MsgPtrThief msg, TagType tag = no_tag @@ -611,7 +611,7 @@ struct ActiveMessenger : runtime::component::PollableComponent */ template PendingSendType sendMsgAuto( - NodeT dest, + BaseNodeType dest, HandlerType han, MsgPtrThief msg, TagType tag = no_tag @@ -726,7 +726,7 @@ struct ActiveMessenger : runtime::component::PollableComponent */ template * f> PendingSendType sendMsg( - NodeT dest, + BaseNodeType dest, MsgPtrThief msg, TagType tag = no_tag ); @@ -744,7 +744,7 @@ struct ActiveMessenger : runtime::component::PollableComponent */ template PendingSendType sendMsg( - NodeT dest, + BaseNodeType dest, MsgPtrThief::MsgT> msg, TagType tag = no_tag ) { @@ -761,7 +761,7 @@ struct ActiveMessenger : runtime::component::PollableComponent * \return the \c PendingSend for the sent message */ template - PendingSendType send(NodeT dest, Params&&... params) { + PendingSendType send(BaseNodeType dest, Params&&... params) { using Tuple = typename FuncTraits::TupleType; using MsgT = ParamMsg; auto msg = vt::makeMessage(); @@ -807,7 +807,7 @@ struct ActiveMessenger : runtime::component::PollableComponent template * f> [[deprecated("size must be set in makeMessageSz, use regular sendMsg")]] PendingSendType sendMsgSz( - NodeT dest, + BaseNodeType dest, MsgPtrThief msg, ByteType msg_size, TagType tag = no_tag @@ -846,7 +846,7 @@ struct ActiveMessenger : runtime::component::PollableComponent */ template * f> PendingSendType sendMsgAuto( - NodeT dest, + BaseNodeType dest, MsgPtrThief msg, TagType tag = no_tag ); @@ -922,7 +922,7 @@ struct ActiveMessenger : runtime::component::PollableComponent */ template PendingSendType sendMsg( - NodeT dest, + BaseNodeType dest, MsgPtrThief msg, TagType tag = no_tag ); @@ -1037,7 +1037,7 @@ struct ActiveMessenger : runtime::component::PollableComponent */ template PendingSendType sendMsg( - NodeT dest, + BaseNodeType dest, MsgPtrThief msg, TagType tag = no_tag ); @@ -1055,7 +1055,7 @@ struct ActiveMessenger : runtime::component::PollableComponent */ template PendingSendType sendMsg( - NodeT dest, + BaseNodeType dest, MsgPtrThief::MessageType> msg, TagType tag = no_tag ); @@ -1078,7 +1078,7 @@ struct ActiveMessenger : runtime::component::PollableComponent typename MsgT = typename util::FunctorExtractor::MessageType > PendingSendType sendMsgAuto( - NodeT dest, + BaseNodeType dest, MsgPtrThief msg, TagType tag = no_tag ); @@ -1165,7 +1165,7 @@ struct ActiveMessenger : runtime::component::PollableComponent */ template PendingSendType sendMsg( - NodeT dest, + BaseNodeType dest, HandlerType han, MsgPtrThief msg, UserSendFnType send_payload_fn @@ -1184,7 +1184,7 @@ struct ActiveMessenger : runtime::component::PollableComponent */ template * f> PendingSendType sendMsg( - NodeT dest, + BaseNodeType dest, MsgPtrThief msg, UserSendFnType send_payload_fn ); diff --git a/src/vt/messaging/active.impl.h b/src/vt/messaging/active.impl.h index ea6fa87716..79d971df41 100644 --- a/src/vt/messaging/active.impl.h +++ b/src/vt/messaging/active.impl.h @@ -41,6 +41,7 @@ //@HEADER */ +#include "vt/configs/types/types_node.h" #if !defined INCLUDED_VT_MESSAGING_ACTIVE_IMPL_H #define INCLUDED_VT_MESSAGING_ACTIVE_IMPL_H @@ -185,36 +186,36 @@ ActiveMessenger::PendingSendType ActiveMessenger::sendMsgCopyableImpl( template ActiveMessenger::PendingSendType ActiveMessenger::sendMsg( - NodeT dest, + BaseNodeType dest, HandlerType han, MsgPtrThief msg, TagType tag ) { MsgSharedPtr msgptr = msg.msg_; - return sendMsgImpl(dest, han, msgptr, tag); + return sendMsgImpl(NodeT{dest}, han, msgptr, tag); } template ActiveMessenger::PendingSendType ActiveMessenger::sendMsgSz( - NodeT dest, + BaseNodeType dest, HandlerType han, MsgPtrThief msg, ByteType msg_size, TagType tag ) { MsgSharedPtr msgptr(msg.msg_, msg_size); // Note: use explicitly provided message size - return sendMsgImpl(dest, han, msgptr, tag); + return sendMsgImpl(NodeT{dest}, han, msgptr, tag); } template ActiveMessenger::PendingSendType ActiveMessenger::sendMsgAuto( - NodeT dest, + BaseNodeType dest, HandlerType han, MsgPtrThief msg, TagType tag ) { MsgSharedPtr msgptr = msg.msg_; - return sendMsgImpl(dest, han, msgptr, tag); + return sendMsgImpl(NodeT{dest}, han, msgptr, tag); } template * f> @@ -252,36 +253,36 @@ ActiveMessenger::PendingSendType ActiveMessenger::broadcastMsg( template * f> ActiveMessenger::PendingSendType ActiveMessenger::sendMsg( - NodeT dest, + BaseNodeType dest, MsgPtrThief msg, TagType tag ) { auto const han = auto_registry::makeAutoHandler(); MsgSharedPtr msgptr = msg.msg_; - return sendMsgImpl(dest, han, msgptr, tag); + return sendMsgImpl(NodeT{dest}, han, msgptr, tag); } template * f> ActiveMessenger::PendingSendType ActiveMessenger::sendMsgSz( - NodeT dest, + BaseNodeType dest, MsgPtrThief msg, ByteType msg_size, TagType tag ) { auto const han = auto_registry::makeAutoHandler(); MsgSharedPtr msgptr(msg.msg_); - return sendMsgImpl(dest, han, msgptr, tag); + return sendMsgImpl(NodeT{dest}, han, msgptr, tag); } template * f> ActiveMessenger::PendingSendType ActiveMessenger::sendMsgAuto( - NodeT dest, + BaseNodeType dest, MsgPtrThief msg, TagType tag ) { auto const han = auto_registry::makeAutoHandler(); MsgSharedPtr msgptr = msg.msg_; - return sendMsgImpl(dest, han, msgptr, tag); + return sendMsgImpl(NodeT{dest}, han, msgptr, tag); } template * f> @@ -312,13 +313,13 @@ ActiveMessenger::PendingSendType ActiveMessenger::broadcastMsg( template ActiveMessenger::PendingSendType ActiveMessenger::sendMsg( - NodeT dest, + BaseNodeType dest, MsgPtrThief msg, TagType tag ) { auto const han = auto_registry::makeAutoHandler(); MsgSharedPtr msgptr = msg.msg_; - return sendMsgImpl(dest, han, msgptr, tag); + return sendMsgImpl(NodeT{dest}, han, msgptr, tag); } template @@ -347,23 +348,23 @@ ActiveMessenger::PendingSendType ActiveMessenger::broadcastMsg( template ActiveMessenger::PendingSendType ActiveMessenger::sendMsg( - NodeT dest, + BaseNodeType dest, MsgPtrThief msg, TagType tag ) { auto const han = auto_registry::makeAutoHandlerFunctor(); MsgSharedPtr msgptr = msg.msg_; - return sendMsgImpl(dest, han, msgptr, tag); + return sendMsgImpl(NodeT{dest}, han, msgptr, tag); } template ActiveMessenger::PendingSendType ActiveMessenger::sendMsg( - NodeT dest, + BaseNodeType dest, MsgPtrThief::MessageType> msg, TagType tag ) { using MsgT = typename util::FunctorExtractor::MessageType; - return sendMsg(dest, msg, tag); + return sendMsg(NodeT{dest}, msg, tag); } template @@ -380,18 +381,18 @@ ActiveMessenger::PendingSendType ActiveMessenger::broadcastMsgAuto( template ActiveMessenger::PendingSendType ActiveMessenger::sendMsgAuto( - NodeT dest, + BaseNodeType dest, MsgPtrThief msg, TagType tag ) { auto const han = auto_registry::makeAutoHandlerFunctor(); MsgSharedPtr msgptr = msg.msg_; - return sendMsgImpl(dest, han, msgptr, tag); + return sendMsgImpl(NodeT{dest}, han, msgptr, tag); } template ActiveMessenger::PendingSendType ActiveMessenger::sendMsg( - NodeT dest, + BaseNodeType dest, HandlerType han, MsgPtrThief msg, UserSendFnType send_payload_fn @@ -406,12 +407,12 @@ ActiveMessenger::PendingSendType ActiveMessenger::sendMsg( MsgSharedPtr msgptr = msg.msg_; auto tag = no_tag; - return sendMsgImpl(dest, han, msgptr, tag); + return sendMsgImpl(NodeT{dest}, han, msgptr, tag); } template * f> ActiveMessenger::PendingSendType ActiveMessenger::sendMsg( - NodeT dest, + BaseNodeType dest, MsgPtrThief msg, UserSendFnType send_payload_fn ) { diff --git a/src/vt/messaging/collection_chain_set.impl.h b/src/vt/messaging/collection_chain_set.impl.h index 926a0805d6..58aed4f244 100644 --- a/src/vt/messaging/collection_chain_set.impl.h +++ b/src/vt/messaging/collection_chain_set.impl.h @@ -66,7 +66,7 @@ CollectionChainSet::CollectionChainSet( this, "CollectionChainSet" ); - auto const this_node = theContext()->getNode(); + auto const this_node = theContext()->getNodeStrong(); auto const proxy_bits = proxy.getProxy(); ListenerType l = [=](ElementEventEnum event, IndexT idx, NodeT home) { diff --git a/src/vt/objgroup/manager.cc b/src/vt/objgroup/manager.cc index 09dc15e6ca..2e78c9e375 100644 --- a/src/vt/objgroup/manager.cc +++ b/src/vt/objgroup/manager.cc @@ -87,7 +87,7 @@ ObjGroupProxyType ObjGroupManager::makeCollectiveImpl( std::string const& label, HolderBasePtrType base, void* obj_ptr ) { auto const id = cur_obj_id_++; - auto const node = theContext()->getNode(); + auto const node = theContext()->getNodeStrong(); auto const is_collective = true; auto const proxy = proxy::ObjGroupProxy::create(id, node, is_collective); @@ -130,7 +130,7 @@ holder::HolderBase* getHolderBase(HandlerType handler) { elm::ElementIDStruct ObjGroupManager::getNextElm(ObjGroupProxyType proxy) { // Avoid startup races if (theNodeLBData()) { - auto const this_node = theContext()->getNode(); + auto const this_node = theContext()->getNodeStrong(); return elm::ElmIDBits::createObjGroup(proxy, this_node); } else { return elm::ElementIDStruct{}; diff --git a/src/vt/objgroup/manager.impl.h b/src/vt/objgroup/manager.impl.h index cc96264c80..b674bb817e 100644 --- a/src/vt/objgroup/manager.impl.h +++ b/src/vt/objgroup/manager.impl.h @@ -214,7 +214,7 @@ template decltype(auto) ObjGroupManager::invoke(ProxyElmType proxy, Args&&... args) { auto const dest_node = proxy.getNode(); - auto const this_node = theContext()->getNode(); + auto const this_node = theContext()->getNodeStrong(); vtAssert( dest_node == this_node, @@ -276,13 +276,13 @@ ObjGroupManager::PendingSendType ObjGroupManager::reduce( template ObjT* ObjGroupManager::get(ProxyType proxy) { - auto const this_node = theContext()->getNode(); + auto const this_node = theContext()->getNodeStrong(); return get(ProxyElmType(proxy.getProxy(),this_node)); } template ObjT* ObjGroupManager::get(ProxyElmType proxy) { - auto const this_node = theContext()->getNode(); + auto const this_node = theContext()->getNodeStrong(); vtAssert(this_node == proxy.getNode(), "You can only get a local obj"); auto const proxy_bits = proxy.getProxy(); auto iter = objs_.find(proxy_bits); @@ -293,7 +293,7 @@ ObjT* ObjGroupManager::get(ProxyElmType proxy) { template void ObjGroupManager::update(ProxyElmType proxy, Args&&... args) { - auto const this_node = theContext()->getNode(); + auto const this_node = theContext()->getNodeStrong(); vtAssert(this_node == proxy.getNode(), "You can only update a local obj"); auto const proxy_bits = proxy.getProxy(); auto iter = objs_.find(proxy_bits); @@ -314,7 +314,7 @@ void ObjGroupManager::update(ProxyElmType proxy, Args&&... args) { template void ObjGroupManager::update(ProxyType proxy, Args&&... args) { - auto const this_node = theContext()->getNode(); + auto const this_node = theContext()->getNodeStrong(); auto const elm_proxy = ProxyElmType(proxy.getProxy(),this_node); return update(elm_proxy,std::forward(args)...); } @@ -328,7 +328,7 @@ typename ObjGroupManager::ProxyType ObjGroupManager::getProxy(ObjT* obj) { template typename ObjGroupManager::ProxyElmType ObjGroupManager::proxyElm(ObjT* obj) { - return getProxy(obj).operator()(theContext()->getNode()); + return getProxy(obj).operator()(theContext()->getNodeStrong()); } template diff --git a/src/vt/objgroup/manager.static.h b/src/vt/objgroup/manager.static.h index f8a70e14d2..7bd912153d 100644 --- a/src/vt/objgroup/manager.static.h +++ b/src/vt/objgroup/manager.static.h @@ -55,8 +55,8 @@ namespace vt { namespace objgroup { template messaging::PendingSend send(MsgSharedPtr msg, HandlerType han, NodeT dest_node) { - auto const num_nodes = theContext()->getNumNodes(); - auto const this_node = theContext()->getNode(); + auto const num_nodes = theContext()->getNumNodesStrong(); + auto const this_node = theContext()->getNodeStrong(); vtAssert(dest_node < num_nodes, "Invalid node (must be < num_nodes)"); if (dest_node != this_node) { return theMsg()->sendMsg(dest_node, han,msg, no_tag); @@ -67,7 +67,7 @@ messaging::PendingSend send(MsgSharedPtr msg, HandlerType han, NodeT dest_ dispatchObjGroup( inner_msg.template to(), envelopeGetHandler(inner_msg->env), - theContext()->getNode(), + theContext()->getNodeStrong(), nullptr ); }}; @@ -78,7 +78,7 @@ template decltype(auto) invoke( messaging::MsgSharedPtr msg, HandlerType han, NodeT dest_node ) { - auto const this_node = theContext()->getNode(); + auto const this_node = theContext()->getNodeStrong(); vtAssert( dest_node == this_node, diff --git a/src/vt/objgroup/proxy/proxy_objgroup.h b/src/vt/objgroup/proxy/proxy_objgroup.h index 1887d34ded..5d2f31e759 100644 --- a/src/vt/objgroup/proxy/proxy_objgroup.h +++ b/src/vt/objgroup/proxy/proxy_objgroup.h @@ -436,7 +436,7 @@ struct Proxy { * * \return an indexed proxy to that node */ - ProxyElm operator[](::vt::NodeT node) const; + ProxyElm operator[](BaseNodeType node) const; /** * \brief Index the proxy to get the element proxy for a particular node @@ -445,7 +445,7 @@ struct Proxy { * * \return an indexed proxy to that node */ - ProxyElm operator()(::vt::NodeT node) const; + ProxyElm operator()(BaseNodeType node) const; template void serialize(Serializer& s) { @@ -465,7 +465,7 @@ struct Proxy { * * \return an indexed proxy to that node */ - DefaultProxyElm operator[](::vt::NodeT node) const; + DefaultProxyElm operator[](BaseNodeType node) const; /** * \brief Broadcast a message. @@ -544,7 +544,7 @@ struct Proxy { typename MsgT, typename... Args > - messaging::PendingSend reduce(::vt::NodeT root, Args&&... args) const; + messaging::PendingSend reduce(BaseNodeType root, Args&&... args) const; template < typename OpT, @@ -553,7 +553,7 @@ struct Proxy { ActiveTypedFnType* f, typename... Args > - messaging::PendingSend reduce(::vt::NodeT root, Args&&... args) const; + messaging::PendingSend reduce(BaseNodeType root, Args&&... args) const; /** * \brief Reduce a message up the tree, possibly delayed through a pending @@ -569,7 +569,7 @@ struct Proxy { typename FunctorT, typename MsgT > - messaging::PendingSend reduceMsg(::vt::NodeT root, MsgT* const msg) const; + messaging::PendingSend reduceMsg(BaseNodeType root, MsgT* const msg) const; template < typename OpT, @@ -577,7 +577,7 @@ struct Proxy { typename MsgT, ActiveTypedFnType* f > - messaging::PendingSend reduceMsg(::vt::NodeT root, MsgT* const msg) const; + messaging::PendingSend reduceMsg(BaseNodeType root, MsgT* const msg) const; }; using DefaultProxyType = Proxy; diff --git a/src/vt/objgroup/proxy/proxy_objgroup.impl.h b/src/vt/objgroup/proxy/proxy_objgroup.impl.h index ba5786f09a..7eb0ec3994 100644 --- a/src/vt/objgroup/proxy/proxy_objgroup.impl.h +++ b/src/vt/objgroup/proxy/proxy_objgroup.impl.h @@ -283,13 +283,13 @@ ObjT* Proxy::get() const { } template -ProxyElm Proxy::operator[](::vt::NodeT node) const { - return ProxyElm(proxy_,node); +ProxyElm Proxy::operator[](BaseNodeType node) const { + return ProxyElm(proxy_, NodeT{node}); } template -ProxyElm Proxy::operator()(::vt::NodeT node) const { - return ProxyElm(proxy_,node); +ProxyElm Proxy::operator()(BaseNodeType node) const { + return ProxyElm(proxy_, NodeT{node}); } template @@ -364,8 +364,8 @@ void Proxy::destroyHandleSetRDMA(vt::rdma::HandleSet set) const { return vt::theHandleRDMA()->deleteHandleSetCollectiveObjGroup(set); } -inline DefaultProxyElm Proxy::operator[](::vt::NodeT node) const { - return DefaultProxyElm{node}; +inline DefaultProxyElm Proxy::operator[](BaseNodeType node) const { + return DefaultProxyElm{NodeT{node}}; } template * f, typename... Args> @@ -381,7 +381,7 @@ Proxy::broadcastMsg(messaging::MsgPtrThief msg, TagType tag) const { template messaging::PendingSend -Proxy::reduce(::vt::NodeT root, Args&&... args) const { +Proxy::reduce(BaseNodeType root, Args&&... args) const { return reduce< OpT, FunctorT, @@ -399,7 +399,7 @@ template < typename... Args > messaging::PendingSend -Proxy::reduce(::vt::NodeT root, Args&&... args) const { +Proxy::reduce(BaseNodeType root, Args&&... args) const { auto const msg = makeMessage(std::forward(args)...); return reduceMsg(root, msg.get()); } @@ -410,7 +410,7 @@ template < typename MsgT > messaging::PendingSend -Proxy::reduceMsg(::vt::NodeT root, MsgT* const msg) const { +Proxy::reduceMsg(BaseNodeType root, MsgT* const msg) const { return reduceMsg< OpT, FunctorT, @@ -426,7 +426,7 @@ template < ActiveTypedFnType* f > messaging::PendingSend -Proxy::reduceMsg(::vt::NodeT root, MsgT* const msg) const { +Proxy::reduceMsg(BaseNodeType root, MsgT* const msg) const { return theCollective()->global()->reduce(root, msg); } diff --git a/src/vt/phase/phase_manager.cc b/src/vt/phase/phase_manager.cc index 0e270e28fa..0a58c64be6 100644 --- a/src/vt/phase/phase_manager.cc +++ b/src/vt/phase/phase_manager.cc @@ -292,7 +292,7 @@ void PhaseManager::setStartTime() { } void PhaseManager::printSummary(vrt::collection::lb::PhaseInfo* last_phase_info) { - if (theContext()->getNode() == 0) { + if (theContext()->getNodeStrong() == 0) { auto lb_name = vrt::collection::balance::get_lb_names()[ last_phase_info->lb_type ]; diff --git a/src/vt/pipe/callback/anon/callback_anon.impl.h b/src/vt/pipe/callback/anon/callback_anon.impl.h index 04378a0a29..3342d3fdf8 100644 --- a/src/vt/pipe/callback/anon/callback_anon.impl.h +++ b/src/vt/pipe/callback/anon/callback_anon.impl.h @@ -69,7 +69,7 @@ template typename CallbackAnon::template IsVoidType CallbackAnon::triggerDispatch(SignalDataType* data, PipeType const& pid) { // Overload when the signal is void - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); auto const& pipe_node = PipeIDBuilder::getNode(pid); vt_debug_print( terse, pipe, @@ -89,7 +89,7 @@ template typename CallbackAnon::template IsNotVoidType CallbackAnon::triggerDispatch(SignalDataType* data, PipeType const& pid) { // Overload when the signal is non-void - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); auto const& pipe_node = PipeIDBuilder::getNode(pid); vt_debug_print( terse, pipe, diff --git a/src/vt/pipe/callback/anon/callback_anon_tl.cc b/src/vt/pipe/callback/anon/callback_anon_tl.cc index 02f76bb1c0..9a4739a7cc 100644 --- a/src/vt/pipe/callback/anon/callback_anon_tl.cc +++ b/src/vt/pipe/callback/anon/callback_anon_tl.cc @@ -54,7 +54,7 @@ namespace vt { namespace pipe { namespace callback { void CallbackAnonTypeless::triggerVoid(PipeType const& pipe) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); auto const& pipe_node = PipeIDBuilder::getNode(pipe); vt_debug_print( terse, pipe, diff --git a/src/vt/pipe/callback/anon/callback_anon_tl.impl.h b/src/vt/pipe/callback/anon/callback_anon_tl.impl.h index 99605e6411..cb29c64487 100644 --- a/src/vt/pipe/callback/anon/callback_anon_tl.impl.h +++ b/src/vt/pipe/callback/anon/callback_anon_tl.impl.h @@ -61,7 +61,7 @@ void CallbackAnonTypeless::serialize(SerializerT& s) {} template void CallbackAnonTypeless::trigger(MsgT* msg, PipeType const& pipe) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); auto const& pipe_node = PipeIDBuilder::getNode(pipe); vt_debug_print( terse, pipe, diff --git a/src/vt/pipe/callback/handler_bcast/callback_bcast.impl.h b/src/vt/pipe/callback/handler_bcast/callback_bcast.impl.h index ac2e8e52b5..9686a4ce6e 100644 --- a/src/vt/pipe/callback/handler_bcast/callback_bcast.impl.h +++ b/src/vt/pipe/callback/handler_bcast/callback_bcast.impl.h @@ -83,7 +83,7 @@ template template typename CallbackBcast::template IsVoidType CallbackBcast::triggerDispatch(SignalDataType* data, PipeType const& pid) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); vt_debug_print( terse, pipe, "CallbackBcast: (void) trigger_: this_node={}, include_sender_={}\n", @@ -97,7 +97,7 @@ template template typename CallbackBcast::template IsNotVoidType CallbackBcast::triggerDispatch(SignalDataType* data, PipeType const& pid) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); vt_debug_print( terse, pipe, "CallbackBcast: trigger_: this_node={}, include_sender_={}\n", diff --git a/src/vt/pipe/callback/handler_bcast/callback_bcast_tl.cc b/src/vt/pipe/callback/handler_bcast/callback_bcast_tl.cc index e48f25b09e..87034e63fd 100644 --- a/src/vt/pipe/callback/handler_bcast/callback_bcast_tl.cc +++ b/src/vt/pipe/callback/handler_bcast/callback_bcast_tl.cc @@ -58,7 +58,7 @@ CallbackBcastTypeless::CallbackBcastTypeless( { } void CallbackBcastTypeless::triggerVoid(PipeType const& pipe) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); vt_debug_print( terse, pipe, "CallbackBcast: (void) trigger_: pipe={:x}, this_node={}\n", diff --git a/src/vt/pipe/callback/handler_bcast/callback_bcast_tl.impl.h b/src/vt/pipe/callback/handler_bcast/callback_bcast_tl.impl.h index 60025a61fa..ffc0da3ae5 100644 --- a/src/vt/pipe/callback/handler_bcast/callback_bcast_tl.impl.h +++ b/src/vt/pipe/callback/handler_bcast/callback_bcast_tl.impl.h @@ -61,7 +61,7 @@ void CallbackBcastTypeless::serialize(SerializerT& s) { template void CallbackBcastTypeless::trigger(MsgT* msg, PipeType const& pipe) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); vt_debug_print( terse, pipe, diff --git a/src/vt/pipe/callback/handler_send/callback_send.impl.h b/src/vt/pipe/callback/handler_send/callback_send.impl.h index 0e44085b54..0c5c1dd844 100644 --- a/src/vt/pipe/callback/handler_send/callback_send.impl.h +++ b/src/vt/pipe/callback/handler_send/callback_send.impl.h @@ -81,7 +81,7 @@ template template typename CallbackSend::template IsVoidType CallbackSend::triggerDispatch(SignalDataType* data, PipeType const& pid) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); vt_debug_print( terse, pipe, "CallbackSend: (void) trigger_: this_node={}, send_node_={}\n", @@ -101,7 +101,7 @@ template template typename CallbackSend::template IsNotVoidType CallbackSend::triggerDispatch(SignalDataType* data, PipeType const& pid) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); vt_debug_print( terse, pipe, "CallbackSend: trigger_: this_node={}, send_node_={}\n", diff --git a/src/vt/pipe/callback/handler_send/callback_send_han.impl.h b/src/vt/pipe/callback/handler_send/callback_send_han.impl.h index 9e0671339f..4ee1cf5b98 100644 --- a/src/vt/pipe/callback/handler_send/callback_send_han.impl.h +++ b/src/vt/pipe/callback/handler_send/callback_send_han.impl.h @@ -69,7 +69,7 @@ void CallbackSendHandler::serialize(SerializerT& s) { template * f> void CallbackSendHandler::trigger_(SignalDataType* data) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); vt_debug_print( terse, pipe, "CallbackSendHandler: trigger_: this_node={}, send_node_={}\n", diff --git a/src/vt/pipe/callback/handler_send/callback_send_tl.cc b/src/vt/pipe/callback/handler_send/callback_send_tl.cc index bcbb0150de..845f54f8a9 100644 --- a/src/vt/pipe/callback/handler_send/callback_send_tl.cc +++ b/src/vt/pipe/callback/handler_send/callback_send_tl.cc @@ -58,7 +58,7 @@ CallbackSendTypeless::CallbackSendTypeless( { } void CallbackSendTypeless::triggerVoid(PipeType const& pipe) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); vt_debug_print( terse, pipe, "CallbackSendTypeless: (void) trigger_: pipe={:x}, this_node={}, " diff --git a/src/vt/pipe/callback/handler_send/callback_send_tl.impl.h b/src/vt/pipe/callback/handler_send/callback_send_tl.impl.h index 6dff10fa7f..c6a185d4d6 100644 --- a/src/vt/pipe/callback/handler_send/callback_send_tl.impl.h +++ b/src/vt/pipe/callback/handler_send/callback_send_tl.impl.h @@ -65,7 +65,7 @@ template void CallbackSendTypeless::trigger(MsgT* msg, PipeType const& pipe) { static_assert(not std::is_same::value, "Must not be no msg"); - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); vt_debug_print( terse, pipe, "CallbackSendTypeless: trigger_: pipe={:x}, this_node={}, send_node_={}\n", diff --git a/src/vt/pipe/callback/proxy_bcast/callback_proxy_bcast_tl.impl.h b/src/vt/pipe/callback/proxy_bcast/callback_proxy_bcast_tl.impl.h index f4a939693d..4b4d3dcf31 100644 --- a/src/vt/pipe/callback/proxy_bcast/callback_proxy_bcast_tl.impl.h +++ b/src/vt/pipe/callback/proxy_bcast/callback_proxy_bcast_tl.impl.h @@ -65,7 +65,7 @@ void CallbackProxyBcastTypeless::serialize(SerializerT& s) {} template void CallbackProxyBcastTypeless::trigger(MsgT* msg, PipeType const& pipe) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); auto const& pipe_node = PipeIDBuilder::getNode(pipe); vt_debug_print( terse, pipe, @@ -96,7 +96,7 @@ void CallbackProxyBcastDirect::serialize(SerializerT& s) { template void CallbackProxyBcastDirect::trigger(MsgT* msg, PipeType const& pipe) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); vt_debug_print( terse, pipe, "CallbackProxyBcastDirect: trigger_: pipe={:x}, this_node={}, " diff --git a/src/vt/pipe/callback/proxy_send/callback_proxy_send_tl.impl.h b/src/vt/pipe/callback/proxy_send/callback_proxy_send_tl.impl.h index c63c437051..5ea297c3ab 100644 --- a/src/vt/pipe/callback/proxy_send/callback_proxy_send_tl.impl.h +++ b/src/vt/pipe/callback/proxy_send/callback_proxy_send_tl.impl.h @@ -62,7 +62,7 @@ void CallbackProxySendTypeless::serialize(SerializerT& s) { } template void CallbackProxySendTypeless::trigger(MsgT* msg, PipeType const& pipe) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); auto const& pipe_node = PipeIDBuilder::getNode(pipe); vt_debug_print( terse, pipe, diff --git a/src/vt/pipe/pipe_manager.h b/src/vt/pipe/pipe_manager.h index 1fd21f1b59..a95877fd5b 100644 --- a/src/vt/pipe/pipe_manager.h +++ b/src/vt/pipe/pipe_manager.h @@ -107,7 +107,7 @@ struct PipeManager * \return a callback */ template - auto makeSend(NodeType node); + auto makeSend(BaseNodeType node); /** * \brief Make callback to an active function @@ -261,7 +261,7 @@ struct PipeManager */ template * f> [[deprecated("Replace with call to makeSend")]] - Callback makeSend(NodeType const& node); + Callback makeSend(BaseNodeType const& node); /** * \brief Make a callback to a particular collection element invoking a diff --git a/src/vt/pipe/pipe_manager.impl.h b/src/vt/pipe/pipe_manager.impl.h index 78d6776e77..dff610242e 100644 --- a/src/vt/pipe/pipe_manager.impl.h +++ b/src/vt/pipe/pipe_manager.impl.h @@ -41,6 +41,7 @@ //@HEADER */ +#include "vt/configs/types/types_node.h" #if !defined INCLUDED_VT_PIPE_PIPE_MANAGER_IMPL_H #define INCLUDED_VT_PIPE_PIPE_MANAGER_IMPL_H @@ -68,7 +69,7 @@ namespace vt { namespace pipe { template void PipeManager::triggerSendBack(PipeType const& pipe, MsgT* data) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); auto const& node_back = PipeIDBuilder::getNode(pipe); if (node_back != this_node) { // Send the message back to the owner node @@ -99,13 +100,13 @@ Callback PipeManager::makeFunc(LifetimeEnum life, FuncMsgType fn) { } template * f> -Callback PipeManager::makeSend(NodeType const& node) { - return makeCallbackSingle(node); +Callback PipeManager::makeSend(BaseNodeType const& node) { + return makeCallbackSingle(NodeT{node}); } template -auto PipeManager::makeSend(NodeType node) { - return makeCallbackFunctor(node); +auto PipeManager::makeSend(BaseNodeType node) { + return makeCallbackFunctor(NodeT{node}); } template @@ -121,9 +122,9 @@ auto PipeManager::makeBcast() { template auto PipeManager::makeSend(Target target) { if constexpr ( - std::is_same_v or + std::is_same_v or std::is_same_v or - std::is_same_v + std::is_same_v ) { return makeCallbackSingle(target); } else { diff --git a/src/vt/pipe/pipe_manager_base.cc b/src/vt/pipe/pipe_manager_base.cc index c302ae3bd8..637b30e136 100644 --- a/src/vt/pipe/pipe_manager_base.cc +++ b/src/vt/pipe/pipe_manager_base.cc @@ -193,7 +193,7 @@ void PipeManagerBase::triggerPipe(PipeType const& pipe) { } PipeType PipeManagerBase::makePipeID(bool const persist, bool const send_back) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); auto const next_id = cur_pipe_id_++; auto const pipe_id = PipeIDBuilder::createPipeID( next_id,this_node,send_back,persist diff --git a/src/vt/pipe/pipe_manager_tl.h b/src/vt/pipe/pipe_manager_tl.h index 779eafd9f5..7b8d824d53 100644 --- a/src/vt/pipe/pipe_manager_tl.h +++ b/src/vt/pipe/pipe_manager_tl.h @@ -92,10 +92,10 @@ struct PipeManagerTL : virtual PipeManagerBase { */ // Single active message function-handler template - auto makeCallbackSingle(NodeType node = uninitialized_destination); + auto makeCallbackSingle(NodeT node = {}); template - auto makeCallbackFunctor(NodeType node = uninitialized_destination); + auto makeCallbackFunctor(NodeT node = {}); // Single active message anon func-handler auto makeCallbackSingleAnonVoid(LifetimeEnum life, FuncVoidType fn); diff --git a/src/vt/pipe/pipe_manager_tl.impl.h b/src/vt/pipe/pipe_manager_tl.impl.h index 09f314cba0..d6cb9dcd27 100644 --- a/src/vt/pipe/pipe_manager_tl.impl.h +++ b/src/vt/pipe/pipe_manager_tl.impl.h @@ -228,7 +228,7 @@ auto PipeManagerTL::makeCallbackProxy(ProxyT proxy) { } template -auto PipeManagerTL::makeCallbackSingle(NodeType node) { +auto PipeManagerTL::makeCallbackSingle(NodeT node) { auto const new_pipe_id = makePipeID(true,false); using Trait = FuncTraits; @@ -254,7 +254,7 @@ auto PipeManagerTL::makeCallbackSingle(NodeType node) { } template -auto PipeManagerTL::makeCallbackFunctor(NodeType node) { +auto PipeManagerTL::makeCallbackFunctor(NodeT node) { auto const new_pipe_id = makePipeID(true,false); using Trait = FunctorTraits; diff --git a/src/vt/rdma/channel/rdma_channel.cc b/src/vt/rdma/channel/rdma_channel.cc index c534108f73..dae509e133 100644 --- a/src/vt/rdma/channel/rdma_channel.cc +++ b/src/vt/rdma/channel/rdma_channel.cc @@ -57,7 +57,7 @@ Channel::Channel( non_target_(in_non_target), num_bytes_(in_num_bytes), ptr_(in_ptr), op_type_(in_op_type), channel_group_tag_(in_channel_group_tag) { - auto const& my_node = theContext()->getNode(); + auto const& my_node = theContext()->getNodeStrong(); is_target_ = target_ == my_node; diff --git a/src/vt/rdma/collection/rdma_collection.cc b/src/vt/rdma/collection/rdma_collection.cc index 641a9136a0..8bf92bd214 100644 --- a/src/vt/rdma/collection/rdma_collection.cc +++ b/src/vt/rdma/collection/rdma_collection.cc @@ -90,7 +90,7 @@ namespace vt { namespace rdma { ) { auto const& rdma = theRDMA(); - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); auto const& handle_getNode = RDMA_HandleManagerType::getRdmaNode(rdma_handle); auto const& is_collective = RDMA_HandleManagerType::isCollective(rdma_handle); @@ -155,7 +155,7 @@ namespace vt { namespace rdma { ) { auto const& rdma = theRDMA(); - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); auto const& handle_getNode = RDMA_HandleManagerType::getRdmaNode(rdma_handle); auto const& is_collective = RDMA_HandleManagerType::isCollective(rdma_handle); diff --git a/src/vt/rdma/group/rdma_map.h b/src/vt/rdma/group/rdma_map.h index 466026a576..49203bbcea 100644 --- a/src/vt/rdma/group/rdma_map.h +++ b/src/vt/rdma/group/rdma_map.h @@ -62,7 +62,7 @@ struct Map { static NodeT defaultBlockMap( RDMA_BlockType block, RDMA_BlockType __attribute__((unused)) num_blocks ) { - auto const& num_nodes = theContext()->getNumNodes(); + auto const& num_nodes = theContext()->getNumNodesStrong(); return NodeT{block % num_nodes}; }; diff --git a/src/vt/rdma/rdma.cc b/src/vt/rdma/rdma.cc index 2b9986d096..a893655be7 100644 --- a/src/vt/rdma/rdma.cc +++ b/src/vt/rdma/rdma.cc @@ -71,7 +71,7 @@ RDMAManager::RDMAManager() msg, msg->is_user_msg, msg->rdma_handle, msg_tag, msg->num_bytes, msg->offset, false, nullptr, recv_node, [op_id,recv_node,handle](RDMA_GetType data){ - auto const& my_node = theContext()->getNode(); + auto const& my_node = theContext()->getNodeStrong(); vt_debug_print( normal, rdma, "data is ready\n" ); @@ -326,7 +326,7 @@ RDMA_HandleType RDMAManager::registerNewRdmaHandler( bool const& use_default, RDMA_PtrType const& ptr, ByteType const& num_bytes, bool const& is_collective ) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); RDMA_HandlerType new_handle = RDMA_HandleManagerType::createNewHandler(); RDMA_IdentifierType const& new_identifier = @@ -399,7 +399,7 @@ void RDMAManager::requestGetData( bool const& is_local, RDMA_PtrType const& ptr, NodeT const& from_node, RDMA_ContinuationType cont, ActionType next_action ) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); auto const handler_node = RDMA_HandleManagerType::getRdmaNode(han); auto const& is_collective = RDMA_HandleManagerType::isCollective(han); @@ -484,7 +484,7 @@ void RDMAManager::triggerPutRecvData( ByteType const& num_bytes, ByteType const& offset, ActionType const& action, bool const& is_local, NodeT const& from_node ) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); auto const handler_node = RDMA_HandleManagerType::getRdmaNode(han); auto const& is_collective = RDMA_HandleManagerType::isCollective(han); @@ -520,7 +520,7 @@ RDMA_PtrType RDMAManager::tryPutPtr( RDMA_HandleType const& han, TagType const& tag ) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); auto const& is_collective = RDMA_HandleManagerType::isCollective(han); auto const& handler_node = RDMA_HandleManagerType::getRdmaNode(han); @@ -605,7 +605,7 @@ void RDMAManager::putData( ActionType action_after_put, NodeT const& collective_node, bool const direct_message_send ) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); auto const handle_put_node = RDMA_HandleManagerType::getRdmaNode(han); auto const& is_collective = RDMA_HandleManagerType::isCollective(han); @@ -625,7 +625,7 @@ void RDMAManager::putData( } else { // non-collective put if (put_node != this_node) { - auto const& non_target = theContext()->getNode(); + auto const& non_target = theContext()->getNodeStrong(); auto channel = findChannel( han, RDMA_TypeType::Put, put_node, non_target, false, false ); @@ -856,7 +856,7 @@ void RDMAManager::getRegionTypeless( getDataIntoBuf( han, ptr_offset, (hi-lo)*elm_size, block_offset, no_tag, [=]{ - auto const& my_node = theContext()->getNode(); + auto const& my_node = theContext()->getNodeStrong(); vt_debug_print( normal, rdma, "{}: walk_region: trigger: action={}\n", @@ -917,7 +917,7 @@ void RDMAManager::getDataIntoBuf( ByteType const& offset, TagType const& tag, ActionType next_action, ByteType const& elm_size, NodeT const& collective_node ) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); auto const& handle_getNode = RDMA_HandleManagerType::getRdmaNode(han); auto const& is_collective = RDMA_HandleManagerType::isCollective(han); @@ -937,7 +937,7 @@ void RDMAManager::getDataIntoBuf( } else { // non-collective get if (getNode != this_node) { - auto const& non_target = theContext()->getNode(); + auto const& non_target = theContext()->getNodeStrong(); auto channel = findChannel( han, RDMA_TypeType::Get, getNode, non_target, false, false ); @@ -990,7 +990,7 @@ void RDMAManager::getData( RDMA_HandleType const& han, TagType const& tag, ByteType const& num_bytes, ByteType const& offset, RDMA_RecvType cont ) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); auto const getNode = RDMA_HandleManagerType::getRdmaNode(han); if (getNode != this_node) { @@ -1027,7 +1027,7 @@ void RDMAManager::newChannel( RDMA_TypeType const& type, RDMA_HandleType const& han, NodeT const& spec_target, NodeT const& in_non_target, ActionType const& action ) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); auto const target = getTarget(han, spec_target); auto const non_target = in_non_target == NodeT{} ? this_node : in_non_target; @@ -1070,7 +1070,7 @@ void RDMAManager::setupChannelWithRemote( RDMA_TypeType const& type, RDMA_HandleType const& han, NodeT const& dest, ActionType const& action, NodeT const& override_target ) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); auto const target = getTarget(han, override_target); auto channel = findChannel(han, type, target, dest, false); @@ -1109,7 +1109,7 @@ void RDMAManager::createDirectChannel( RDMA_TypeType const& type, RDMA_HandleType const& han, ActionType const& action, NodeT const& override_target ) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); auto const target = getTarget(han, override_target); bool const& handler_on_node = target == this_node; @@ -1222,7 +1222,7 @@ void RDMAManager::createDirectChannelInternal( ActionType const& action, NodeT const& override_target, TagType const& channel_tag, ByteType const& num_bytes ) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); auto const target = getTarget(han, override_target); auto const rdma_op_type = RDMA_HandleManagerType::getOpType(han); @@ -1317,7 +1317,7 @@ ByteType RDMAManager::lookupBytesHandler(RDMA_HandleType const& han) { void RDMAManager::removeDirectChannel( RDMA_HandleType const& han, NodeT const& override_target, ActionType const& action ) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); auto const target = getTarget(han, override_target); if (this_node != target) { @@ -1352,7 +1352,7 @@ void RDMAManager::removeDirectChannel( TagType RDMAManager::nextRdmaChannelTag() { TagType next_tag = next_channel_tag_++; - NodeT this_node = theContext()->getNode(); + NodeT this_node = theContext()->getNodeStrong(); TagType const& ret = (this_node << 16) | next_tag; return ret; } diff --git a/src/vt/rdma/rdma.h b/src/vt/rdma/rdma.h index 9e7618296b..6279bc44c3 100644 --- a/src/vt/rdma/rdma.h +++ b/src/vt/rdma/rdma.h @@ -631,7 +631,7 @@ struct RDMAManager : runtime::component::Component { RDMA_HandleType const& han, NodeT const& in_target, ActionType const& action = nullptr ) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); auto const& target = getTarget(han, in_target); bool const is_local = true; vtAssert( @@ -681,7 +681,7 @@ struct RDMAManager : runtime::component::Component { RDMA_HandleType const& han, NodeT const& in_target = {}, ActionType const& action = nullptr ) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); auto const& target = getTarget(han, in_target); bool const is_local = false; vtAssert( @@ -713,7 +713,7 @@ struct RDMAManager : runtime::component::Component { RDMA_HandleType const& han, NodeT const& in_target, ActionType const& action = nullptr ) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); auto const& target = getTarget(han, in_target); bool const is_local = false; vtAssert( @@ -788,7 +788,7 @@ struct RDMAManager : runtime::component::Component { MsgT* msg, RDMA_HandleType const& han, FunctionT const& fn, bool const& any_tag, TagType const& tag ) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); auto const handler_node = RDMA_HandleManagerType::getRdmaNode(han); auto const& is_collective = RDMA_HandleManagerType::isCollective(han); @@ -820,7 +820,7 @@ struct RDMAManager : runtime::component::Component { MsgT* msg, RDMA_HandleType const& han, FunctionT const& fn, bool const& any_tag, TagType const& tag ) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); auto const handler_node = RDMA_HandleManagerType::getRdmaNode(han); auto const& is_collective = RDMA_HandleManagerType::isCollective(han); diff --git a/src/vt/rdmahandle/handle.node.h b/src/vt/rdmahandle/handle.node.h index 0df9765597..7e84d630c1 100644 --- a/src/vt/rdmahandle/handle.node.h +++ b/src/vt/rdmahandle/handle.node.h @@ -121,7 +121,7 @@ struct Handle< * * \return the node */ - vt::NodeT getNode() const { return vt::theContext()->getNode(); } + vt::NodeT getNode() const { return vt::theContext()->getNodeStrong(); } /** * \brief Check if the handle is ready to be used; implies that all MPI diff --git a/src/vt/rdmahandle/handle_set.h b/src/vt/rdmahandle/handle_set.h index 9a4a4846eb..797e48d070 100644 --- a/src/vt/rdmahandle/handle_set.h +++ b/src/vt/rdmahandle/handle_set.h @@ -111,7 +111,7 @@ struct HandleSet { */ HandleType& get(LookupType lookup) { vtAssertExpr(valid_); - auto this_node = static_cast(theContext()->getNode()); + auto this_node = static_cast(theContext()->getNodeStrong()); auto idx = IndexType(this_node, lookup); auto iter = set_.find(idx); vtAssert(iter != set_.end(), "Index must exist here"); diff --git a/src/vt/rdmahandle/holder.impl.h b/src/vt/rdmahandle/holder.impl.h index 756822b4d2..0d046068b5 100644 --- a/src/vt/rdmahandle/holder.impl.h +++ b/src/vt/rdmahandle/holder.impl.h @@ -84,7 +84,7 @@ void Holder::allocateDataWindow(std::size_t const in_len) { &control_window_ ); { - auto this_node = theContext()->getNode(); + auto this_node = theContext()->getNodeStrong(); LockMPI _scope_lock(Lock::Exclusive, this_node, control_window_, false); auto mpi_type = TypeMPI::getType(); MPI_Put(&count_, 1, mpi_type, this_node, 0, 1, mpi_type, control_window_); @@ -136,7 +136,7 @@ std::shared_ptr Holder::lock(Lock l, vt::NodeT node) { template template void Holder::access(Lock l, Callable fn, std::size_t offset) { - auto this_node = theContext()->getNode(); + auto this_node = theContext()->getNodeStrong(); LockMPI _scope_lock(l, this_node, data_window_); fn(data_base_ + offset, count_ - offset); diff --git a/src/vt/rdmahandle/manager.collection.impl.h b/src/vt/rdmahandle/manager.collection.impl.h index 0b795bc456..e6f24ca08d 100644 --- a/src/vt/rdmahandle/manager.collection.impl.h +++ b/src/vt/rdmahandle/manager.collection.impl.h @@ -118,9 +118,9 @@ Handle Manager::makeCollectionHandles( // Count the number of local handles that should exist here. We can't use the // cached value in the collection manager since this might be invoked in the // an element's constructor before they are all created. - auto this_node = theContext()->getNode(); - auto num_nodes = theContext()->getNumNodes(); - auto min_node_mapped = theContext()->getNumNodes(); + auto this_node = theContext()->getNodeStrong(); + auto num_nodes = theContext()->getNumNodesStrong(); + auto min_node_mapped = theContext()->getNumNodesStrong(); std::size_t local_count = 0; auto const& map_fn = auto_registry::getHandlerMap(map_han); range.foreach ([&](IndexT cur_idx) { diff --git a/src/vt/rdmahandle/manager.impl.h b/src/vt/rdmahandle/manager.impl.h index d1fb92591c..cf71562bde 100644 --- a/src/vt/rdmahandle/manager.impl.h +++ b/src/vt/rdmahandle/manager.impl.h @@ -158,13 +158,13 @@ HandleSet Manager::makeHandleSetCollectiveObjGroup( using LookupType = LookupT; using IndexType = typename HandleSet::IndexType; using SubType = SubHandle; - auto const num_nodes = vt::theContext()->getNumNodes(); + auto const num_nodes = vt::theContext()->getNumNodesStrong(); IndexType range(static_cast(num_nodes), max_lookup); auto proxy = SubType::template construct( false, range, dense_start_with_zero ); HandleSet set(typename HandleSet::BuildSetTagType{}); - auto const this_node = static_cast(vt::theContext()->getNode()); + auto const this_node = static_cast(vt::theContext()->getNodeStrong()); for (auto&& elm : map) { IndexType idx(this_node, elm.first); set.addHandle(idx, proxy.get()->addLocalIndex(idx, elm.second)); diff --git a/src/vt/rdmahandle/sub_handle.impl.h b/src/vt/rdmahandle/sub_handle.impl.h index 4868840d23..54da4b42b5 100644 --- a/src/vt/rdmahandle/sub_handle.impl.h +++ b/src/vt/rdmahandle/sub_handle.impl.h @@ -66,8 +66,8 @@ void SubHandle::initialize( template void SubHandle::makeSubHandles(bool initial) { if (ordered_opt_) { - auto this_node = theContext()->getNode(); - auto num_nodes = theContext()->getNumNodes(); + auto this_node = theContext()->getNodeStrong(); + auto num_nodes = theContext()->getNumNodesStrong(); auto const& map_fn = auto_registry::getHandlerMap(map_han_); range_.foreach ([&](IndexT cur_idx) { auto home_node = map_fn->dispatch(&cur_idx, &range_, num_nodes); @@ -124,7 +124,7 @@ void SubHandle::makeSubHandles(bool initial) { t[i+1] = sub_handles_[sub_layout_[sub_layout_.size()-1]].count_ + sub_prefix_[(i-2)/2]; }); } else { - auto this_node = theContext()->getNode(); + auto this_node = theContext()->getNodeStrong(); loc_handle_.modifyExclusive([&](uint64_t* t, std::size_t) { uint64_t i = 0; for (i = 0; i < num_local * 4; i += 4) { @@ -154,7 +154,7 @@ SubHandle::linearize(IndexT idx) { template NodeT SubHandle::getHomeNode(IndexT const& idx) { auto const& fn = auto_registry::getHandlerMap(map_han_); - auto const num_nodes = theContext()->getNumNodes(); + auto const num_nodes = theContext()->getNumNodesStrong(); auto idx_p = idx; return fn->dispatch(&idx_p, &range_, num_nodes); } @@ -164,7 +164,7 @@ int SubHandle::getOrderedOffset(IndexT idx, NodeT home_node) { auto iter = ordered_local_offset_.find(idx); int found_offset = 0; if (iter == ordered_local_offset_.end()) { - auto num_nodes = theContext()->getNumNodes(); + auto num_nodes = theContext()->getNumNodesStrong(); auto const& map_fn = auto_registry::getHandlerMap(map_han_); int offset = 0; range_.foreach ([&](IndexT cur_idx) { @@ -189,7 +189,7 @@ void SubHandle::updateInfo( ) { vtAssertExpr(not ordered_opt_); vtAssertExpr(is_migratable_); - auto this_node = theContext()->getNode(); + auto this_node = theContext()->getNodeStrong(); auto home_size = loc_handle_.getCount(home); vt_debug_print( normal, rdma, @@ -226,7 +226,7 @@ void SubHandle::updateInfo( template IndexInfo SubHandle::fetchInfo(IndexT const& idx) { - auto this_node = theContext()->getNode(); + auto this_node = theContext()->getNodeStrong(); auto home_node = getHomeNode(idx); if (ordered_opt_) { auto offset = getOrderedOffset(idx, home_node); @@ -310,7 +310,7 @@ template IndexInfo SubHandle::resolveLocation(IndexT const& idx) { auto iter = sub_handles_.find(idx); if (iter != sub_handles_.end()) { - auto const this_node = vt::theContext()->getNode(); + auto const this_node = vt::theContext()->getNodeStrong(); return IndexInfo(this_node, iter->second.offset_, iter->second.count_); } else { if (cache_.hasIndex(idx)) { diff --git a/src/vt/registry/auto/auto_registry_common.h b/src/vt/registry/auto/auto_registry_common.h index 5bd6879f06..f980f00974 100644 --- a/src/vt/registry/auto/auto_registry_common.h +++ b/src/vt/registry/auto/auto_registry_common.h @@ -41,6 +41,7 @@ //@HEADER */ +#include "vt/configs/types/types_node.h" #if !defined INCLUDED_VT_REGISTRY_AUTO_AUTO_REGISTRY_COMMON_H #define INCLUDED_VT_REGISTRY_AUTO_AUTO_REGISTRY_COMMON_H @@ -149,7 +150,7 @@ struct BaseMapsDispatcher { virtual NodeT dispatch( index::BaseIndex* cur_idx_ptr, index::BaseIndex* range_ptr, - NodeT num_nodes + BaseNodeType num_nodes ) const = 0; }; @@ -161,7 +162,7 @@ struct MapsDispatcher final : BaseMapsDispatcher { NodeT dispatch( index::BaseIndex* cur_idx_ptr, index::BaseIndex* range_ptr, - NodeT num_nodes + BaseNodeType num_nodes ) const override { using T = HandlerT; diff --git a/src/vt/runnable/invoke.h b/src/vt/runnable/invoke.h index 506985e13d..1376956c00 100644 --- a/src/vt/runnable/invoke.h +++ b/src/vt/runnable/invoke.h @@ -125,7 +125,7 @@ struct ScopedInvokeEvent { ScopedInvokeEvent() { const auto trace_id = CallableWrapper::GetTraceID(); const auto trace_event = theTrace()->messageCreation(trace_id, 0); - const auto from_node = theContext()->getNode(); + const auto from_node = theContext()->getNodeStrong(); tag_ = theTrace()->beginProcessing( trace_id, 0, trace_event, from_node, timing::getCurrentTime() diff --git a/src/vt/runtime/runtime.cc b/src/vt/runtime/runtime.cc index 442041ac31..01ebcf5f3e 100644 --- a/src/vt/runtime/runtime.cc +++ b/src/vt/runtime/runtime.cc @@ -251,7 +251,7 @@ void Runtime::pauseForDebugger() { if (theConfig()->vt_pause) { constexpr int max_buffer_length = 256; char node_str[max_buffer_length]; - auto node = vt::theContext() ? vt::theContext()->getNode() : -1; + auto node = vt::theContext() ? vt::theContext()->getNodeStrong() : -1; snprintf(node_str, max_buffer_length, "prog-%d.pid", node); auto const pid = getpid(); FILE* f = fopen(node_str, "w+"); @@ -262,7 +262,7 @@ void Runtime::pauseForDebugger() { } /*static*/ void Runtime::sigHandlerINT(int sig) { - auto node = vt::theContext() ? vt::theContext()->getNode() : NodeT{-1}; + auto node = vt::theContext() ? vt::theContext()->getNodeStrong() : NodeT{-1}; auto vt_pre = debug::vtPre(); auto node_str = ::vt::debug::proc(node); auto prefix = vt_pre + node_str + " "; @@ -441,7 +441,7 @@ bool Runtime::initialize(bool const force_now) { MPI_Comm comm = theContext->getComm(); MPI_Barrier(comm); - if (theContext->getNode() == 0) { + if (theContext->getNodeStrong() == 0) { printStartupBanner(); // Enqueue a check for later in case arguments are modified before work // actually executes @@ -482,7 +482,7 @@ bool Runtime::finalize(bool const force_now, bool const disable_sig) { MPI_Comm comm = theContext->getComm(); - auto const& is_zero = theContext->getNode() == 0; + auto const& is_zero = theContext->getNodeStrong() == 0; # if vt_check_enabled(diagnostics) if (getAppConfig()->vt_diag_enable) { @@ -586,7 +586,7 @@ void Runtime::output( std::string const abort_str, ErrorCodeType const code, bool error, bool decorate, bool formatted ) { - auto node = theContext ? theContext->getNode() : NodeT{-1}; + auto node = theContext ? theContext->getNodeStrong() : NodeT{-1}; auto green = debug::green(); auto byellow = debug::byellow(); auto red = debug::red(); diff --git a/src/vt/runtime/runtime_banner.cc b/src/vt/runtime/runtime_banner.cc index 85226d56f5..dee49c7ff4 100644 --- a/src/vt/runtime/runtime_banner.cc +++ b/src/vt/runtime/runtime_banner.cc @@ -71,7 +71,7 @@ void Runtime::printStartupBanner() { return; } - NodeT const nodes = theContext->getNumNodes(); + NodeT const nodes = theContext->getNumNodesStrong(); std::string is_interop_str = is_interop_ ? diff --git a/src/vt/runtime/runtime_diagnostics.cc b/src/vt/runtime/runtime_diagnostics.cc index fa78c6ff20..c5a1baf7fa 100644 --- a/src/vt/runtime/runtime_diagnostics.cc +++ b/src/vt/runtime/runtime_diagnostics.cc @@ -202,7 +202,7 @@ void Runtime::computeAndPrintDiagnostics() { }); }); - if (theContext->getNode() not_eq 0) { + if (theContext->getNodeStrong() not_eq 0) { return; } diff --git a/src/vt/scheduler/scheduler.cc b/src/vt/scheduler/scheduler.cc index 3d52e2773f..9fc829b418 100644 --- a/src/vt/scheduler/scheduler.cc +++ b/src/vt/scheduler/scheduler.cc @@ -57,7 +57,7 @@ namespace vt { namespace sched { /*static*/ void Scheduler::checkTermSingleNode() { - auto const& num_nodes = theContext()->getNumNodes(); + auto const& num_nodes = theContext()->getNumNodesStrong(); if (num_nodes == vt::NodeT{1}) { theTerm()->maybePropagate(); } diff --git a/src/vt/serialization/messaging/serialized_messenger.impl.h b/src/vt/serialization/messaging/serialized_messenger.impl.h index 02a672e0c7..da126f5894 100644 --- a/src/vt/serialization/messaging/serialized_messenger.impl.h +++ b/src/vt/serialization/messaging/serialized_messenger.impl.h @@ -269,7 +269,7 @@ template // wrap metadata payload_msg->handler = han; - payload_msg->from_node = theContext()->getNode(); + payload_msg->from_node = theContext()->getNodeStrong(); // setup envelope envelopeInitCopy(payload_msg->env, msg->env); @@ -297,7 +297,7 @@ template // wrap metadata sys_msg->handler = traceable_han; - sys_msg->from_node = theContext()->getNode(); + sys_msg->from_node = theContext()->getNodeStrong(); sys_msg->ptr_size = ptr_size; // setup envelope envelopeInitCopy(sys_msg->env, msg->env); @@ -388,7 +388,7 @@ template vtAssertExpr(payload_msg == nullptr && data_sender != nullptr); auto send_data = [=](NodeT dest) -> messaging::PendingSend { - auto const& node = theContext()->getNode(); + auto const& node = theContext()->getNodeStrong(); if (node != dest) { auto sys_msg = makeMessage>(); auto send_serialized = [=](Active::SendFnType send){ @@ -402,7 +402,7 @@ template // wrap metadata sys_msg->handler = typed_handler; - sys_msg->from_node = theContext()->getNode(); + sys_msg->from_node = theContext()->getNodeStrong(); // setup envelope envelopeInitCopy(sys_msg->env, msg->env); @@ -454,7 +454,7 @@ template // wrap metadata payload_msg->handler = typed_handler; - payload_msg->from_node = theContext()->getNode(); + payload_msg->from_node = theContext()->getNodeStrong(); // setup envelope envelopeInitCopy(payload_msg->env, msg->env); diff --git a/src/vt/standalone/vt_main.h b/src/vt/standalone/vt_main.h index 2ebcb90ca3..3c5a531e7d 100644 --- a/src/vt/standalone/vt_main.h +++ b/src/vt/standalone/vt_main.h @@ -58,7 +58,7 @@ static constexpr NodeT const main_node = NodeT{0}; template inline void vrLaunchMainContext() { - if (theContext()->getNode() == main_node) { + if (theContext()->getNodeStrong() == main_node) { vt_debug_print(verbose, gen, "vrLaunchMainContext: launching main context\n"); theVirtualManager()->makeVirtual(); } diff --git a/src/vt/termination/dijkstra-scholten/comm.cc b/src/vt/termination/dijkstra-scholten/comm.cc index 3788348429..ad17b3e17a 100644 --- a/src/vt/termination/dijkstra-scholten/comm.cc +++ b/src/vt/termination/dijkstra-scholten/comm.cc @@ -62,7 +62,7 @@ namespace vt { namespace term { namespace ds { "StateDS::requestAck: epoch={:x}, successor={}, count={}\n", epoch, successor, count ); - auto const node = theContext()->getNode(); + auto const node = theContext()->getNodeStrong(); vtAssertExpr(successor != node); auto msg = makeMessage(epoch,node,successor,count); theMsg()->markAsTermMessage(msg); @@ -77,7 +77,7 @@ namespace vt { namespace term { namespace ds { "StateDS::acknowledge: epoch={:x}, predecessor={}, count={}\n", epoch, predecessor, count ); - auto const node = theContext()->getNode(); + auto const node = theContext()->getNodeStrong(); vtAssertExpr(predecessor != node); auto msg = makeMessage(epoch,node,predecessor,count); theMsg()->markAsTermMessage(msg); @@ -116,7 +116,7 @@ namespace vt { namespace term { namespace ds { StateDS::getTerminator(EpochType const& epoch) { auto term_iter = theTerm()->term_.find(epoch); if (term_iter == theTerm()->term_.end()) { - auto const this_node = theContext()->getNode(); + auto const this_node = theContext()->getNodeStrong(); theTerm()->term_.emplace( std::piecewise_construct, std::forward_as_tuple(epoch), diff --git a/src/vt/termination/graph/epoch_graph.cc b/src/vt/termination/graph/epoch_graph.cc index 0d5759d15f..94dd2a2acc 100644 --- a/src/vt/termination/graph/epoch_graph.cc +++ b/src/vt/termination/graph/epoch_graph.cc @@ -207,7 +207,7 @@ std::string EpochGraph::outputDOT(bool verbose) { } void EpochGraph::writeToFile(std::string const& dot, bool global, std::string tag) { - auto const node = theContext()->getNode(); + auto const node = theContext()->getNodeStrong(); auto const base_file = "epoch_graph"; if (tag != "") { tag = tag + "."; diff --git a/src/vt/termination/term_action.cc b/src/vt/termination/term_action.cc index 45ef08f4a8..27c2797f7c 100644 --- a/src/vt/termination/term_action.cc +++ b/src/vt/termination/term_action.cc @@ -89,7 +89,7 @@ void TermAction::queueActions(EpochType epoch) { auto make_runnable = [&](EpochType encap_epoch){ auto msg = makeMessage(epoch, encap_epoch); auto const han = auto_registry::makeAutoHandler(); - auto const this_node = theContext()->getNode(); + auto const this_node = theContext()->getNodeStrong(); runnable::makeRunnable(msg, true, han, this_node) .withTDEpoch(encap_epoch) .enqueue(); diff --git a/src/vt/termination/termination.cc b/src/vt/termination/termination.cc index 2fb2683b44..1c7bce1b07 100644 --- a/src/vt/termination/termination.cc +++ b/src/vt/termination/termination.cc @@ -65,7 +65,7 @@ TerminationDetector::TerminationDetector() : collective::tree::Tree(collective::tree::tree_cons_tag_t), any_epoch_state_(any_epoch_sentinel, false, true, getNumChildren()), hang_(no_epoch, true, false, getNumChildren()), - this_node_(theContext()->getNode()) + this_node_(theContext()->getNodeStrong()) { pushEpoch(term::any_epoch_sentinel); } @@ -543,7 +543,7 @@ void TerminationDetector::startEpochGraphBuild() { } /*static*/ void TerminationDetector::hangCheckHandler(HangCheckMsg* msg) { - fmt::print("{}:hangCheckHandler\n",theContext()->getNode()); + fmt::print("{}:hangCheckHandler\n",theContext()->getNodeStrong()); theTerm()->hang_.activateEpoch(); } @@ -580,7 +580,7 @@ void TerminationDetector::startEpochGraphBuild() { auto r = theTerm()->reducer(); r->reduce(root, msg.get(), cb); - if (theContext()->getNode() != root) { + if (theContext()->getNodeStrong() != root) { theTerm()->has_printed_epoch_graph = true; } } @@ -948,7 +948,7 @@ void TerminationDetector::initializeRootedWaveEpoch( terse, term, "makeEpochRootedWave: root={}, epoch={:x}, successor={:x}," "label={}\n", - theContext()->getNode(), epoch, (EpochType)successor, label + theContext()->getNodeStrong(), epoch, (EpochType)successor, label ); /* @@ -1019,7 +1019,7 @@ EpochType TerminationDetector::makeEpochRooted( vt_debug_print( normal, term, "makeEpochRooted: root={}, use_ds={}, successor={:x}, label={}\n", - theContext()->getNode(), use_ds, (EpochType)successor, label + theContext()->getNodeStrong(), use_ds, (EpochType)successor, label ); bool const force_use_ds = vt::theConfig()->vt_term_rooted_use_ds; diff --git a/src/vt/topos/location/location.impl.h b/src/vt/topos/location/location.impl.h index 1afcca616d..80d5f63c4e 100644 --- a/src/vt/topos/location/location.impl.h +++ b/src/vt/topos/location/location.impl.h @@ -75,7 +75,7 @@ template EntityLocationCoord::EntityLocationCoord(LocInstType const identifier) : LocationCoord(), this_inst(identifier), - recs_(default_max_cache_size, theContext()->getNode()) + recs_(default_max_cache_size, theContext()->getNodeStrong()) { vt_debug_print( normal, location, @@ -97,7 +97,7 @@ void EntityLocationCoord::registerEntity( EntityID const& id, NodeT const& home, LocMsgActionType msg_action, bool const& migrated ) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); auto reg_iter = local_registered_.find(id); vtAssert( @@ -139,7 +139,7 @@ void EntityLocationCoord::registerEntity( ); if (pending_lookup_iter != pending_lookups_.end()) { - auto const& node = theContext()->getNode(); + auto const& node = theContext()->getNodeStrong(); int action = 0; for (auto&& pending_action : pending_lookup_iter->second) { vt_debug_print( @@ -159,7 +159,7 @@ void EntityLocationCoord::registerEntity( * it is migrated here and it's not the home. Thus, we need to * inform the home so that messages can be forwarded. */ - vtAssert(home != uninitialized_destination, "Must have home node info"); + vtAssert(home.get() != uninitialized_destination, "Must have home node info"); if (home != this_node) { vt_debug_print( normal, location, @@ -168,7 +168,7 @@ void EntityLocationCoord::registerEntity( id, home, migrated ); - auto const& ask_node = uninitialized_destination; + auto const& ask_node = NodeT{}; auto msg = makeMessage( this_inst, id, no_location_event_id, ask_node, home ); @@ -196,7 +196,7 @@ void EntityLocationCoord::registerEntityRemote( this_inst, home, create_node, id ); - auto const this_node = theContext()->getNode(); + auto const this_node = theContext()->getNodeStrong(); vtAssert(home == this_node, "Must be registered on home node"); recs_.insert(id, home, LocRecType{id, eLocState::Remote, create_node}); @@ -338,7 +338,7 @@ void EntityLocationCoord::routeMsgEager( EntityID const& id, NodeT const& home_node, MsgSharedPtr const& msg ) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); auto route_to_node = NodeT{}; auto reg_iter = local_registered_.find(id); @@ -393,7 +393,7 @@ template void EntityLocationCoord::getLocation( EntityID const& id, NodeT const& home_node, NodeActionType const& action ) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); auto reg_iter = local_registered_.find(id); @@ -456,7 +456,7 @@ template void EntityLocationCoord::handleEagerUpdate( EntityID const& id, NodeT home_node, NodeT deliver_node ) { - auto this_node = theContext()->getNode(); + auto this_node = theContext()->getNodeStrong(); vtAssert(this_node != deliver_node, "This should have been a forwarding node"); vtAssert(home_node != NodeT{}, "Home node should be valid"); vtAssert(home_node < theContext()->getNumNodes(), "Home node should be valid"); @@ -490,7 +490,7 @@ void EntityLocationCoord::sendEagerUpdate( id, ask_node, home_node, deliver_node ); - auto this_node = theContext()->getNode(); + auto this_node = theContext()->getNodeStrong(); if (ask_node != this_node) { vtAssert(ask_node != NodeT{}, "Ask node must be valid"); auto msg = makeMessage( @@ -506,7 +506,7 @@ void EntityLocationCoord::routeMsgNode( EntityID const& id, NodeT const& home_node, NodeT const& to_node, MsgSharedPtr const& msg ) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); auto const epoch = theMsg()->getEpochContextMsg(msg); vt_debug_print( @@ -580,7 +580,7 @@ void EntityLocationCoord::routeMsgNode( auto ask_node = msg->getAskNode(); if (ask_node != NodeT{}) { - auto delivered_node = theContext()->getNode(); + auto delivered_node = theContext()->getNodeStrong(); sendEagerUpdate(hid, ask_node, home_node, delivered_node); } }; @@ -614,7 +614,7 @@ void EntityLocationCoord::routeMsgNode( EntityID id_ = id; // buffer the message here, the entity will be registered in the future insertPendingEntityAction(id_, [=](NodeT resolved) { - auto const& my_node = theContext()->getNode(); + auto const& my_node = theContext()->getNodeStrong(); vt_debug_print( normal, location, @@ -692,7 +692,7 @@ void EntityLocationCoord::setupMessageForRouting( msg->setHandler(handler); msg->setEntity(id); msg->setHomeNode(home_node); - msg->setLocFromNode(theContext()->getNode()); + msg->setLocFromNode(theContext()->getNodeStrong()); msg->setLocInst(this_inst); } @@ -701,7 +701,7 @@ template void EntityLocationCoord::routeMsgHandlerLocal( MsgSharedPtr const& msg ) { - runnable::makeRunnable(msg, true, msg->getHandler(), theContext()->getNode()) + runnable::makeRunnable(msg, true, msg->getHandler(), theContext()->getNodeStrong()) .withTDEpochFromMsg() .run(); } @@ -749,7 +749,7 @@ void EntityLocationCoord::routeMsg( MsgSharedPtr const& msg, NodeT from_node ) { auto const from = - from_node == NodeT{} ? theContext()->getNode() : + from_node == NodeT{} ? theContext()->getNodeStrong() : from_node; // set field for location routed message diff --git a/src/vt/topos/location/record/record.impl.h b/src/vt/topos/location/record/record.impl.h index c6c0218aba..e29253034b 100644 --- a/src/vt/topos/location/record/record.impl.h +++ b/src/vt/topos/location/record/record.impl.h @@ -59,7 +59,7 @@ LocRecord::LocRecord( template void LocRecord::updateNode(NodeT const& new_node) { - if (new_node == theContext()->getNode()) { + if (new_node == theContext()->getNodeStrong()) { state_ = eLocState::Local; } else { state_ = eLocState::Remote; diff --git a/src/vt/trace/trace.cc b/src/vt/trace/trace.cc index 8efe08b014..f1bdac7eb7 100644 --- a/src/vt/trace/trace.cc +++ b/src/vt/trace/trace.cc @@ -128,7 +128,7 @@ void Trace::loadAndBroadcastSpec() { auto spec_proxy = FileSpec::construct(FileSpecType::TRACE); theTerm()->produce(); - if (theContext()->getNode() == 0) { + if (theContext()->getNodeStrong() == 0) { auto spec_ptr = spec_proxy.get(); spec_ptr->parse(); spec_ptr->broadcastSpec(); @@ -230,7 +230,7 @@ void Trace::addUserEvent(UserEventIDType event) { auto const type = TraceConstantsType::UserEvent; auto const time = getCurrentTime(); - auto const node = theContext()->getNode(); + auto const node = theContext()->getNodeStrong(); logEvent( LogType{time, type, node, event, true} @@ -265,7 +265,7 @@ void Trace::addUserEventBracketedBegin(UserEventIDType event) { auto const type = TraceConstantsType::BeginUserEventPair; auto const time = getCurrentTime(); - auto const node = theContext()->getNode(); + auto const node = theContext()->getNodeStrong(); logEvent( LogType{time, type, node, event, true} @@ -285,7 +285,7 @@ void Trace::addUserEventBracketedEnd(UserEventIDType event) { auto const type = TraceConstantsType::EndUserEventPair; auto const time = getCurrentTime(); - auto const node = theContext()->getNode(); + auto const node = theContext()->getNodeStrong(); logEvent( LogType{time, type, node, event, true} @@ -462,7 +462,7 @@ TraceEventIDType Trace::messageCreation( } auto const type = TraceConstantsType::Creation; - auto const node = theContext()->getNode(); + auto const node = theContext()->getNodeStrong(); return logEvent( LogType{time, ep, type, node, len} @@ -477,7 +477,7 @@ TraceEventIDType Trace::messageCreationBcast( } auto const type = TraceConstantsType::CreationBcast; - auto const node = theContext()->getNode(); + auto const node = theContext()->getNodeStrong(); return logEvent( LogType{time, ep, type, node, len} @@ -493,7 +493,7 @@ TraceEventIDType Trace::messageRecv( } auto const type = TraceConstantsType::MessageRecv; - auto const node = theContext()->getNode(); + auto const node = theContext()->getNodeStrong(); return logEvent( LogType{time, ep, type, node, len} diff --git a/src/vt/trace/trace_lite.cc b/src/vt/trace/trace_lite.cc index 5e14c25db5..4b224c2a50 100644 --- a/src/vt/trace/trace_lite.cc +++ b/src/vt/trace/trace_lite.cc @@ -187,7 +187,7 @@ void TraceLite::setupNames(std::string const& in_prog_name) { return; } - auto const node = theContext()->getNode(); + auto const node = theContext()->getNodeStrong(); trace_name_ = prog_name_ + "." + std::to_string(node) + ".log.gz"; auto dir_name = prog_name_ + "_trace"; @@ -206,7 +206,7 @@ void TraceLite::setupNames(std::string const& in_prog_name) { if (full_dir_name_[full_dir_name_.size() - 1] != '/') full_dir_name_ = full_dir_name_ + "/"; - if (theContext()->getNode() == 0) { + if (theContext()->getNodeStrong() == 0) { int flag = mkdir(full_dir_name_.c_str(), S_IRWXU); if ((flag < 0) && (errno != EEXIST)) { vtAssert(flag >= 0, "Must be able to make directory"); @@ -244,7 +244,7 @@ bool TraceLite::checkDynamicRuntimeEnabled(bool is_end_event) { * current phase (LB phase), which can be disabled via a trace enable * specification file */ - return enabled_ and traceWritingEnabled(theContext()->getNode()) and + return enabled_ and traceWritingEnabled(theContext()->getNodeStrong()) and (trace_enabled_cur_phase_ or is_end_event); } @@ -260,7 +260,7 @@ void TraceLite::addUserEventBracketed( event, begin, end); auto const type = TraceConstantsType::UserEventPair; - NodeT const node = theContext()->getNode(); + NodeT const node = theContext()->getNodeStrong(); logEvent(LogType{begin, type, node, event, true}); logEvent(LogType{end, type, node, event, false}); @@ -364,7 +364,7 @@ void TraceLite::beginIdle(TimeType const time) { ); auto const type = TraceConstantsType::BeginIdle; - NodeT const node = theContext()->getNode(); + NodeT const node = theContext()->getNodeStrong(); emitTraceForTopProcessingEvent(time, TraceConstantsType::EndProcessing); logEvent(LogType{time, type, node}); @@ -386,7 +386,7 @@ void TraceLite::endIdle(TimeType const time) { ); auto const type = TraceConstantsType::EndIdle; - NodeT const node = theContext()->getNode(); + NodeT const node = theContext()->getNodeStrong(); idle_begun_ = false; // must set BEFORE logEvent logEvent(LogType{time, type, node}); @@ -416,7 +416,7 @@ void TraceLite::enableTracing() { enabled_ = true; } void TraceLite::disableTracing() { enabled_ = false; } void TraceLite::cleanupTracesFile() { - auto const& node = theContext()->getNode(); + auto const& node = theContext()->getNodeStrong(); if ( not(traceWritingEnabled(node) or isStsOutputNode(node)) or traces_.empty()) { @@ -459,7 +459,7 @@ void TraceLite::flushTracesFile(bool useGlobalSync) { } void TraceLite::writeTracesFile(int flush, bool is_incremental_flush) { - auto const node = theContext()->getNode(); + auto const node = theContext()->getNodeStrong(); size_t to_write = traces_.size(); @@ -510,7 +510,7 @@ void TraceLite::writeTracesFile(int flush, bool is_incremental_flush) { /*static*/ void TraceLite::outputTraces( vt_gzFile* file, TraceContainerType& traces, TimeType start_time, int flush) { - auto const num_nodes = theContext()->getNumNodes(); + auto const num_nodes = theContext()->getNumNodesStrong(); gzFile gzfile = file->file_type; while (not traces.empty()) { @@ -645,7 +645,7 @@ void TraceLite::outputControlFile(std::ofstream& file) { TraceContainerEventClassType::mapped_type*, bool, TraceEventSeqCompare>; - auto const num_nodes = theContext()->getNumNodes(); + auto const num_nodes = theContext()->getNumNodesStrong(); auto* event_types = TraceContainersType::getEventTypeContainer(); auto* events = TraceContainersType::getEventContainer(); diff --git a/src/vt/trace/trace_user_event.cc b/src/vt/trace/trace_user_event.cc index 3870c2888c..ed7dfffb84 100644 --- a/src/vt/trace/trace_user_event.cc +++ b/src/vt/trace/trace_user_event.cc @@ -73,7 +73,7 @@ UserEventIDType UserEventRegistry::createEvent( #if !vt_check_enabled(trace_only) /*static*/ void UserEventRegistry::newEventHan(NewUserEventMsg* msg) { - vtAssert(theContext()->getNode() == 0, "Must be node 0"); + vtAssert(theContext()->getNodeStrong() == 0, "Must be node 0"); insertNewUserEvent(msg->id_, msg->name_); } @@ -84,7 +84,7 @@ UserEventIDType UserEventRegistry::hash(std::string const& in_event_name) { auto id = std::get<0>(ret); auto inserted = std::get<1>(ret); if (inserted) { - auto const node = theContext()->getNode(); + auto const node = theContext()->getNodeStrong(); if (node != NodeT{0}) { auto msg = makeMessage(false, id, in_event_name); theMsg()->sendMsg(NodeT{0}, msg); @@ -96,7 +96,7 @@ UserEventIDType UserEventRegistry::hash(std::string const& in_event_name) { UserEventIDType UserEventRegistry::rooted(std::string const& in_event_name) { auto ret = newEventImpl(false, true, in_event_name, cur_root_event_++); auto id = std::get<0>(ret); - auto const node = theContext()->getNode(); + auto const node = theContext()->getNodeStrong(); if (node != NodeT{0}) { auto msg = makeMessage(false, id, in_event_name); theMsg()->sendMsg(NodeT{0}, msg); @@ -109,7 +109,7 @@ UserEventIDType UserEventRegistry::user( ) { auto ret = newEventImpl(true, false, in_event_name, seq); auto id = std::get<0>(ret); - auto const node = theContext()->getNode(); + auto const node = theContext()->getNodeStrong(); if (node != NodeT{0}) { auto msg = makeMessage(true, id, in_event_name); theMsg()->sendMsg(NodeT{0}, msg); @@ -127,7 +127,7 @@ std::tuple UserEventRegistry::newEventImpl( bool user, bool rooted, std::string const& in_event, UserSpecEventIDType id, bool hash ) { - auto const node = theContext()->getNode(); + auto const node = theContext()->getNodeStrong(); auto const event = createEvent(user, rooted, node, id, hash); auto const inserted = insertEvent(event, in_event); return std::make_tuple(event, inserted); diff --git a/src/vt/utils/file_spec/spec.cc b/src/vt/utils/file_spec/spec.cc index eb093ad461..0da795aca6 100644 --- a/src/vt/utils/file_spec/spec.cc +++ b/src/vt/utils/file_spec/spec.cc @@ -214,7 +214,7 @@ void FileSpec::parse() { } void FileSpec::broadcastSpec() { - auto root = theContext()->getNode(); + auto root = theContext()->getNodeStrong(); proxy_.template broadcast( spec_mod_, spec_exact_, root ); diff --git a/src/vt/utils/memory/memory_usage.cc b/src/vt/utils/memory/memory_usage.cc index 88ea899111..eebfabe952 100644 --- a/src/vt/utils/memory/memory_usage.cc +++ b/src/vt/utils/memory/memory_usage.cc @@ -344,7 +344,7 @@ MemoryUsage::MemoryUsage() { if (iter != name_map.end()) { reporters_.emplace_back(std::move(all_reporters[iter->second])); } else { - if (theContext()->getNode() == 0) { + if (theContext()->getNodeStrong() == 0) { auto warning = fmt::format( "Invalid memory reporter specified: {}", r ); @@ -362,7 +362,7 @@ MemoryUsage::MemoryUsage() { void MemoryUsage::initialize() { if (theConfig()->vt_print_memory_each_phase) { - auto this_node = theContext()->getNode(); + auto this_node = theContext()->getNodeStrong(); if ( "all" == theConfig()->vt_print_memory_node or std::to_string(this_node) == theConfig()->vt_print_memory_node diff --git a/src/vt/vrt/collection/balance/baselb/baselb.cc b/src/vt/vrt/collection/balance/baselb/baselb.cc index 4d8522b018..163a6f2785 100644 --- a/src/vt/vrt/collection/balance/baselb/baselb.cc +++ b/src/vt/vrt/collection/balance/baselb/baselb.cc @@ -127,7 +127,7 @@ void BaseLB::getArgs(PhaseType phase) { std::shared_ptr BaseLB::normalizeReassignments() { using namespace balance; - auto this_node = theContext()->getNode(); + auto this_node = theContext()->getNodeStrong(); pending_reassignment_->node_ = this_node; runInEpochCollective("Sum migrations", [&] { @@ -253,14 +253,9 @@ void BaseLB::finalize(int32_t global_count) { pending_reassignment_->global_migration_count = global_count; - auto const& this_node = theContext()->getNode(); -<<<<<<< HEAD + auto const& this_node = theContext()->getNodeStrong(); if (this_node == 0) { auto const total_time = timing::getCurrentTime() - start_time_; -======= - if (this_node == vt::NodeT{0}) { - TimeTypeWrapper const total_time = timing::getCurrentTime() - start_time_; ->>>>>>> db4b7d85c (#2099: Types: Make NodeType a strong type and use it across the codebase) vt_debug_print( terse, lb, "BaseLB::finalize: LB total time={}\n", diff --git a/src/vt/vrt/collection/balance/baselb/baselb.h b/src/vt/vrt/collection/balance/baselb/baselb.h index d0dc6edd3a..c1d64c9fc8 100644 --- a/src/vt/vrt/collection/balance/baselb/baselb.h +++ b/src/vt/vrt/collection/balance/baselb/baselb.h @@ -72,12 +72,7 @@ struct BaseLB { using ElementCommType = elm::CommMapType; using TransferDestType = std::tuple; using TransferVecType = std::vector; -<<<<<<< HEAD - using TransferType = std::map; -======= using TransferType = std::map; - using LoadType = double; ->>>>>>> db4b7d85c (#2099: Types: Make NodeType a strong type and use it across the codebase) using MigrationCountCB = std::function; using QuantityType = std::map; using StatisticMapType = std::unordered_map; diff --git a/src/vt/vrt/collection/balance/greedylb/greedylb.cc b/src/vt/vrt/collection/balance/greedylb/greedylb.cc index cbc7dbe3da..2cd577ac91 100644 --- a/src/vt/vrt/collection/balance/greedylb/greedylb.cc +++ b/src/vt/vrt/collection/balance/greedylb/greedylb.cc @@ -150,7 +150,7 @@ void GreedyLB::runLB(LoadType total_load) { } void GreedyLB::loadStats() { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); auto avg_load = getAvgLoad(); auto total_load = getSumLoad(); auto I = getStats()->at(lb::Statistic::Rank_load_modeled).at( @@ -219,16 +219,9 @@ void GreedyLB::reduceCollect() { TimeTypeWrapper(this_load / 1000), TimeTypeWrapper(this_load_begin / 1000), load_over.size() ); -<<<<<<< HEAD proxy.reduce<&GreedyLB::collectHandler, collective::PlusOp>( proxy[0], GreedyPayload{load_over, this_load} ); -======= - using MsgType = GreedyCollectMsg; - auto cb = vt::theCB()->makeSend(proxy[NodeT{0}]); - auto msg = makeMessage(load_over,this_load); - proxy.template reduce>(msg.get(),cb); ->>>>>>> db4b7d85c (#2099: Types: Make NodeType a strong type and use it across the codebase) } void GreedyLB::runBalancer( @@ -236,7 +229,7 @@ void GreedyLB::runBalancer( ) { using CompRecType = GreedyCompareLoadMax; using CompProcType = GreedyCompareLoadMin; - auto const& num_nodes = theContext()->getNumNodes(); + auto const& num_nodes = theContext()->getNumNodesStrong(); ObjSampleType objs{std::move(in_objs)}; LoadProfileType profile{std::move(in_profile)}; std::vector recs; @@ -306,7 +299,7 @@ void GreedyLB::recvObjs(GreedySendMsg* msg) { } void GreedyLB::recvObjsBcast(GreedyBcastMsg* msg) { - auto const n = theContext()->getNode(); + auto const n = theContext()->getNodeStrong(); vt_debug_print( normal, lb, "recvObjs: msg->transfer_.size={}\n", msg->transfer_[n].size() @@ -315,7 +308,7 @@ void GreedyLB::recvObjsBcast(GreedyBcastMsg* msg) { } void GreedyLB::recvObjsDirect(std::size_t len, GreedyLBTypes::ObjIDType* objs) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); auto const& num_recs = len; vt_debug_print( normal, lb, @@ -381,7 +374,7 @@ void GreedyLB::transferObjs(std::vector&& in_load) { } ); } else if (strat_ == DataDistStrategy::pt2pt) { - for (NodeT n = NodeT{0}; n < theContext()->getNumNodes(); n++) { + for (NodeT n = NodeT{0}; n < theContext()->getNumNodesStrong(); n++) { vtAssert( node_transfer.size() == static_cast(theContext()->getNumNodes()), "Must contain all nodes" diff --git a/src/vt/vrt/collection/balance/greedylb/greedylb.h b/src/vt/vrt/collection/balance/greedylb/greedylb.h index 99c0934aab..727295d939 100644 --- a/src/vt/vrt/collection/balance/greedylb/greedylb.h +++ b/src/vt/vrt/collection/balance/greedylb/greedylb.h @@ -72,16 +72,9 @@ enum struct DataDistStrategy : uint8_t { }; struct GreedyLB : LoadSamplerBaseLB { -<<<<<<< HEAD using ElementLoadType = std::unordered_map; - using TransferType = std::map>; - using LoadProfileType = std::unordered_map; -======= - using ElementLoadType = std::unordered_map; using TransferType = std::map>; - using LoadType = double; using LoadProfileType = std::unordered_map; ->>>>>>> db4b7d85c (#2099: Types: Make NodeType a strong type and use it across the codebase) GreedyLB() = default; virtual ~GreedyLB() {} diff --git a/src/vt/vrt/collection/balance/greedylb/greedylb_msgs.h b/src/vt/vrt/collection/balance/greedylb/greedylb_msgs.h index 376e01fcac..4f700b6a3b 100644 --- a/src/vt/vrt/collection/balance/greedylb/greedylb_msgs.h +++ b/src/vt/vrt/collection/balance/greedylb/greedylb_msgs.h @@ -59,7 +59,7 @@ struct GreedyPayload : GreedyLBTypes { GreedyPayload(ObjSampleType const& in_sample, LoadType const& in_profile) : sample_(in_sample) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); auto iter = load_profile_.find(this_node); auto end_iter = load_profile_.end(); vtAssert(iter == end_iter, "Must not exist"); diff --git a/src/vt/vrt/collection/balance/greedylb/greedylb_types.h b/src/vt/vrt/collection/balance/greedylb/greedylb_types.h index 3307b62636..98b0ec21aa 100644 --- a/src/vt/vrt/collection/balance/greedylb/greedylb_types.h +++ b/src/vt/vrt/collection/balance/greedylb/greedylb_types.h @@ -59,12 +59,7 @@ struct GreedyLBTypes { using ObjBinType = int32_t; using ObjBinListType = std::list; using ObjSampleType = std::map; -<<<<<<< HEAD - using LoadProfileType = std::unordered_map; -======= - using LoadType = double; using LoadProfileType = std::unordered_map; ->>>>>>> db4b7d85c (#2099: Types: Make NodeType a strong type and use it across the codebase) }; struct GreedyRecord { @@ -78,34 +73,20 @@ struct GreedyRecord { ObjType getObj() const { return obj_; } private: -<<<<<<< HEAD - GreedyLBTypes::ObjIDType obj_ = { elm::no_element_id, uninitialized_destination }; + GreedyLBTypes::ObjIDType obj_ = { elm::no_element_id, NodeT{} }; LoadType load_ = 0.0; -======= - GreedyLBTypes::ObjIDType obj_ = { elm::no_element_id, NodeT {} }; - LoadType load_ = 0.0f; ->>>>>>> db4b7d85c (#2099: Types: Make NodeType a strong type and use it across the codebase) }; struct GreedyProc { GreedyProc() = default; GreedyProc( -<<<<<<< HEAD - NodeType const& in_node, LoadType const& in_load -======= - NodeT const& in_node, GreedyLBTypes::LoadType const& in_load ->>>>>>> db4b7d85c (#2099: Types: Make NodeType a strong type and use it across the codebase) + NodeT const& in_node, LoadType const& in_load ) : node_(in_node), load_(in_load) {} LoadType getModeledLoad() const { return load_; } -<<<<<<< HEAD - NodeType node_ = uninitialized_destination; - LoadType load_ = 0.0; -======= NodeT node_ = {}; - GreedyLBTypes::LoadType load_ = 0.0f; ->>>>>>> db4b7d85c (#2099: Types: Make NodeType a strong type and use it across the codebase) + LoadType load_ = 0.0; std::vector recs_; }; diff --git a/src/vt/vrt/collection/balance/hierarchicallb/hierlb.cc b/src/vt/vrt/collection/balance/hierarchicallb/hierlb.cc index e5a0200ae7..ad5799490a 100644 --- a/src/vt/vrt/collection/balance/hierarchicallb/hierlb.cc +++ b/src/vt/vrt/collection/balance/hierarchicallb/hierlb.cc @@ -160,8 +160,8 @@ void HierarchicalLB::setupTree(TimeType const threshold) { "Tree must not already be set up when is this called" ); - auto const& this_node = theContext()->getNode(); - auto const& num_nodes = theContext()->getNumNodes(); + auto const& this_node = theContext()->getNodeStrong(); + auto const& num_nodes = theContext()->getNumNodesStrong(); this_threshold = threshold.seconds(); @@ -253,7 +253,7 @@ double HierarchicalLB::getSumLoad() const { } void HierarchicalLB::loadStats() { - auto const this_node = theContext()->getNode(); + auto const this_node = theContext()->getNodeStrong(); auto avg_load = getAvgLoad(); auto total_load = getSumLoad(); auto I = getStats()->at(lb::Statistic::Rank_load_modeled).at( @@ -394,7 +394,7 @@ void HierarchicalLB::startMigrations() { "startMigrations\n" ); - auto const this_node = theContext()->getNode(); + auto const this_node = theContext()->getNodeStrong(); for (auto&& bin : taken_objs) { for (auto&& obj_id : bin.second) { @@ -477,7 +477,7 @@ void HierarchicalLB::lbTreeUp( LoadType const child_load, NodeT const child, ObjSampleType load, NodeT const child_size ) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); vt_debug_print( normal, hierlb, @@ -613,7 +613,7 @@ HierLBChild* HierarchicalLB::findMinChild() { } void HierarchicalLB::sendDownTree() { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); vt_debug_print( normal, hierlb, @@ -693,7 +693,7 @@ void HierarchicalLB::sendDownTree() { } void HierarchicalLB::distributeAmongChildren() { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); vt_debug_print( normal, hierlb, diff --git a/src/vt/vrt/collection/balance/hierarchicallb/hierlb.h b/src/vt/vrt/collection/balance/hierarchicallb/hierlb.h index d45dc2ec40..134002299c 100644 --- a/src/vt/vrt/collection/balance/hierarchicallb/hierlb.h +++ b/src/vt/vrt/collection/balance/hierarchicallb/hierlb.h @@ -64,16 +64,9 @@ namespace vt { namespace vrt { namespace collection { namespace lb { struct HierarchicalLB : LoadSamplerBaseLB { using ChildPtrType = std::unique_ptr; -<<<<<<< HEAD - using ChildMapType = std::unordered_map; - using ElementLoadType = std::unordered_map; - using TransferType = std::map>; -======= using ChildMapType = std::unordered_map; - using ElementLoadType = std::unordered_map; + using ElementLoadType = std::unordered_map; using TransferType = std::map>; - using LoadType = double; ->>>>>>> db4b7d85c (#2099: Types: Make NodeType a strong type and use it across the codebase) HierarchicalLB() = default; virtual ~HierarchicalLB() {} diff --git a/src/vt/vrt/collection/balance/lb_common.cc b/src/vt/vrt/collection/balance/lb_common.cc index 392eea8984..74293e0dbe 100644 --- a/src/vt/vrt/collection/balance/lb_common.cc +++ b/src/vt/vrt/collection/balance/lb_common.cc @@ -133,7 +133,7 @@ LoadSummary getNodeLoads(std::shared_ptr model, PhaseOffset when) void applyReassignment(const std::shared_ptr &reassignment) { runInEpochCollective([&] { - auto from = theContext()->getNode(); + auto from = theContext()->getNodeStrong(); for (auto&& departing_elm : reassignment->depart_) { auto obj_id = departing_elm.first; diff --git a/src/vt/vrt/collection/balance/lb_data_holder.cc b/src/vt/vrt/collection/balance/lb_data_holder.cc index ca52df2ce3..e4dacf7c39 100644 --- a/src/vt/vrt/collection/balance/lb_data_holder.cc +++ b/src/vt/vrt/collection/balance/lb_data_holder.cc @@ -232,7 +232,7 @@ std::unique_ptr LBDataHolder::toJson(PhaseType phase) const { LBDataHolder::LBDataHolder(nlohmann::json const& j) : count_(0) { - auto this_node = theContext()->getNode(); + auto this_node = theContext()->getNodeStrong(); // read metadata for skipped and identical phases readMetadata(j); diff --git a/src/vt/vrt/collection/balance/lb_data_holder.h b/src/vt/vrt/collection/balance/lb_data_holder.h index cceed7d015..f8a2613343 100644 --- a/src/vt/vrt/collection/balance/lb_data_holder.h +++ b/src/vt/vrt/collection/balance/lb_data_holder.h @@ -135,15 +135,11 @@ struct LBDataHolder { std::unordered_map >> user_defined_json_; -<<<<<<< HEAD std::unordered_map> user_per_phase_json_; /// User-defined data from each phase for LB std::unordered_map user_defined_lb_info_; /// Node indices for each ID along with the proxy ID -======= - /// NodeT indices for each ID along with the proxy ID ->>>>>>> db4b7d85c (#2099: Types: Make NodeType a strong type and use it across the codebase) std::unordered_map>> node_idx_; /// Map from id to objgroup proxy std::unordered_map node_objgroup_; diff --git a/src/vt/vrt/collection/balance/lb_data_restart_reader.cc b/src/vt/vrt/collection/balance/lb_data_restart_reader.cc index 91c763a30f..93e537243c 100644 --- a/src/vt/vrt/collection/balance/lb_data_restart_reader.cc +++ b/src/vt/vrt/collection/balance/lb_data_restart_reader.cc @@ -154,7 +154,7 @@ void LBDataRestartReader::determinePhasesToMigrate() { std::vector local_changed_distro; local_changed_distro.resize(num_phases_ - 1); - auto const this_node = theContext()->getNode(); + auto const this_node = theContext()->getNodeStrong(); runInEpochCollective("LBDataRestartReader::updateLocations", [&]{ for (PhaseType i = 0; i < num_phases_ - 1; ++i) { diff --git a/src/vt/vrt/collection/balance/lb_invoke/lb_manager.cc b/src/vt/vrt/collection/balance/lb_invoke/lb_manager.cc index 7bfd1cf108..0067d11825 100644 --- a/src/vt/vrt/collection/balance/lb_invoke/lb_manager.cc +++ b/src/vt/vrt/collection/balance/lb_invoke/lb_manager.cc @@ -199,7 +199,7 @@ void LBManager::defaultPostLBWork(ReassignmentMsg* msg) { last_phase_info_->migration_count = reassignment->global_migration_count; last_phase_info_->ran_lb = true; - if (theContext()->getNode() == 0) { + if (theContext()->getNodeStrong() == 0) { stagePostLBStatistics(stats, last_phase_info_->migration_count); commitPhaseStatistics(phase); } @@ -238,7 +238,7 @@ LBManager::runLB(PhaseType phase, vt::Callback cb) { computeStatistics(model_, false, phase, stats_cb); }); - if (theContext()->getNode() == 0) { + if (theContext()->getNodeStrong() == 0) { stagePreLBStatistics(stats); } elm::CommMapType empty_comm; @@ -290,7 +290,7 @@ void LBManager::startLB( "LBManager::startLB: phase={}\n", phase ); - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); if (this_node == vt::NodeT{0} and not theConfig()->vt_lb_quiet) { vt_debug_print( @@ -319,7 +319,7 @@ void LBManager::startLB( before_lb_stats_ = true; computeStatistics(model_, false, phase, stats_cb); }); - if (theContext()->getNode() == 0) { + if (theContext()->getNodeStrong() == 0) { stagePreLBStatistics(stats); commitPhaseStatistics(phase); } @@ -528,7 +528,7 @@ void LBManager::statsHandler(std::vector const& in_stat_vec) last_phase_info_->max_obj = max; } - if (theContext()->getNode() == 0) { + if (theContext()->getNodeStrong() == 0) { vt_debug_print( normal, lb, "LBManager: Statistic={}: " @@ -545,7 +545,7 @@ void LBManager::statsHandler(std::vector const& in_stat_vec) void LBManager::stagePreLBStatistics(const StatisticMapType &statistics) { // Statistics output when LB is enabled and appropriate flag is enabled - if (theContext()->getNode() != 0 or !theConfig()->vt_lb_statistics) { + if (theContext()->getNodeStrong() != 0 or !theConfig()->vt_lb_statistics) { return; } @@ -565,7 +565,7 @@ void LBManager::stagePostLBStatistics( const StatisticMapType &statistics, int32_t migration_count ) { // Statistics output when LB is enabled and appropriate flag is enabled - if (theContext()->getNode() != 0 or !theConfig()->vt_lb_statistics) { + if (theContext()->getNodeStrong() != 0 or !theConfig()->vt_lb_statistics) { return; } @@ -584,7 +584,7 @@ void LBManager::stagePostLBStatistics( void LBManager::commitPhaseStatistics(PhaseType phase) { // Statistics output when LB is enabled and appropriate flag is enabled - if (theContext()->getNode() != 0 or !theConfig()->vt_lb_statistics) { + if (theContext()->getNodeStrong() != 0 or !theConfig()->vt_lb_statistics) { return; } @@ -735,7 +735,7 @@ bool LBManager::isCollectiveComm(elm::CommCategory cat) const { } void LBManager::createStatisticsFile() { - if (theConfig()->vt_lb_statistics and theContext()->getNode() == 0) { + if (theConfig()->vt_lb_statistics and theContext()->getNodeStrong() == 0) { auto const file_name = theConfig()->getLBStatisticsFile(); auto const compress = theConfig()->vt_lb_statistics_compress; @@ -747,7 +747,7 @@ void LBManager::createStatisticsFile() { auto const dir = theConfig()->vt_lb_statistics_dir; // NodeT 0 creates the directory if ( - theContext()->getNode() == 0 and + theContext()->getNodeStrong() == 0 and not dir.empty() and not created_lbstats_dir_ ) { int flag = mkdir(dir.c_str(), S_IRWXU); @@ -777,7 +777,7 @@ void LBManager::closeStatisticsFile() { // not self-send and have a non-local edge std::unordered_map getSharedEdges(elm::CommMapType const& comm_data) { - auto const this_node = theContext()->getNode(); + auto const this_node = theContext()->getNodeStrong(); std::unordered_map shared_edges; vt_debug_print( diff --git a/src/vt/vrt/collection/balance/model/proposed_reassignment.cc b/src/vt/vrt/collection/balance/model/proposed_reassignment.cc index b7d593218b..28550216cf 100644 --- a/src/vt/vrt/collection/balance/model/proposed_reassignment.cc +++ b/src/vt/vrt/collection/balance/model/proposed_reassignment.cc @@ -52,7 +52,7 @@ ProposedReassignment::ProposedReassignment( ) : ComposedModel(base) , reassignment_(reassignment) { - vtAssert(reassignment_->node_ == vt::theContext()->getNode(), + vtAssert(reassignment_->node_ == vt::theContext()->getNodeStrong(), "ProposedReassignment model needs to be applied to the present node's data"); // Check invariants? diff --git a/src/vt/vrt/collection/balance/node_lb_data.cc b/src/vt/vrt/collection/balance/node_lb_data.cc index 219b84545c..1ea81fd6e4 100644 --- a/src/vt/vrt/collection/balance/node_lb_data.cc +++ b/src/vt/vrt/collection/balance/node_lb_data.cc @@ -156,7 +156,7 @@ void NodeLBData::loadAndBroadcastSpec() { auto spec_proxy = FileSpec::construct(FileSpecType::LB); theTerm()->produce(); - if (theContext()->getNode() == 0) { + if (theContext()->getNodeStrong() == 0) { auto spec_ptr = spec_proxy.get(); spec_ptr->parse(); spec_ptr->broadcastSpec(); @@ -180,7 +180,7 @@ void NodeLBData::createLBDataFile() { auto const dir = theConfig()->vt_lb_data_dir; // NodeT 0 creates the directory - if (not created_dir_ and theContext()->getNode() == 0) { + if (not created_dir_ and theContext()->getNodeStrong() == 0) { int flag = mkdir(dir.c_str(), S_IRWXU); if (flag < 0 && errno != EEXIST) { throw std::runtime_error("Failed to create directory: " + dir); @@ -210,15 +210,11 @@ void NodeLBData::createLBDataFile() { metadata["shared_node"] = node_metadata; } metadata["type"] = "LBDatafile"; -<<<<<<< HEAD - metadata["rank"] = theContext()->getNode(); + metadata["rank"] = theContext()->getNodeStrong().get(); auto phasesMetadata = lb_data_->metadataToJson(); if(phasesMetadata) { metadata["phases"] = *phasesMetadata; } -======= - metadata["rank"] = theContext()->getNode().get(); ->>>>>>> db4b7d85c (#2099: Types: Make NodeType a strong type and use it across the codebase) lb_data_writer_ = std::make_unique( "phases", metadata, file_name, compress ); diff --git a/src/vt/vrt/collection/balance/offlinelb/offlinelb.cc b/src/vt/vrt/collection/balance/offlinelb/offlinelb.cc index 0ed7636aab..d74ace7392 100644 --- a/src/vt/vrt/collection/balance/offlinelb/offlinelb.cc +++ b/src/vt/vrt/collection/balance/offlinelb/offlinelb.cc @@ -57,7 +57,7 @@ void OfflineLB::init(objgroup::proxy::Proxy in_proxy) { void OfflineLB::runLB(LoadType) { auto const& distro = theLBDataReader()->getDistro(phase_ + 1); for (auto&& elm : distro) { - migrateObjectTo(elm, theContext()->getNode()); + migrateObjectTo(elm, theContext()->getNodeStrong()); } theLBDataReader()->clearDistro(phase_ + 1); } diff --git a/src/vt/vrt/collection/balance/randomlb/randomlb.cc b/src/vt/vrt/collection/balance/randomlb/randomlb.cc index 28fb97bc3e..1519851f22 100644 --- a/src/vt/vrt/collection/balance/randomlb/randomlb.cc +++ b/src/vt/vrt/collection/balance/randomlb/randomlb.cc @@ -96,7 +96,7 @@ void RandomLB::inputParams(balance::ConfigEntry* config) { } void RandomLB::runLB(LoadType) { - auto const this_node = theContext()->getNode(); + auto const this_node = theContext()->getNodeStrong(); auto const num_nodes = static_cast(theContext()->getNumNodes()); if (this_node == vt::NodeT{0}) { diff --git a/src/vt/vrt/collection/balance/rotatelb/rotatelb.cc b/src/vt/vrt/collection/balance/rotatelb/rotatelb.cc index efe9f31b5e..77b1af7feb 100644 --- a/src/vt/vrt/collection/balance/rotatelb/rotatelb.cc +++ b/src/vt/vrt/collection/balance/rotatelb/rotatelb.cc @@ -61,19 +61,10 @@ RotateLB::getInputKeysWithHelp() { void RotateLB::inputParams(balance::ConfigEntry* config) { } -<<<<<<< HEAD void RotateLB::runLB(LoadType) { - auto const& this_node = theContext()->getNode(); - auto const& num_nodes = theContext()->getNumNodes(); - auto const next_node = this_node + 1 > num_nodes-1 ? 0 : this_node + 1; -======= -void RotateLB::runLB(TimeType) { - NodeT const this_node = theContext()->getNode(); - auto const num_nodes = theContext()->getNumNodes(); - auto const next_node = this_node + NodeT{1} > num_nodes - NodeT{1} ? - NodeT{0} : - this_node + NodeT{1}; ->>>>>>> db4b7d85c (#2099: Types: Make NodeType a strong type and use it across the codebase) + auto const& this_node = theContext()->getNodeStrong(); + auto const& num_nodes = theContext()->getNumNodesStrong(); + auto const next_node = this_node + 1 > num_nodes-1 ? NodeT{0} : this_node + 1; if (this_node == vt::NodeT{0}) { vt_debug_print( diff --git a/src/vt/vrt/collection/balance/temperedlb/tempered_msgs.h b/src/vt/vrt/collection/balance/temperedlb/tempered_msgs.h index fc6ef4ad6b..387092ea2e 100644 --- a/src/vt/vrt/collection/balance/temperedlb/tempered_msgs.h +++ b/src/vt/vrt/collection/balance/temperedlb/tempered_msgs.h @@ -55,11 +55,7 @@ struct LoadMsg : vt::Message { using MessageParentType = vt::Message; vt_msg_serialize_required(); // node_load_ -<<<<<<< HEAD - using NodeLoadType = std::unordered_map; -======= - using NodeLoadType = std::unordered_map; ->>>>>>> db4b7d85c (#2099: Types: Make NodeType a strong type and use it across the codebase) + using NodeLoadType = std::unordered_map; LoadMsg() = default; LoadMsg(NodeT in_from_node, NodeLoadType const& in_node_load) @@ -70,11 +66,7 @@ struct LoadMsg : vt::Message { return node_load_; } -<<<<<<< HEAD - void addNodeLoad(NodeType node, LoadType load) { -======= - void addNodeLoad(NodeT node, lb::BaseLB::LoadType load) { ->>>>>>> db4b7d85c (#2099: Types: Make NodeType a strong type and use it across the codebase) + void addNodeLoad(NodeT node, LoadType load) { node_load_[node] = load; } diff --git a/src/vt/vrt/collection/balance/temperedlb/temperedlb.cc b/src/vt/vrt/collection/balance/temperedlb/temperedlb.cc index 53ac589724..b586066657 100644 --- a/src/vt/vrt/collection/balance/temperedlb/temperedlb.cc +++ b/src/vt/vrt/collection/balance/temperedlb/temperedlb.cc @@ -63,7 +63,7 @@ namespace vt { namespace vrt { namespace collection { namespace lb { void TemperedLB::init(objgroup::proxy::Proxy in_proxy) { proxy_ = in_proxy; - auto const this_node = theContext()->getNode(); + auto const this_node = theContext()->getNodeStrong(); gen_propagate_.seed(this_node + 12345); gen_sample_.seed(this_node + 54321); } @@ -306,7 +306,7 @@ void TemperedLB::inputParams(balance::ConfigEntry* config) { "knowledge=UserDefined" ); - auto num_nodes = theContext()->getNumNodes().get(); + auto num_nodes = theContext()->getNumNodesStrong().get(); if (knowledge_ == KnowledgeEnum::Log) { if (specified_fanout) { // set the rounds based on the chosen fanout: k=log_f(p) @@ -405,7 +405,7 @@ void TemperedLB::inputParams(balance::ConfigEntry* config) { "or another option" ); - if (theContext()->getNode() == 0) { + if (theContext()->getNodeStrong() == 0) { vt_debug_print( terse, temperedlb, "TemperedLB::inputParams: using knowledge={}, fanout={}, rounds={}, " @@ -453,7 +453,7 @@ void TemperedLB::runLB(LoadType total_load) { should_lb = max > (run_temperedlb_tolerance + 1.0) * target_max_load_; } - if (theContext()->getNode() == NodeT{0}) { + if (theContext()->getNodeStrong() == NodeT{0}) { vt_debug_print( terse, temperedlb, "TemperedLB::runLB: avg={}, max={}, pole={}, imb={}, load={}, should_lb={}\n", @@ -480,7 +480,7 @@ void TemperedLB::doLBStages(LoadType start_imb) { LoadType best_imb = start_imb + 10; uint16_t best_trial = 0; - auto this_node = theContext()->getNode(); + auto this_node = theContext()->getNodeStrong(); for (trial_ = 0; trial_ < num_trials_; ++trial_) { // Clear out data structures @@ -613,7 +613,7 @@ void TemperedLB::loadStatsHandler(std::vector const& vec) { auto const& in = vec[0]; new_imbalance_ = in.I(); - auto this_node = theContext()->getNode(); + auto this_node = theContext()->getNodeStrong(); if (this_node == vt::NodeT{0}) { vt_debug_print( terse, temperedlb, @@ -633,7 +633,7 @@ void TemperedLB::rejectionStatsHandler(int n_rejected, int n_transfers) { double rej = static_cast(n_rejected) / static_cast(n_rejected + n_transfers) * 100.0; - auto this_node = theContext()->getNode(); + auto this_node = theContext()->getNodeStrong(); if (this_node == vt::NodeT{0}) { vt_debug_print( terse, temperedlb, @@ -657,7 +657,7 @@ void TemperedLB::informAsync() { vtAssert(k_max_ > 0, "Number of rounds (k) must be greater than zero"); - auto const this_node = theContext()->getNode(); + auto const this_node = theContext()->getNodeStrong(); if (is_underloaded_) { underloaded_.insert(this_node); } @@ -704,7 +704,7 @@ void TemperedLB::informSync() { vtAssert(k_max_ > 0, "Number of rounds (k) must be greater than zero"); - auto const this_node = theContext()->getNode(); + auto const this_node = theContext()->getNodeStrong(); if (is_underloaded_) { underloaded_.insert(this_node); } @@ -768,8 +768,8 @@ void TemperedLB::propagateRound(uint8_t k_cur, bool sync, EpochType epoch) { trial_, iter_, k_max_, k_cur ); - auto const this_node = theContext()->getNode(); - auto const num_nodes = theContext()->getNumNodes(); + auto const this_node = theContext()->getNodeStrong(); + auto const num_nodes = theContext()->getNumNodesStrong(); std::uniform_int_distribution dist(0, num_nodes.get() - 1); if (!deterministic_) { @@ -992,13 +992,8 @@ std::vector TemperedLB::makeUnderloaded() const { return under; } -<<<<<<< HEAD -std::vector TemperedLB::makeSufficientlyUnderloaded( +std::vector TemperedLB::makeSufficientlyUnderloaded( LoadType load_to_accommodate -======= -std::vector TemperedLB::makeSufficientlyUnderloaded( - TimeType load_to_accommodate ->>>>>>> db4b7d85c (#2099: Types: Make NodeType a strong type and use it across the codebase) ) const { std::vector sufficiently_under = {}; for (auto&& elm : load_info_) { @@ -1315,7 +1310,7 @@ void TemperedLB::thunkMigrations() { cur_objs_.size() ); - auto this_node = theContext()->getNode(); + auto this_node = theContext()->getNodeStrong(); for (auto elm : cur_objs_) { auto obj = elm.first; migrateObjectTo(obj, this_node); diff --git a/src/vt/vrt/collection/balance/temperedlb/temperedlb.h b/src/vt/vrt/collection/balance/temperedlb/temperedlb.h index ce5fb12562..99d6dfaba5 100644 --- a/src/vt/vrt/collection/balance/temperedlb/temperedlb.h +++ b/src/vt/vrt/collection/balance/temperedlb/temperedlb.h @@ -163,17 +163,10 @@ struct TemperedLB : BaseLB { objgroup::proxy::Proxy proxy_ = {}; bool is_overloaded_ = false; bool is_underloaded_ = false; -<<<<<<< HEAD - std::unordered_set selected_ = {}; - std::unordered_set underloaded_ = {}; - std::unordered_set new_underloaded_ = {}; + std::unordered_set selected_ = {}; + std::unordered_set underloaded_ = {}; + std::unordered_set new_underloaded_ = {}; std::unordered_map cur_objs_ = {}; -======= - std::unordered_set selected_ = {}; - std::unordered_set underloaded_ = {}; - std::unordered_set new_underloaded_ = {}; - std::unordered_map cur_objs_ = {}; ->>>>>>> db4b7d85c (#2099: Types: Make NodeType a strong type and use it across the codebase) LoadType this_new_load_ = 0.0; LoadType new_imbalance_ = 0.0; LoadType target_max_load_ = 0.0; diff --git a/src/vt/vrt/collection/balance/testserializationlb/testserializationlb.cc b/src/vt/vrt/collection/balance/testserializationlb/testserializationlb.cc index 9e0eec2065..3e869e59c7 100644 --- a/src/vt/vrt/collection/balance/testserializationlb/testserializationlb.cc +++ b/src/vt/vrt/collection/balance/testserializationlb/testserializationlb.cc @@ -61,7 +61,7 @@ void TestSerializationLB::init(objgroup::proxy::Proxy) { void TestSerializationLB::inputParams(balance::ConfigEntry*) { } void TestSerializationLB::runLB(LoadType) { - auto const this_node = theContext()->getNode(); + auto const this_node = theContext()->getNodeStrong(); for (auto obj : *load_model_) { auto const load = load_model_->getModeledLoad( obj, {balance::PhaseOffset::NEXT_PHASE, balance::PhaseOffset::WHOLE_PHASE} diff --git a/src/vt/vrt/collection/balance/workload_replay.cc b/src/vt/vrt/collection/balance/workload_replay.cc index 602d38b059..0db507d37e 100644 --- a/src/vt/vrt/collection/balance/workload_replay.cc +++ b/src/vt/vrt/collection/balance/workload_replay.cc @@ -77,7 +77,7 @@ void replayWorkloads( ) { using ObjIDType = elm::ElementIDStruct; - auto const this_rank = theContext()->getNode(); + auto const this_rank = theContext()->getNodeStrong(); // remember vt's base load model auto base_load_model = theLBManager()->getBaseLoadModel(); @@ -304,11 +304,11 @@ WorkloadDataMigrator::updateCurrentNodes( lb_reassignment->global_migration_count; for (auto &dep : lb_reassignment->depart_) { ObjIDType id = dep.first; - NodeType dest = dep.second; + NodeT dest = dep.second; id.curr_node = dest; modified_reassignment->depart_[id] = dest; } - auto const this_rank = vt::theContext()->getNode(); + auto const this_rank = vt::theContext()->getNodeStrong(); for (auto &arr : lb_reassignment->arrive_) { ObjIDType id = arr.first; id.curr_node = this_rank; @@ -383,7 +383,7 @@ WorkloadDataMigrator::createModelToMoveWorkloadsHome( std::shared_ptr model_base, std::set migratable_objects_here ) { - auto const this_rank = vt::theContext()->getNode(); + auto const this_rank = vt::theContext()->getNodeStrong(); vt_debug_print( terse, replay, "constructing load model to get loads from file location to home\n" @@ -419,7 +419,7 @@ WorkloadDataMigrator::createModelToMoveWorkloadsHere( std::shared_ptr model_base, std::set migratable_objects_here ) { - auto const this_rank = vt::theContext()->getNode(); + auto const this_rank = vt::theContext()->getNodeStrong(); vt_debug_print( terse, replay, "constructing load model to get loads from home to here\n" diff --git a/src/vt/vrt/collection/balance/zoltanlb/zoltanlb.cc b/src/vt/vrt/collection/balance/zoltanlb/zoltanlb.cc index 248f1f5db8..e440aa9d65 100644 --- a/src/vt/vrt/collection/balance/zoltanlb/zoltanlb.cc +++ b/src/vt/vrt/collection/balance/zoltanlb/zoltanlb.cc @@ -130,7 +130,7 @@ void ZoltanLB::inputParams(balance::ConfigEntry* config) { } void ZoltanLB::runLB(LoadType total_load) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); this_load = total_load; if (this_node == vt::NodeT{0}) { @@ -218,7 +218,7 @@ void ZoltanLB::runLB(LoadType total_load) { } void ZoltanLB::makeGraphSymmetric() { - auto const this_node = theContext()->getNode(); + auto const this_node = theContext()->getNodeStrong(); // Go through the comm graph and extract out paired SendRecv edges that are // not self-send and have a non-local edge @@ -304,7 +304,7 @@ void ZoltanLB::countEdges() { int local_edge = 0; int remote_owned_edge = 0; - auto const this_node = theContext()->getNode(); + auto const this_node = theContext()->getNodeStrong(); for (auto&& elm : load_comm_symm) { if ( elm.first.cat_ == elm::CommCategory::SendRecv and @@ -352,7 +352,7 @@ void ZoltanLB::reduceCount(int max_edges_per_node) { void ZoltanLB::allocateShareEdgeGIDs() { std::unordered_map shared_edges; - auto const this_node = theContext()->getNode(); + auto const this_node = theContext()->getNodeStrong(); for (auto&& elm : load_comm_symm) { auto from = elm.first.fromObj(); auto to = elm.first.toObj(); diff --git a/src/vt/vrt/collection/collection_builder.impl.h b/src/vt/vrt/collection/collection_builder.impl.h index d8ad620b97..443517fd1f 100644 --- a/src/vt/vrt/collection/collection_builder.impl.h +++ b/src/vt/vrt/collection/collection_builder.impl.h @@ -112,7 +112,7 @@ void CollectionManager::makeCollectionImpl(param::ConstructParams& po) { auto const proxy = po.proxy_bits_; auto const has_dynamic_membership = po.dynamic_membership_; - auto const this_node = theContext()->getNode(); + auto const this_node = theContext()->getNodeStrong(); auto const has_bounds = po.has_bounds_; auto const bounds = has_bounds ? po.bounds_ : IndexType{}; auto const label = po.label_; @@ -239,7 +239,7 @@ template bool CollectionManager::elementMappedHere( HandlerType map_han, ObjGroupProxyType map_object, IdxT idx, IdxT bounds ) { - auto const this_node = theContext()->getNode(); + auto const this_node = theContext()->getNodeStrong(); auto const mapped_node = getElementMapping(map_han, map_object, idx, bounds); return mapped_node == this_node; } @@ -255,7 +255,7 @@ NodeT CollectionManager::getElementMapping( auto const& map_fn = is_functor ? auto_registry::getAutoHandlerFunctorMap(map_han) : auto_registry::getAutoHandlerMap(map_han); - auto const num_nodes = theContext()->getNumNodes(); + auto const num_nodes = theContext()->getNumNodesStrong(); auto const mapped_node = map_fn->dispatch(&idx, &bounds, num_nodes); return mapped_node; @@ -264,7 +264,7 @@ NodeT CollectionManager::getElementMapping( if (map_object != no_obj_group) { objgroup::proxy::Proxy> p{map_object}; auto map_obj_ptr = p.get(); - auto num_nodes = theContext()->getNumNodes(); + auto num_nodes = theContext()->getNumNodesStrong(); return map_obj_ptr->map(&idx, idx.ndims(), num_nodes); } diff --git a/src/vt/vrt/collection/manager.cc b/src/vt/vrt/collection/manager.cc index 95c1ef5a95..933a04ccaa 100644 --- a/src/vt/vrt/collection/manager.cc +++ b/src/vt/vrt/collection/manager.cc @@ -102,7 +102,7 @@ VirtualProxyType CollectionManager::makeCollectionProxy( next_collective_id_++ : next_rooted_id_++; - auto const this_node = theContext()->getNode(); + auto const this_node = theContext()->getNodeStrong(); bool const is_collection = true; // Create the new proxy with the `new_dist_id` diff --git a/src/vt/vrt/collection/manager.impl.h b/src/vt/vrt/collection/manager.impl.h index 4bc83eee6b..72ffa5e5f2 100644 --- a/src/vt/vrt/collection/manager.impl.h +++ b/src/vt/vrt/collection/manager.impl.h @@ -380,7 +380,7 @@ ColT* CollectionManager::getCollectionPtrForInvoke( elm_holder->exists(idx), fmt::format( "Element with idx:{} doesn't exist on node:{}\n", idx, - theContext()->getNode())); + theContext()->getNodeStrong())); auto& inner_holder = elm_holder->lookup(idx); @@ -440,7 +440,7 @@ void CollectionManager::invokeCollective( auto untyped_proxy = proxy.getProxy(); auto elm_holder = findElmHolder(untyped_proxy); - auto const this_node = theContext()->getNode(); + auto const this_node = theContext()->getNodeStrong(); elm_holder->foreach([&](IndexType const& idx, Indexable* ptr) { // be careful not to forward here as we are reusing args @@ -457,7 +457,7 @@ auto CollectionManager::invoke( ) { auto ptr = getCollectionPtrForInvoke(proxy); - auto const this_node = theContext()->getNode(); + auto const this_node = theContext()->getNodeStrong(); return runnable::makeRunnableVoid(false, uninitialized_handler, this_node) .withCollection(ptr) @@ -520,7 +520,7 @@ void CollectionManager::invokeMsgImpl( elm_holder->exists(idx), fmt::format( "Element with idx:{} doesn't exist on node:{}\n", idx, - theContext()->getNode() + theContext()->getNodeStrong() ) ); @@ -544,7 +544,7 @@ void CollectionManager::invokeMsgImpl( auto const cur_epoch = theMsg()->setupEpochMsg(msg); auto& inner_holder = elm_holder->lookup(idx); auto const col_ptr = inner_holder.getRawPtr(); - auto const from = theContext()->getNode(); + auto const from = theContext()->getNodeStrong(); msg->setFromNode(from); msg->setProxy(proxy); @@ -587,7 +587,7 @@ messaging::PendingSend CollectionManager::broadcastFromRoot(MsgT* raw_msg) { auto msg = promoteMsg(raw_msg); // broadcast to all nodes - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); auto const& proxy = msg->getBcastProxy(); auto elm_holder = theCollection()->findElmHolder(proxy); auto const bcast_node = VirtualProxyBuilder::getVirtualNode(proxy); @@ -672,7 +672,7 @@ messaging::PendingSend CollectionManager::broadcastCollectiveMsgImpl( ) { using IndexT = typename ColT::IndexType; - msg->setFromNode(theContext()->getNode()); + msg->setFromNode(theContext()->getNodeStrong()); msg->setBcastProxy(proxy.getProxy()); #if vt_check_enabled(trace_enabled) @@ -801,7 +801,7 @@ messaging::PendingSend CollectionManager::broadcastMsgUntypedHandler( ); // save the user's handler in the message - msg->setFromNode(theContext()->getNode()); + msg->setFromNode(theContext()->getNodeStrong()); msg->setVrtHandler(handler); msg->setBcastProxy(col_proxy); @@ -831,7 +831,7 @@ messaging::PendingSend CollectionManager::broadcastMsgUntypedHandler( # endif auto const cur_epoch = theMsg()->setupEpochMsg(msg); - auto const this_node = theContext()->getNode(); + auto const this_node = theContext()->getNodeStrong(); auto const bnode = VirtualProxyBuilder::getVirtualNode(col_proxy); if (this_node != bnode) { @@ -1109,7 +1109,7 @@ messaging::PendingSend CollectionManager::sendMsgUntypedHandler( #endif auto const cur_epoch = theMsg()->setupEpochMsg(msg); - msg->setFromNode(theContext()->getNode()); + msg->setFromNode(theContext()->getNodeStrong()); msg->setVrtHandler(handler); msg->setProxy(toProxy); theMsg()->markAsCollectionMessage(msg); @@ -1638,7 +1638,7 @@ void CollectionManager::insert( auto const mapped_node = getMappedNode(proxy, idx); auto const has_explicit_node = node != NodeT{}; auto const insert_node = has_explicit_node ? node : mapped_node; - auto const this_node = theContext()->getNode(); + auto const this_node = theContext()->getNodeStrong(); bool proceed_with_insertion = true; @@ -1776,7 +1776,7 @@ template MigrateStatus CollectionManager::migrateOut( VirtualProxyType const& col_proxy, IndexT const& idx, NodeT const& dest ) { - auto const this_node = theContext()->getNode(); + auto const this_node = theContext()->getNodeStrong(); vt_debug_print( terse, vrt_coll, @@ -1907,7 +1907,7 @@ MigrateStatus CollectionManager::migrateIn( vc_raw_ptr->preMigrateIn(); // Always update the element ID struct for LB statistic tracking - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); vrt_elm_ptr->elm_id_.curr_node = this_node; auto home_node = getMappedNode(proxy, idx); @@ -1932,7 +1932,7 @@ void CollectionManager::destroy( CollectionProxyWrapType const& proxy ) { using DestroyMsgType = DestroyMsg; - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); auto msg = makeMessage(proxy, this_node); theMsg()->markAsCollectionMessage(msg); @@ -2066,7 +2066,7 @@ template std::string CollectionManager::makeMetaFilename( std::string file_base, bool make_sub_dirs ) { - auto this_node = theContext()->getNode(); + auto this_node = theContext()->getNodeStrong(); if (make_sub_dirs) { int flag = 0; flag = mkdir(file_base.c_str(), S_IRWXU); @@ -2217,7 +2217,7 @@ void CollectionManager::restoreFromFileInPlace( if (proxy(idx).tryGetLocalPtr() == nullptr) { auto mapped_node = getMappedNode(proxy, idx); vtAssertExpr(mapped_node != NodeT{}); - auto this_node = theContext()->getNode(); + auto this_node = theContext()->getNodeStrong(); if (mapped_node != this_node) { theMsg()->send>( diff --git a/src/vt/vrt/collection/types/base.h b/src/vt/vrt/collection/types/base.h index 8e3d280e68..19f5d3ef15 100644 --- a/src/vt/vrt/collection/types/base.h +++ b/src/vt/vrt/collection/types/base.h @@ -69,7 +69,7 @@ struct CollectionBase : Indexable { ProxyType getElementProxy(IndexT const& idx) const; CollectionProxyType getCollectionProxy() const; - virtual void migrate(NodeT const& node) override; + virtual void migrate(BaseNodeType const node) override; template void serialize(Serializer& s); diff --git a/src/vt/vrt/collection/types/base.impl.h b/src/vt/vrt/collection/types/base.impl.h index e66a0d607a..223dff49a3 100644 --- a/src/vt/vrt/collection/types/base.impl.h +++ b/src/vt/vrt/collection/types/base.impl.h @@ -41,6 +41,7 @@ //@HEADER */ +#include "vt/configs/types/types_node.h" #if !defined INCLUDED_VT_VRT_COLLECTION_TYPES_BASE_IMPL_H #define INCLUDED_VT_VRT_COLLECTION_TYPES_BASE_IMPL_H @@ -76,10 +77,10 @@ CollectionBase::getCollectionProxy() const { } template -/*virtual*/ void CollectionBase::migrate(NodeT const& node) { +/*virtual*/ void CollectionBase::migrate(BaseNodeType const node) { auto const proxy = this->getCollectionProxy(); auto const index = this->getIndex(); - CollectionElmAttorney::migrate(proxy(index), node); + CollectionElmAttorney::migrate(proxy(index), NodeT{node}); } template diff --git a/src/vt/vrt/collection/types/has_migrate.h b/src/vt/vrt/collection/types/has_migrate.h index 75894930b5..6bce553fdb 100644 --- a/src/vt/vrt/collection/types/has_migrate.h +++ b/src/vt/vrt/collection/types/has_migrate.h @@ -41,6 +41,7 @@ //@HEADER */ +#include "vt/configs/types/types_node.h" #if !defined INCLUDED_VT_VRT_COLLECTION_TYPES_HAS_MIGRATE_H #define INCLUDED_VT_VRT_COLLECTION_TYPES_HAS_MIGRATE_H @@ -49,7 +50,7 @@ namespace vt { namespace vrt { namespace collection { struct HasMigrate { - virtual void migrate(NodeT const& to_node) = 0; + virtual void migrate(BaseNodeType const to_node) = 0; }; }}} /* end namespace vt::vrt::collection */ diff --git a/src/vt/vrt/collection/types/migratable.cc b/src/vt/vrt/collection/types/migratable.cc index 1156f38008..f1261855aa 100644 --- a/src/vt/vrt/collection/types/migratable.cc +++ b/src/vt/vrt/collection/types/migratable.cc @@ -53,7 +53,7 @@ namespace vt { namespace vrt { namespace collection { Migratable::Migratable() : elm_id_( elm::ElmIDBits::createCollection( - VirtualProxyBuilder::isMigratable(getProxy()), theContext()->getNode() + VirtualProxyBuilder::isMigratable(getProxy()), theContext()->getNodeStrong() ) ) { } diff --git a/src/vt/vrt/collection/types/migratable.h b/src/vt/vrt/collection/types/migratable.h index 4b11adf046..2b74382e64 100644 --- a/src/vt/vrt/collection/types/migratable.h +++ b/src/vt/vrt/collection/types/migratable.h @@ -68,7 +68,7 @@ struct Migratable : MigrateHookBase, storage::Storable { * The user or runtime system can invoke this method at any time (when a valid * pointer to it exists) to migrate this VCC element to another memory domain * - * 1. Invoke migrate(node) where node != theContext()->getNode() + * 1. Invoke migrate(node) where node != theContext()->getNodeStrong() * 2. Runtime system invokes Migratable::preMigrateOut() * 3. Migratable element is serialized * 4. Migratable element is sent to the destination node diff --git a/src/vt/vrt/context/context_vrtmanager.cc b/src/vt/vrt/context/context_vrtmanager.cc index b59285fc66..9f5e0ccfaa 100644 --- a/src/vt/vrt/context/context_vrtmanager.cc +++ b/src/vt/vrt/context/context_vrtmanager.cc @@ -49,7 +49,7 @@ namespace vt { namespace vrt { VirtualContextManager::VirtualContextManager() - : curIdent_(0), myNode_(theContext()->getNode()) + : curIdent_(0), myNode_(theContext()->getNodeStrong()) { } VirtualProxyType VirtualContextManager::makeVirtualPlaceholder() { diff --git a/src/vt/vrt/context/context_vrtmanager.impl.h b/src/vt/vrt/context/context_vrtmanager.impl.h index ef31f55801..5aabdc95fa 100644 --- a/src/vt/vrt/context/context_vrtmanager.impl.h +++ b/src/vt/vrt/context/context_vrtmanager.impl.h @@ -97,7 +97,7 @@ template if (info.isImmediate) { // nothing to do here? } else { - auto const& cons_node = theContext()->getNode(); + auto const& cons_node = theContext()->getNodeStrong(); auto const& req_node = info.from_node; auto const& request_id = info.req_id; @@ -117,7 +117,7 @@ template VirtualProxyType VirtualContextManager::makeVirtualNode( NodeT const& node, Args&& ... args ) { - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); if (node != this_node) { return makeVirtualRemote( node, true, nullptr, std::forward(args)... @@ -193,7 +193,7 @@ VirtualProxyType VirtualContextManager::makeVirtualRemote( auto sys_msg = makeMessage(ArgsTupleType{std::forward(args)...}); - auto const& this_node = theContext()->getNode(); + auto const& this_node = theContext()->getNodeStrong(); std::unique_ptr info = nullptr; VirtualProxyType return_proxy = no_vrt_proxy; diff --git a/style-guidelines.txt b/style-guidelines.txt index 9304b7418a..717ef0b3fe 100644 --- a/style-guidelines.txt +++ b/style-guidelines.txt @@ -9,7 +9,7 @@ * the order sane. Make type aliases whenever it seems useful. Do not hold back, * especially if the type is long or *could ever change*. */ -using NodeType = uint16_t; +using NodeT = uint16_t; struct OtherClass { virtual void myTestMethod(int a) = 0; diff --git a/tests/perf/common/test_harness.h b/tests/perf/common/test_harness.h index 3cb0b39232..f1edfc6676 100644 --- a/tests/perf/common/test_harness.h +++ b/tests/perf/common/test_harness.h @@ -77,7 +77,7 @@ struct PerfTestHarness : TestHarnessBase { // Memory use at the end of test iteration (i.e. phase) using MemoryUsage = std::vector>; using CombinedMemoryUse = - std::unordered_map>>; + std::unordered_map>>; virtual ~PerfTestHarness() = default; diff --git a/tests/unit/active/test_active_send.cc b/tests/unit/active/test_active_send.cc index 22522051c8..5c2be9dc0a 100644 --- a/tests/unit/active/test_active_send.cc +++ b/tests/unit/active/test_active_send.cc @@ -244,11 +244,11 @@ void testPropertiesHandler(int a, double b) { TEST_F(TestActiveSend, test_active_message_properties) { auto const this_node = theContext()->getNode(); auto const num_nodes = theContext()->getNumNodes(); - NodeType const next_node = (this_node + 1) % num_nodes; + NodeT const next_node = (this_node + 1) % num_nodes; if (num_nodes > 1) { auto ps = theMsg()->send( - vt::Node{next_node}, MsgProps().asTerminationMsg(), 10, 20.0 + vt::NodeT{next_node}, MsgProps().asTerminationMsg(), 10, 20.0 ); EXPECT_TRUE(messaging::envelopeIsTerm(ps.getMsg()->env)); } diff --git a/tests/unit/collection/test_collection_group_recreate.cc b/tests/unit/collection/test_collection_group_recreate.cc index 1ced4883ae..bbdaf2ecef 100644 --- a/tests/unit/collection/test_collection_group_recreate.cc +++ b/tests/unit/collection/test_collection_group_recreate.cc @@ -109,7 +109,7 @@ TEST_F(TestCollectionGroupRecreate, test_collection_group_recreate_1) { if (this_node == vt::NodeT{0}) { EXPECT_EQ(cb_counter, 1); ->>>>>>> db4b7d85c (#2099: Types: Make NodeType a strong type and use it across the codebase) +>>>>>>> db4b7d85c (#2099: Types: Make NodeT a strong type and use it across the codebase) } /// Run RotateLB to make the previous group invalid! @@ -148,7 +148,7 @@ TEST_F(TestCollectionGroupRecreate, test_collection_group_recreate_1) { if (this_node == vt::NodeT{0}) { EXPECT_EQ(cb_counter, 2); ->>>>>>> db4b7d85c (#2099: Types: Make NodeType a strong type and use it across the codebase) +>>>>>>> db4b7d85c (#2099: Types: Make NodeT a strong type and use it across the codebase) } vt::runInEpochCollective([&]{ @@ -180,7 +180,7 @@ TEST_F(TestCollectionGroupRecreate, test_collection_group_recreate_1) { if (this_node == vt::NodeT{0}) { EXPECT_EQ(cb_counter, 3); ->>>>>>> db4b7d85c (#2099: Types: Make NodeType a strong type and use it across the codebase) +>>>>>>> db4b7d85c (#2099: Types: Make NodeT a strong type and use it across the codebase) } } diff --git a/tests/unit/collection/test_list_insert_here.cc b/tests/unit/collection/test_list_insert_here.cc index 1acb0d073b..0c74e18253 100644 --- a/tests/unit/collection/test_list_insert_here.cc +++ b/tests/unit/collection/test_list_insert_here.cc @@ -75,7 +75,7 @@ struct MyCol : vt::Collection { int count = 0; }; -vt::NodeType collectionMap(vt::Index2D* idx, vt::Index2D*, vt::NodeType) { +vt::NodeT collectionMap(vt::Index2D* idx, vt::Index2D*, vt::NodeT) { return idx->x(); } @@ -85,7 +85,7 @@ TEST_F(TestListInsertHere, test_list_insert_here1) { auto const this_node = theContext()->getNode(); - for (NodeType i = 0; i < this_node+1; i++) { + for (NodeT i = 0; i < this_node+1; i++) { elms.emplace_back(vt::Index2D{(int)this_node, (int)i}, std::make_unique()); } @@ -110,7 +110,7 @@ TEST_F(TestListInsertHere, test_list_insert_here_sparse2) { // node 0 is empty, node 1 makes up for it so the math works out auto end = this_node == 0 ? 0 : (this_node == 1 ? this_node+2 : this_node+1); - for (NodeType i = 0; i < end; i++) { + for (NodeT i = 0; i < end; i++) { elms.emplace_back(vt::Index2D{(int)this_node, (int)i}, std::make_unique()); } diff --git a/tests/unit/collection/test_model_raw_data.nompi.cc b/tests/unit/collection/test_model_raw_data.nompi.cc index 20373234be..b77cdb4201 100644 --- a/tests/unit/collection/test_model_raw_data.nompi.cc +++ b/tests/unit/collection/test_model_raw_data.nompi.cc @@ -123,7 +123,7 @@ TEST_F(TestRawData, test_model_raw_data_scalar) { } TEST_F(TestRawData, test_model_raw_user_data) { - NodeType this_node = 0; + NodeT this_node = 0; auto test_model = std::make_shared(); diff --git a/tests/unit/collection/test_reduce_collection_handler.h b/tests/unit/collection/test_reduce_collection_handler.h index 0bfb2e5a37..0c4e92da51 100644 --- a/tests/unit/collection/test_reduce_collection_handler.h +++ b/tests/unit/collection/test_reduce_collection_handler.h @@ -107,7 +107,7 @@ void colHanVecProxyAR(MyCol* col) { auto cb = vt::theCB()->makeSend(NodeT{0}); vtAssertExpr(cb.valid()); proxy.reduce>(reduce_msg.get(),cb); ->>>>>>> db4b7d85c (#2099: Types: Make NodeType a strong type and use it across the codebase) +>>>>>>> db4b7d85c (#2099: Types: Make NodeT a strong type and use it across the codebase) } void colHanNoneCB(MyCol* col) { @@ -125,7 +125,7 @@ void colHanNoneCB(MyCol* col) { auto cb = vt::theCB()->makeSend(NodeT{0}); vtAssertExpr(cb.valid()); proxy.reduce(rmsg.get(),cb); ->>>>>>> db4b7d85c (#2099: Types: Make NodeType a strong type and use it across the codebase) +>>>>>>> db4b7d85c (#2099: Types: Make NodeT a strong type and use it across the codebase) } }}}} // end namespace vt::tests::unit::reduce diff --git a/tests/unit/collection/test_reduce_collection_race.cc b/tests/unit/collection/test_reduce_collection_race.cc index 9c094673c6..f1541dce7e 100644 --- a/tests/unit/collection/test_reduce_collection_race.cc +++ b/tests/unit/collection/test_reduce_collection_race.cc @@ -68,7 +68,7 @@ static void handler(MyCol* col) { auto msg = vt::makeMessage(static_cast(col->getIndex().x())); auto cb = vt::theCB()->makeSend(NodeT{0}); proxy.reduce>(msg.get(), cb); ->>>>>>> db4b7d85c (#2099: Types: Make NodeType a strong type and use it across the codebase) +>>>>>>> db4b7d85c (#2099: Types: Make NodeT a strong type and use it across the codebase) } TEST_P(TestReduceCollectionRace, test_reduce_race_1) { diff --git a/tests/unit/collection/test_workload_data_migrator.cc b/tests/unit/collection/test_workload_data_migrator.cc index d30c0bbf7b..2fc7147da4 100644 --- a/tests/unit/collection/test_workload_data_migrator.cc +++ b/tests/unit/collection/test_workload_data_migrator.cc @@ -202,7 +202,7 @@ TEST_F(TestWorkloadDataMigrator, test_normalize_call) { vt::runInEpochCollective("choose migrations", [&]{ for (auto obj_id : *base_load_model) { if (obj_id.isMigratable()) { - vt::NodeType dest = obj_id.id % num_nodes; + vt::NodeT dest = obj_id.id % num_nodes; normalizer->migrateObjectTo(obj_id, dest); } } @@ -220,7 +220,7 @@ TEST_F(TestWorkloadDataMigrator, test_normalize_call) { // then iterate over it to make sure what shows up here is correct for (auto obj_id : *new_model) { if (obj_id.isMigratable()) { - vt::NodeType dest = obj_id.id % num_nodes; + vt::NodeT dest = obj_id.id % num_nodes; EXPECT_EQ(dest, this_node); EXPECT_EQ(obj_id.getCurrNode(), this_node); diff --git a/tests/unit/collectives/test_collectives_reduce.cc b/tests/unit/collectives/test_collectives_reduce.cc index 285b454cd6..4e23c68312 100644 --- a/tests/unit/collectives/test_collectives_reduce.cc +++ b/tests/unit/collectives/test_collectives_reduce.cc @@ -109,7 +109,7 @@ TEST_F(TestReduce, test_reduce_with_no_elements_on_root_rank) { ======= if (this_node == vt::NodeT{0}) { proxy.broadcast(); ->>>>>>> db4b7d85c (#2099: Types: Make NodeType a strong type and use it across the codebase) +>>>>>>> db4b7d85c (#2099: Types: Make NodeT a strong type and use it across the codebase) } } diff --git a/tests/unit/objgroup/test_objgroup.cc b/tests/unit/objgroup/test_objgroup.cc index b9511e44ba..04618a284d 100644 --- a/tests/unit/objgroup/test_objgroup.cc +++ b/tests/unit/objgroup/test_objgroup.cc @@ -301,7 +301,7 @@ TEST_F(TestObjGroup, test_proxy_multicast) { if (this_node == 0) { // Create list of nodes and multicast to them List::ListType range; - for (vt::NodeType node = 0; node < num_nodes; ++node) { + for (vt::NodeT node = 0; node < num_nodes; ++node) { if (node % 2 == 0) { range.push_back(node); } diff --git a/tests/unit/pipe/test_callback_bcast.cc b/tests/unit/pipe/test_callback_bcast.cc index 02bcdf612a..401939ccf2 100644 --- a/tests/unit/pipe/test_callback_bcast.cc +++ b/tests/unit/pipe/test_callback_bcast.cc @@ -147,17 +147,17 @@ TEST_F(TestCallbackBcast, test_callback_bcast_remote_1) { runInEpochCollective([&]{ <<<<<<< HEAD - NodeType next = this_node + 1 < num_nodes ? this_node + 1 : 0; + NodeT next = this_node + 1 < num_nodes ? this_node + 1 : 0; auto cb = theCB()->makeBcast(); theMsg()->send>( - vt::Node{next}, cb, 1, 2, 3 + vt::NodeT{next}, cb, 1, 2, 3 ); ======= auto next = this_node + NodeT{1} < num_nodes ? this_node + NodeT{1} : NodeT{0}; auto cb = theCB()->makeBcast(); auto msg = makeMessage(cb); theMsg()->sendMsg(next, msg); ->>>>>>> db4b7d85c (#2099: Types: Make NodeType a strong type and use it across the codebase) +>>>>>>> db4b7d85c (#2099: Types: Make NodeT a strong type and use it across the codebase) }); EXPECT_EQ(called, 100 * theContext()->getNumNodes()); @@ -173,13 +173,13 @@ TEST_F(TestCallbackBcast, test_callback_bcast_remote_2) { runInEpochCollective([&]{ <<<<<<< HEAD - NodeType next = this_node + 1 < num_nodes ? this_node + 1 : 0; + NodeT next = this_node + 1 < num_nodes ? this_node + 1 : 0; ======= auto next = this_node + NodeT{1} < num_nodes ? this_node + NodeT{1} : NodeT{0}; ->>>>>>> db4b7d85c (#2099: Types: Make NodeType a strong type and use it across the codebase) +>>>>>>> db4b7d85c (#2099: Types: Make NodeT a strong type and use it across the codebase) auto cb = theCB()->makeBcast(); theMsg()->send>( - vt::Node{next}, cb, 1, 2, 3 + vt::NodeT{next}, cb, 1, 2, 3 ); }); @@ -196,12 +196,12 @@ TEST_F(TestCallbackBcast, test_callback_bcast_remote_3) { runInEpochCollective([&]{ <<<<<<< HEAD - NodeType next = this_node + 1 < num_nodes ? this_node + 1 : 0; + NodeT next = this_node + 1 < num_nodes ? this_node + 1 : 0; ======= auto next = this_node + NodeT{1} < num_nodes ? this_node + NodeT{1} : NodeT{0}; ->>>>>>> db4b7d85c (#2099: Types: Make NodeType a strong type and use it across the codebase) +>>>>>>> db4b7d85c (#2099: Types: Make NodeT a strong type and use it across the codebase) auto cb = theCB()->makeBcast(); - theMsg()->send>(vt::Node{next}, cb); + theMsg()->send>(vt::NodeT{next}, cb); }); EXPECT_EQ(called, 300 * theContext()->getNumNodes()); @@ -252,9 +252,9 @@ TEST_F(TestCallbackBcast, test_callback_bcast_param_1) { called = 0; runInEpochCollective([this_node, num_nodes]{ - NodeType next = this_node + 1 < num_nodes ? this_node + 1 : 0; + NodeT next = this_node + 1 < num_nodes ? this_node + 1 : 0; auto cb = theCB()->makeBcast(); - theMsg()->send>(vt::Node{next}, cb); + theMsg()->send>(vt::NodeT{next}, cb); }); EXPECT_EQ(called, 100); @@ -267,9 +267,9 @@ TEST_F(TestCallbackBcast, test_callback_bcast_param_2) { called = 0; runInEpochCollective([this_node, num_nodes]{ - NodeType next = this_node + 1 < num_nodes ? this_node + 1 : 0; + NodeT next = this_node + 1 < num_nodes ? this_node + 1 : 0; auto cb = theCB()->makeBcast(); - theMsg()->send>(vt::Node{next}, cb, 10, 20); + theMsg()->send>(vt::NodeT{next}, cb, 10, 20); }); EXPECT_EQ(called, 100); @@ -282,9 +282,9 @@ TEST_F(TestCallbackBcast, test_callback_bcast_param_3) { called = 0; runInEpochCollective([this_node, num_nodes]{ - NodeType next = this_node + 1 < num_nodes ? this_node + 1 : 0; + NodeT next = this_node + 1 < num_nodes ? this_node + 1 : 0; auto cb = theCB()->makeBcast(); - theMsg()->send>(vt::Node{next}, cb, "hello", 20); + theMsg()->send>(vt::NodeT{next}, cb, "hello", 20); }); EXPECT_EQ(called, 100); @@ -297,9 +297,9 @@ TEST_F(TestCallbackBcast, test_callback_bcast_param_4) { called = 0; runInEpochCollective([this_node, num_nodes]{ - NodeType next = this_node + 1 < num_nodes ? this_node + 1 : 0; + NodeT next = this_node + 1 < num_nodes ? this_node + 1 : 0; auto cb = theCB()->makeBcast(); - theMsg()->send>(vt::Node{next}, cb); + theMsg()->send>(vt::NodeT{next}, cb); }); EXPECT_EQ(called, 100); @@ -312,9 +312,9 @@ TEST_F(TestCallbackBcast, test_callback_bcast_param_5) { called = 0; runInEpochCollective([this_node, num_nodes]{ - NodeType next = this_node + 1 < num_nodes ? this_node + 1 : 0; + NodeT next = this_node + 1 < num_nodes ? this_node + 1 : 0; auto cb = theCB()->makeBcast(); - theMsg()->send>(vt::Node{next}, cb, 10, 20); + theMsg()->send>(vt::NodeT{next}, cb, 10, 20); }); EXPECT_EQ(called, 100); @@ -327,9 +327,9 @@ TEST_F(TestCallbackBcast, test_callback_bcast_param_6) { called = 0; runInEpochCollective([this_node, num_nodes]{ - NodeType next = this_node + 1 < num_nodes ? this_node + 1 : 0; + NodeT next = this_node + 1 < num_nodes ? this_node + 1 : 0; auto cb = theCB()->makeBcast(); - theMsg()->send>(vt::Node{next}, cb, "hello", 20); + theMsg()->send>(vt::NodeT{next}, cb, "hello", 20); }); EXPECT_EQ(called, 100); diff --git a/tests/unit/pipe/test_callback_send.cc b/tests/unit/pipe/test_callback_send.cc index 5a98d0f1a7..882db600eb 100644 --- a/tests/unit/pipe/test_callback_send.cc +++ b/tests/unit/pipe/test_callback_send.cc @@ -141,10 +141,10 @@ TEST_F(TestCallbackSend, test_callback_send_remote_1) { called = 0; runInEpochCollective([this_node, num_nodes]{ - NodeType next = this_node + NodeT{1} < num_nodes ? this_node + NodeT{1} : NodeT{0}; + NodeT next = this_node + NodeT{1} < num_nodes ? this_node + NodeT{1} : NodeT{0}; auto cb = theCB()->makeSend(this_node); theMsg()->send>( - vt::Node{next}, cb, 1, 2, 3 + vt::NodeT{next}, cb, 1, 2, 3 ); }); @@ -158,10 +158,10 @@ TEST_F(TestCallbackSend, test_callback_send_remote_2) { called = 0; runInEpochCollective([this_node, num_nodes]{ - NodeType next = this_node + NodeT{1} < num_nodes ? this_node + NodeT{1} : NodeT{0}; + NodeT next = this_node + NodeT{1} < num_nodes ? this_node + NodeT{1} : NodeT{0}; auto cb = theCB()->makeSend(this_node); theMsg()->send>( - vt::Node{next}, cb, 1, 2, 3 + vt::NodeT{next}, cb, 1, 2, 3 ); }); @@ -175,9 +175,9 @@ TEST_F(TestCallbackSend, test_callback_send_remote_3) { called = 0; runInEpochCollective([this_node, num_nodes]{ - NodeType next = this_node + NodeT{1} < num_nodes ? this_node + NodeT{1} : NodeT{0}; + NodeT next = this_node + NodeT{1} < num_nodes ? this_node + NodeT{1} : NodeT{0}; auto cb = theCB()->makeSend(this_node); - theMsg()->send>(vt::Node{next}, cb); + theMsg()->send>(vt::NodeT{next}, cb); }); EXPECT_EQ(called, 300); @@ -228,9 +228,9 @@ TEST_F(TestCallbackSend, test_callback_send_param_1) { called = 0; runInEpochCollective([this_node, num_nodes]{ - NodeType next = this_node + 1 < num_nodes ? this_node + 1 : 0; + NodeT next = this_node + 1 < num_nodes ? this_node + 1 : 0; auto cb = theCB()->makeSend(this_node); - theMsg()->send>(vt::Node{next}, cb); + theMsg()->send>(vt::NodeT{next}, cb); }); EXPECT_EQ(called, 100); @@ -243,9 +243,9 @@ TEST_F(TestCallbackSend, test_callback_send_param_2) { called = 0; runInEpochCollective([this_node, num_nodes]{ - NodeType next = this_node + 1 < num_nodes ? this_node + 1 : 0; + NodeT next = this_node + 1 < num_nodes ? this_node + 1 : 0; auto cb = theCB()->makeSend(this_node); - theMsg()->send>(vt::Node{next}, cb, 10, 20); + theMsg()->send>(vt::NodeT{next}, cb, 10, 20); }); EXPECT_EQ(called, 100); @@ -258,9 +258,9 @@ TEST_F(TestCallbackSend, test_callback_send_param_3) { called = 0; runInEpochCollective([this_node, num_nodes]{ - NodeType next = this_node + 1 < num_nodes ? this_node + 1 : 0; + NodeT next = this_node + 1 < num_nodes ? this_node + 1 : 0; auto cb = theCB()->makeSend(this_node); - theMsg()->send>(vt::Node{next}, cb, "hello", 20); + theMsg()->send>(vt::NodeT{next}, cb, "hello", 20); }); EXPECT_EQ(called, 100); @@ -273,9 +273,9 @@ TEST_F(TestCallbackSend, test_callback_send_param_4) { called = 0; runInEpochCollective([this_node, num_nodes]{ - NodeType next = this_node + 1 < num_nodes ? this_node + 1 : 0; + NodeT next = this_node + 1 < num_nodes ? this_node + 1 : 0; auto cb = theCB()->makeSend(this_node); - theMsg()->send>(vt::Node{next}, cb); + theMsg()->send>(vt::NodeT{next}, cb); }); EXPECT_EQ(called, 100); @@ -288,9 +288,9 @@ TEST_F(TestCallbackSend, test_callback_send_param_5) { called = 0; runInEpochCollective([this_node, num_nodes]{ - NodeType next = this_node + 1 < num_nodes ? this_node + 1 : 0; + NodeT next = this_node + 1 < num_nodes ? this_node + 1 : 0; auto cb = theCB()->makeSend(this_node); - theMsg()->send>(vt::Node{next}, cb, 10, 20); + theMsg()->send>(vt::NodeT{next}, cb, 10, 20); }); EXPECT_EQ(called, 100); @@ -303,9 +303,9 @@ TEST_F(TestCallbackSend, test_callback_send_param_6) { called = 0; runInEpochCollective([this_node, num_nodes]{ - NodeType next = this_node + 1 < num_nodes ? this_node + 1 : 0; + NodeT next = this_node + 1 < num_nodes ? this_node + 1 : 0; auto cb = theCB()->makeSend(this_node); - theMsg()->send>(vt::Node{next}, cb, "hello", 20); + theMsg()->send>(vt::NodeT{next}, cb, "hello", 20); }); EXPECT_EQ(called, 100); diff --git a/tests/unit/termination/test_term_chaining.cc b/tests/unit/termination/test_term_chaining.cc index ae6bcf3ced..30bd50be35 100644 --- a/tests/unit/termination/test_term_chaining.cc +++ b/tests/unit/termination/test_term_chaining.cc @@ -179,7 +179,7 @@ struct TestTermChaining : TestParallelHarness { ======= auto cb = vt::theCB()->makeSend( NodeT{0} ); chain.add(epoch2, theCollective()->global()->reduce< vt::collective::None >(vt::NodeT{0}, msg2.get(), cb)); ->>>>>>> db4b7d85c (#2099: Types: Make NodeType a strong type and use it across the codebase) +>>>>>>> db4b7d85c (#2099: Types: Make NodeT a strong type and use it across the codebase) vt::theMsg()->popEpoch(epoch2); vt::theTerm()->finishedEpoch(epoch2); @@ -206,7 +206,7 @@ struct TestTermChaining : TestParallelHarness { ======= auto cb = vt::theCB()->makeSend( NodeT{0} ); chain.add(epoch2, theCollective()->global()->reduce< vt::collective::None >(vt::NodeT{0}, msg2.get(), cb)); ->>>>>>> db4b7d85c (#2099: Types: Make NodeType a strong type and use it across the codebase) +>>>>>>> db4b7d85c (#2099: Types: Make NodeT a strong type and use it across the codebase) vt::theMsg()->popEpoch(epoch2); vt::theTerm()->finishedEpoch(epoch2); diff --git a/tutorial/tutorial_1g.h b/tutorial/tutorial_1g.h index 35892ab2cb..8bdef0b46d 100644 --- a/tutorial/tutorial_1g.h +++ b/tutorial/tutorial_1g.h @@ -52,13 +52,13 @@ static void getCallbackHandler(Callback cb); // An active message handler used as the target for a callback static void callbackHandler(int data) { - NodeT const cur_node = ::vt::theContext()->getNode(); + auto const cur_node = ::vt::theContext()->getNode(); ::fmt::print("{}: triggering active message callback: {}\n", cur_node, data); } // An active message handler used as the target for a callback static void callbackBcastHandler(int data) { - NodeType const cur_node = ::vt::theContext()->getNode(); + auto const cur_node = ::vt::theContext()->getNode(); ::fmt::print( "{}: triggering active message callback bcast: {}\n", cur_node, data ); @@ -81,18 +81,18 @@ static inline void activeMessageCallback() { // Node sending the callback message to, which shall invoke the callback auto const to_node = NodeT{1}; // Node that we want to callback to execute on - NodeType const cb_node = 0; + auto const cb_node = NodeT{0}; // Example of active message handler callback with send node { auto cb = ::vt::theCB()->makeSend(cb_node); - ::vt::theMsg()->send(Node{to_node}, cb); + ::vt::theMsg()->send(NodeT{to_node}, cb); } // Example of active message handler callback with broadcast { auto cb = ::vt::theCB()->makeBcast(); - ::vt::theMsg()->send(Node{to_node}, cb); + ::vt::theMsg()->send(NodeT{to_node}, cb); } } } diff --git a/tutorial/tutorial_1h.h b/tutorial/tutorial_1h.h index c6ef97cb04..03e855bd21 100644 --- a/tutorial/tutorial_1h.h +++ b/tutorial/tutorial_1h.h @@ -72,7 +72,7 @@ static inline void activeMessageReduce() { auto const root_reduce_node = vt::NodeT{0}; auto r = vt::theCollective()->global(); - r->reduce(vt::Node{root_reduce_node}, 50); + r->reduce(vt::NodeT{root_reduce_node}, 50); } /// [Tutorial1H] diff --git a/tutorial/tutorial_3a.h b/tutorial/tutorial_3a.h index f034866e0a..e0dc8496f7 100644 --- a/tutorial/tutorial_3a.h +++ b/tutorial/tutorial_3a.h @@ -75,10 +75,10 @@ static inline void activeMessageTerm() { // Create a new epoch: this is a collective invocation auto const new_epoch = theTerm()->makeEpochCollective(); - if (this_node == vt::NodeT{0}) { + if (this_node == 0) { auto msg = vt::makeMessage(8); envelopeSetEpoch(msg->env, new_epoch); - vt::theMsg()->sendMsg(this_node+NodeT{1}, msg); + vt::theMsg()->sendMsg(this_node+1, msg); } // Any node that wishes to have a notification on termination for a given