diff --git a/src/vt/topos/location/location.h b/src/vt/topos/location/location.h index 96faff5e5c..bb7d6eefae 100644 --- a/src/vt/topos/location/location.h +++ b/src/vt/topos/location/location.h @@ -233,7 +233,8 @@ struct EntityLocationCoord : LocationCoord { */ template *f> void routeMsgHandler( - EntityID const& id, NodeType const& home_node, MsgSharedPtr msg + EntityID const& id, NodeType const& home_node, + MsgSharedPtr const& msg ); /** @@ -246,7 +247,8 @@ struct EntityLocationCoord : LocationCoord { */ template void routeMsg( - EntityID const& id, NodeType const& home_node, MsgSharedPtr msg, + EntityID const& id, NodeType const& home_node, + MsgSharedPtr const& msg, NodeType from_node = uninitialized_destination ); @@ -331,7 +333,7 @@ struct EntityLocationCoord : LocationCoord { * \return whether it is of eager size */ template - bool useEagerProtocol(MsgSharedPtr msg) const; + bool useEagerProtocol(MsgSharedPtr const& msg) const; private: /** @@ -372,7 +374,8 @@ struct EntityLocationCoord : LocationCoord { */ template void routeMsgEager( - EntityID const& id, NodeType const& home_node, MsgSharedPtr msg + EntityID const& id, NodeType const& home_node, + MsgSharedPtr const& msg ); /** @@ -386,7 +389,7 @@ struct EntityLocationCoord : LocationCoord { template void routeMsgNode( EntityID const& id, NodeType const& home_node, NodeType const& to_node, - MsgSharedPtr msg + MsgSharedPtr const& msg ); /** diff --git a/src/vt/topos/location/location.impl.h b/src/vt/topos/location/location.impl.h index 53d3817342..253cbcc874 100644 --- a/src/vt/topos/location/location.impl.h +++ b/src/vt/topos/location/location.impl.h @@ -301,7 +301,9 @@ struct IsSerializable< template template -bool EntityLocationCoord::useEagerProtocol(MsgSharedPtr msg) const { +bool EntityLocationCoord::useEagerProtocol( + MsgSharedPtr const& msg +) const { if (detail::IsSerializable::is_ser) { return false; } else { @@ -335,7 +337,8 @@ void EntityLocationCoord::insertPendingEntityAction( template template void EntityLocationCoord::routeMsgEager( - EntityID const& id, NodeType const& home_node, MsgSharedPtr msg + EntityID const& id, NodeType const& home_node, + MsgSharedPtr const& msg ) { auto const& this_node = theContext()->getNode(); NodeType route_to_node = uninitialized_destination; @@ -503,7 +506,7 @@ template template void EntityLocationCoord::routeMsgNode( EntityID const& id, NodeType const& home_node, NodeType const& to_node, - MsgSharedPtr msg + MsgSharedPtr const& msg ) { auto const& this_node = theContext()->getNode(); auto const epoch = theMsg()->getEpochContextMsg(msg); @@ -533,8 +536,9 @@ void EntityLocationCoord::routeMsgNode( // set the instance on the message to deliver to the correct manager msg->setLocInst(this_inst); + auto m = msg; // send to the node discovered by the location manager - theMsg()->sendMsg(to_node, msg); + theMsg()->sendMsg(to_node, m); } else { vt_debug_print( normal, location, @@ -651,7 +655,8 @@ void EntityLocationCoord::routeNonEagerAction( template template *f> void EntityLocationCoord::routeMsgHandler( - EntityID const& id, NodeType const& home_node, MsgSharedPtr msg + EntityID const& id, NodeType const& home_node, + MsgSharedPtr const& msg ) { using auto_registry::HandlerManagerType; @@ -670,8 +675,8 @@ void EntityLocationCoord::routeMsgHandler( template template void EntityLocationCoord::routeMsg( - EntityID const& id, NodeType const& home_node, MsgSharedPtr msg, - NodeType from_node + EntityID const& id, NodeType const& home_node, + MsgSharedPtr const& msg, NodeType from_node ) { auto const from = from_node == uninitialized_destination ? theContext()->getNode() :