vt::vrt::collection::CollectionManager struct

A core VT component managing collections of tasks across the system.

The collection manager enables the creation, execution, message routing, and destruction of multi-dimensional collections of virtual contexts that are mapped to hardware resources. Dense, sparse, on-demand collection types are all supported. The location of these virtual contexts is managed by the location manager as they migrate or the load balancer is invoked, which moves them around the system based on instrumentation.

Base classes

template<typename T>
struct vt::runtime::component::Component<CollectionManager>
Component class for a generic VT runtime module, CRTP'ed over the component's actual type

Public types

template<typename IndexT>
using CollectionType = typename Holder<IndexT>::Collection
template<typename IndexT>
using VirtualPtrType = typename Holder<IndexT>::VirtualPtrType
using ActionProxyType = std::function<void(VirtualProxyType)>
template<typename IndexT>
using ReduceIdxFuncType = std::function<bool(IndexT const &)>
using ReduceStamp = collective::reduce::ReduceStamp
using ActionContainerType = std::vector<ActionProxyType>
using BufferedActionType = std::unordered_map<VirtualProxyType, ActionContainerType>
template<typename ColT, typename IndexT = typename ColT::IndexType>
using CollectionProxyWrapType = CollectionProxy<ColT, IndexT>
using CleanupFnType = std::function<void()>
using CleanupListFnType = std::unordered_map<VirtualProxyType, std::list<CleanupFnType>>
using DispatchHandlerType = auto_registry::AutoHandlerType
template<typename ColT, typename IndexT = typename ColT::IndexType>
using DistribConstructFn = std::function<VirtualPtrType<IndexT>(IndexT idx)>
template<typename T, typename U = void>
using IsColMsgType = std::enable_if_t<ColMsgTraits<T>::is_coll_msg, messaging::PendingSend>
template<typename T, typename U = void>
using IsNotColMsgType = std::enable_if_t<!ColMsgTraits<T>::is_coll_msg, messaging::PendingSend>
template<typename ColT, typename IndexT = typename ColT::IndexType>
using IsDefaultConstructableType = std::enable_if_t<std::is_default_constructible<ColT>::value, CollectionProxyWrapType<ColT, IndexT>>

Public static functions

template<typename ColT>
static auto getDefaultMap() -> HandlerType
Get the default map registered handler for a collection.
template<typename ColT, typename ParamT, typename... Args>
static auto getDefaultMapImpl(std::tuple<Args...>) -> HandlerType
Register a map functor for arguments.
template<typename IndexT>
static auto queryIndexContext() -> IndexT const *
Query the current index context of the running handler.
template<typename IndexT>
static auto queryProxyContext() -> VirtualProxyType
Query the current proxy context of the running handler.
template<typename IndexT>
static auto hasContext() -> bool
Check if a collection is running in the current context.
template<typename CoLT, typename IndexT>
static void collectionMsgHandler(BaseMessage* msg)
Base collection message handler.
template<typename ColT, typename IndexT, typename MsgT>
static void collectionMsgTypedHandler(MsgT* msg)
Typed collection message handler.
template<typename ColT, typename MsgT>
static void recordLBData(ColT* col_ptr, MsgT* msg)
Record LB data for collection message handler when a message arrives for the element.
template<typename ColT, typename IndexT, typename MsgT>
static void collectionAutoMsgDeliver(MsgT* msg, Indexable<IndexT>* col, HandlerType han, NodeType from, trace::TraceEventIDType event, bool immediate)
Deliver a message to a collection element.
template<typename ColT, typename IndexT, typename MsgT>
static void collectionBcastHandler(MsgT* msg)
Receive a broadcast to a collection.
template<typename ColT, typename IndexT, typename MsgT>
static void broadcastRootHandler(MsgT* msg)
Receive a broadcast at the root for stamping.
template<typename ColT, typename IndexT, typename... Args>
static auto runConstructor(Args && ... args) -> VirtualPtrType<IndexT>
Run the collection element's constructor.
template<typename ColT, typename MsgT>
static void insertHandler(InsertMsg<ColT, MsgT>* msg)
Handler to insert an element on this node.
template<typename ColT, typename MsgT>
static void pingHomeHandler(InsertMsg<ColT, MsgT>* msg)
Handler to query home before inserting on this node.
static void computeReduceStamp(CollectionStampMsg* msg)
Handler that receives the reduce stamp after insertions are complete.
template<typename ColT>
static void destroyElmHandler(ColT*, DestroyElmMsg<ColT>* msg)
Send message to element to delete it during a modification epoch.
template<typename ColT>
static void migrateToRestoreLocation(NodeType node, typename ColT::IndexType idx, CollectionProxyWrapType<ColT> proxy)
Migrate element to restore location from checkpoint.
template<typename ColT, typename IndexT, typename MsgT>
static void collectionAutoMsgDeliver(MsgT* msg, Indexable<IndexT>* base, HandlerType han, NodeType from, ] trace::TraceEventIDType event, bool immediate)

Constructors, destructors, conversion operators

CollectionManager()
System call to construct a collection manager.
~CollectionManager() virtual

Public functions

void startup() override
Empty default overridden startup method.
void finalize() override
Empty default overridden finalize method.
auto name() -> std::string override
Get the name of the component.
template<typename = void>
void cleanupAll()
Trigger cleanup lambdas—triggered when termination occurs.
template<typename = void>
void destroyCollections()
Destroy all collections.
template<typename ColT>
auto constructMap(typename ColT::IndexType range, HandlerType const map, std::string const& label = {}) -> CollectionProxyWrapType<ColT, typename ColT::IndexType>
Construct a new virtual context collection with an explicit, pre-registered map handler.
template<typename ColT, mapping::ActiveMapTypedFnType<typename ColT::IndexType> fn>
auto construct(typename ColT::IndexType range, std::string const& label = {}) -> CollectionProxyWrapType<ColT, typename ColT::IndexType>
Construct a new virtual context collection with templated map.
template<typename ColT>
auto construct(typename ColT::IndexType range, std::string const& label = {}) -> CollectionProxyWrapType<ColT, typename ColT::IndexType>
Construct a new virtual context collection using the default map for the given index.
template<typename ColT, mapping::ActiveMapTypedFnType<typename ColT::IndexType> fn>
auto constructCollective(typename ColT::IndexType range, std::string const& label = {}) -> IsDefaultConstructableType<ColT>
Collectively construct a new virtual context collection with templated map.
template<typename ColT, mapping::ActiveMapTypedFnType<typename ColT::IndexType> fn>
auto constructCollective(typename ColT::IndexType range, DistribConstructFn<ColT> cons_fn, std::string const& label = {}) -> CollectionProxyWrapType<ColT>
Collectively construct a new virtual context collection with templated map.
template<typename ColT>
auto constructCollective(typename ColT::IndexType range, std::string const& label = {}) -> IsDefaultConstructableType<ColT>
Collectively construct a new virtual context collection with the default map.
template<typename ColT>
auto constructCollective(typename ColT::IndexType range, DistribConstructFn<ColT> cons_fn, std::string const& label = {}) -> CollectionProxyWrapType<ColT>
Collectively construct a new virtual context collection with the default map.
template<typename ColT>
auto constructCollectiveMap(typename ColT::IndexType range, DistribConstructFn<ColT> cons_fn, HandlerType const map_hanm, std::string const& label = {}) -> CollectionProxyWrapType<ColT>
Collectively construct a new virtual context collection with a pre-registered map function.
template<typename ColT, typename... Args>
void insertMetaCollection(std::string const& label, VirtualProxyType const proxy, Args && ... inner_holder_args)
Insert meta-data for this collection on this node.
auto makeCollectionProxy(bool is_collective, bool is_migratable) -> VirtualProxyType
Make the next collection proxy.
template<typename ColT>
void constructGroup(VirtualProxyType const& proxy)
Construct a group for the collection.
template<typename MsgT, typename ColT = typename MsgT::CollectionType, typename IdxT = typename ColT::IndexType>
auto sendMsgUntypedHandler(VirtualElmProxyType<ColT> const& proxy, MsgT* msg, HandlerType const handler, bool imm_context = true) -> messaging::PendingSend
Send a message to a collection element with handler type erased.
template<typename MsgT, typename ColT>
auto sendMsgWithHan(VirtualElmProxyType<ColT> const& proxy, MsgT* msg, HandlerType const handler) -> IsNotColMsgType<MsgT>
Send a message to a collection element when not using a collection message.
template<typename MsgT, typename ColT>
auto sendMsgWithHan(VirtualElmProxyType<ColT> const& proxy, MsgT* msg, HandlerType const handler) -> IsColMsgType<MsgT>
Send a message to a collection element when using a collection message.
template<typename MsgT, typename ColT>
auto sendNormalMsg(VirtualElmProxyType<ColT> const& proxy, MsgT* msg, HandlerType const handler) -> messaging::PendingSend
Send a normal message to a collection element with handler type-erased.
template<typename MsgT, ActiveColTypedFnType<MsgT, typename MsgT::CollectionType>* f>
auto sendMsg(VirtualElmProxyType<typename MsgT::CollectionType> const& proxy, MsgT* msg) -> messaging::PendingSend
Send collection element a message from active function handler.
template<auto f>
auto sendMsg(VirtualElmProxyType<typename ObjFuncTraits<decltype(f)>::MsgT::CollectionType> const& proxy, typename ObjFuncTraits<decltype(f)>::MsgT* msg) -> messaging::PendingSend
Send collection element a message from active function handler.
template<typename MsgT, ActiveColMemberTypedFnType<MsgT, typename MsgT::CollectionType> f>
auto sendMsg(VirtualElmProxyType<typename MsgT::CollectionType> const& proxy, MsgT* msg) -> messaging::PendingSend
Send collection element a message from active member handler.
template<typename MsgT, typename ColT, ActiveColTypedFnType<MsgT, ColT>* f>
auto sendMsg(VirtualElmProxyType<ColT> const& proxy, MsgT* msg) -> IsColMsgType<MsgT>
Send collection element a message from active function handler with a proper CollectionMessage<ColT>
template<typename MsgT, typename ColT, ActiveColTypedFnType<MsgT, ColT>* f>
auto sendMsg(VirtualElmProxyType<ColT> const& proxy, MsgT* msg) -> IsNotColMsgType<MsgT>
Send collection element a message from active function handler with a non-collection message, doing a promotion.
template<typename MsgT, typename ColT, ActiveColMemberTypedFnType<MsgT, ColT> f>
auto sendMsg(VirtualElmProxyType<ColT> const& proxy, MsgT* msg) -> IsColMsgType<MsgT>
Send collection element a message from active member handler with a proper CollectionMessage<ColT>
template<typename MsgT, typename ColT, ActiveColMemberTypedFnType<MsgT, ColT> f>
auto sendMsg(VirtualElmProxyType<ColT> const& proxy, MsgT* msg) -> IsNotColMsgType<MsgT>
Send collection element a message from active member handler with a non-collection message, doing a promotion.
template<typename MsgT, typename ColT, ActiveColTypedFnType<MsgT, ColT>* f>
auto sendMsgImpl(VirtualElmProxyType<ColT> const& proxy, MsgT* msg) -> messaging::PendingSend
Send a collection element a message with active function handler.
template<typename MsgT, typename ColT, ActiveColMemberTypedFnType<MsgT, typename MsgT::CollectionType> f>
auto sendMsgImpl(VirtualElmProxyType<ColT> const& proxy, MsgT* msg) -> messaging::PendingSend
Send a collection element a message with active member handler.
template<typename ColT, auto f, typename... Args>
auto invoke(VirtualElmProxyType<ColT> const& proxy, Args && ... args) -> auto
Invoke function 'f' inline without going through scheduler.
template<typename MsgT, ActiveColTypedFnType<MsgT, typename MsgT::CollectionType>* f>
void invokeCollectiveMsg(CollectionProxyWrapType<typename MsgT::CollectionType> const& proxy, messaging::MsgPtrThief<MsgT> msg)
Invoke message action function handler without going through scheduler for all elements.
template<typename ColT, auto f, typename... Args>
void invokeCollective(CollectionProxyWrapType<ColT> const& proxy, Args && ... args)
Invoke function handler without going through scheduler for all elements.
template<typename MsgT, ActiveColMemberTypedFnType<MsgT, typename MsgT::CollectionType> f>
void invokeCollectiveMsg(CollectionProxyWrapType<typename MsgT::CollectionType> const& proxy, messaging::MsgPtrThief<MsgT> msg)
Invoke message action function handler without going through scheduler for all elements.
template<typename MsgT, ActiveColTypedFnType<MsgT, typename MsgT::CollectionType>* f>
void invokeMsg(VirtualElmProxyType<typename MsgT::CollectionType> const& proxy, messaging::MsgPtrThief<MsgT> msg, bool instrument = true)
Invoke message action function handler without going through scheduler.
template<typename MsgT, ActiveColMemberTypedFnType<MsgT, typename MsgT::CollectionType> f>
void invokeMsg(VirtualElmProxyType<typename MsgT::CollectionType> const& proxy, messaging::MsgPtrThief<MsgT> msg, bool instrument = true)
Invoke message action member handler without going through scheduler.
template<typename ColT, typename MsgT>
void invokeMsgImpl(VirtualElmProxyType<ColT> const& proxy, MsgSharedPtr<MsgT> msg, bool instrument)
Invoke message handler without going through scheduler.
template<typename ColT, typename MsgT, ActiveTypedFnType<MsgT>* f>
auto reduceMsg(CollectionProxyWrapType<ColT> const& proxy, MsgT*const msg, ReduceStamp stamp = ReduceStamp{}, NodeType root_node = uninitialized_destination) -> messaging::PendingSend
Reduce over a collection.
template<typename ColT, typename MsgT, ActiveTypedFnType<MsgT>* f>
auto reduceMsg(CollectionProxyWrapType<ColT> const& proxy, MsgT*const msg, ReduceStamp stamp, typename ColT::IndexType const& idx) -> messaging::PendingSend
Reduce over a collection.
template<typename ColT, typename MsgT, ActiveTypedFnType<MsgT>* f>
auto reduceMsgExpr(CollectionProxyWrapType<ColT> const& proxy, MsgT*const msg, ReduceIdxFuncType<typename ColT::IndexType> expr_fn, ReduceStamp stamp = ReduceStamp{}, NodeType root_node = uninitialized_destination) -> messaging::PendingSend
Reduce over the whole collection or a subset of a collection, based on their indices matching an expression.
template<typename ColT, typename MsgT, ActiveTypedFnType<MsgT>* f>
auto reduceMsgExpr(CollectionProxyWrapType<ColT> const& proxy, MsgT*const msg, ReduceIdxFuncType<typename ColT::IndexType> expr_fn, ReduceStamp stamp, typename ColT::IndexType const& idx) -> messaging::PendingSend
Reduce over the whole collection or a subset of a collection, based on their indices matching an expression.
template<typename MsgT, typename ColT>
auto broadcastMsgWithHan(CollectionProxyWrapType<ColT> const& proxy, MsgT* msg, HandlerType const handler, bool instrument = true) -> IsNotColMsgType<MsgT>
Broadcast to collection with a promoted message.
template<typename MsgT, typename ColT>
auto broadcastMsgWithHan(CollectionProxyWrapType<ColT> const& proxy, MsgT* msg, HandlerType const handler, bool instrument = true) -> IsColMsgType<MsgT>
Broadcast to collection with a collection message.
template<typename MsgT, typename ColT>
auto broadcastNormalMsg(CollectionProxyWrapType<ColT> const& proxy, MsgT* msg, HandlerType const handler, bool instrument = true) -> messaging::PendingSend
Broadcast a normal message.
template<typename MsgT, typename ColT, typename IdxT>
auto broadcastMsgUntypedHandler(CollectionProxyWrapType<ColT, IdxT> const& proxy, MsgT* msg, HandlerType const handler, bool instrument) -> messaging::PendingSend
Broadcast a message with type-erased handler.
template<typename MsgT, ActiveColTypedFnType<MsgT, typename MsgT::CollectionType>* f>
auto broadcastCollectiveMsg(CollectionProxyWrapType<typename MsgT::CollectionType> const& proxy, messaging::MsgPtrThief<MsgT> msg, bool instrument = true) -> messaging::PendingSend
Broadcast collective a message with action function handler.
template<typename MsgT, ActiveColMemberTypedFnType<MsgT, typename MsgT::CollectionType> f>
auto broadcastCollectiveMsg(CollectionProxyWrapType<typename MsgT::CollectionType> const& proxy, messaging::MsgPtrThief<MsgT> msg, bool instrument = true) -> messaging::PendingSend
Broadcast collective a message with action member handler.
template<typename MsgT, typename ColT>
auto broadcastCollectiveMsgImpl(CollectionProxyWrapType<ColT> const& proxy, MsgPtr<MsgT>& msg, bool instrument) -> messaging::PendingSend
Broadcast collective a message.
template<auto f>
auto broadcastMsg(CollectionProxyWrapType<typename ObjFuncTraits<decltype(f)>::MsgT::CollectionType> const& proxy, typename ObjFuncTraits<decltype(f)>::MsgT* msg, bool instrument = true) -> messaging::PendingSend
Broadcast a message with action function handler.
template<typename MsgT, typename ColT, ActiveColTypedFnType<MsgT, ColT>* f>
auto broadcastMsg(CollectionProxyWrapType<ColT> const& proxy, MsgT* msg, bool instrument = true) -> IsColMsgType<MsgT>
Broadcast a message with action function handler with collection message.
template<typename MsgT, typename ColT, ActiveColTypedFnType<MsgT, ColT>* f>
auto broadcastMsg(CollectionProxyWrapType<ColT> const& proxy, MsgT* msg, bool instrument = true) -> IsNotColMsgType<MsgT>
Broadcast a message with action function handler with normal message promoted automatically to CollectionMessage<ColT>
template<typename MsgT, typename ColT, ActiveColMemberTypedFnType<MsgT, ColT> f>
auto broadcastMsg(CollectionProxyWrapType<ColT> const& proxy, MsgT* msg, bool instrument = true) -> IsColMsgType<MsgT>
Broadcast a message with action member handler with collection message.
template<typename MsgT, typename ColT, ActiveColMemberTypedFnType<MsgT, ColT> f>
auto broadcastMsg(CollectionProxyWrapType<ColT> const& proxy, MsgT* msg, bool instrument = true) -> IsNotColMsgType<MsgT>
Broadcast a message with action member handler with normal message promoted automatically to CollectionMessage<ColT>
template<typename MsgT, typename ColT, ActiveColTypedFnType<MsgT, ColT>* f>
auto broadcastMsgImpl(CollectionProxyWrapType<ColT> const& proxy, MsgT* msg, bool instrument = true) -> messaging::PendingSend
Broadcast a message with active function handler.
template<typename MsgT, typename ColT, ActiveColMemberTypedFnType<MsgT, ColT> f>
auto broadcastMsgImpl(CollectionProxyWrapType<ColT> const& proxy, MsgT* msg, bool instrument = true) -> messaging::PendingSend
Broadcast a message with active member handler.
template<typename ColT, typename IndexT, typename MsgT>
auto broadcastFromRoot(MsgT* msg) -> messaging::PendingSend
Bounce broadcast off of the root node to stamp them to avoid multiple delivery during migrations.
template<typename MsgT, typename ColT>
auto getDispatchHandler() -> DispatchHandlerType
Get the type-erased dispatcher handler for sending/broadcasting without the collection type.
template<typename = void>
auto getDispatcher(DispatchHandlerType const& han) -> DispatchBasePtrType
Get pointer to the dispatcher base class in a type-erased setting to operate on the collection.
template<typename ColT>
auto groupElementCount(VirtualProxyType const& proxy) -> std::size_t
Count the number of elements for a collection on this node.
template<typename ColT>
auto createGroupCollection(VirtualProxyType const& proxy, bool const in_group) -> GroupType
Create the group.
template<typename ColT, typename IndexT = typename ColT::IndexType>
auto insertCollectionElement(VirtualPtrType<IndexT> vc, VirtualProxyType const proxy, IndexT const& idx, NodeType const home_node, bool const is_migrated_in = false, NodeType const migrated_from = uninitialized_destination) -> bool
Insert a new collection element.
template<typename ColT, typename IndexT>
void destroy(CollectionProxyWrapType<ColT, IndexT> const& proxy)
Destroy a collection.
template<typename ColT>
auto getMappedNode(CollectionProxyWrapType<ColT> const& proxy, typename ColT::IndexType const& idx) -> NodeType
Get the default mapped node for an element.
template<typename IdxT>
auto getMappedNode(VirtualProxyType proxy, IdxT const& idx) -> NodeType
Get the default mapped node for an element.
template<typename ColT>
auto migrate(VrtElmProxy<ColT, typename ColT::IndexType> proxy, NodeType const& dest) -> MigrateStatus
Migrate element to a new node.
template<typename ColT>
auto beginModification(CollectionProxyWrapType<ColT> const& proxy, std::string const& label) -> ModifierToken
Begin a modification epoch collectively for a collection with dynamic membership.
template<typename ColT>
void finishModification(CollectionProxyWrapType<ColT> const& proxy, ModifierToken&& token)
Finish an modification epoch collectively for a collection.
template<typename ColT, typename MsgT>
void insert(CollectionProxyWrapType<ColT> const& proxy, typename ColT::IndexType idx, NodeType const node, ModifierToken& token, MsgSharedPtr<MsgT> msg = nullptr, bool pinged_home_already = false)
Dynamically insert an element or send a message to mapped node to insert. If the node parameter is set, ignore the mapped node and insert wherever specified by the user.
template<typename ColT>
void destroyElm(CollectionProxyWrapType<ColT> const& proxy, typename ColT::IndexType idx, ModifierToken& token)
Dynamically delete a collection element.
template<typename ColT, typename IndexT = typename ColT::IndexType>
auto tryGetLocalPtr(CollectionProxyWrapType<ColT, IndexT> const& proxy, IndexT idx) -> ColT*
Try to get a pointer to a collection element.
template<typename ColT>
void addCleanupFn(VirtualProxyType proxy)
Add a cleanup function for a collection after destruction.
auto getTypelessHolder() -> TypelessHolder&
Get the typeless holder data about the collection.
template<typename ColT, typename IndexT = typename ColT::IndexType>
auto registerElementListener(VirtualProxyType proxy, listener::ListenFnType<IndexT> fn) -> int
Register listener function for a given collection.
template<typename ColT, typename IndexT = typename ColT::IndexType>
void unregisterElementListener(VirtualProxyType proxy, int element)
Unregister listener function for a given collection.
template<typename ColT, typename IndexT = typename ColT::IndexType>
auto getRange(VirtualProxyType proxy) -> IndexT
Get the range that a collection was constructed with.
template<typename ColT, typename IndexT = typename ColT::IndexType>
auto getLocalIndices(CollectionProxyWrapType<ColT> proxy) -> std::set<IndexT>
Get the local indices that are currently on this node.
template<typename IndexT>
auto makeFilename(IndexT range, IndexT idx, std::string file_base, bool make_sub_dirs, int files_per_directory) -> std::string
Make the filename for checkpoint/restore.
template<typename IndexT>
auto makeMetaFilename(std::string file_base, bool make_sub_dirs) -> std::string
Make the filename for meta-data related to checkpoint/restore.
template<typename ColT, typename IndexT = typename ColT::IndexType>
void checkpointToFile(CollectionProxyWrapType<ColT> proxy, std::string const& file_base, bool make_sub_dirs = true, int files_per_directory = 4)
Checkpoint the collection (collective). Must wait for termination (consistent snapshot) of work on the collection before invoking.
template<typename ColT>
auto restoreFromFile(typename ColT::IndexType range, std::string const& file_base) -> CollectionProxyWrapType<ColT>
Restore the collection (collective) from file.
template<typename ColT>
void restoreFromFileInPlace(CollectionProxyWrapType<ColT> proxy, typename ColT::IndexType range, std::string const& file_base)
Restore the collection (collective) from file on top of an existing collection. Migrates collection elements to the rank saved from the checkpoint.
auto getLabel(VirtualProxyType const proxy) const -> std::string
Get collection label.
template<typename SerializerT>
void serialize(SerializerT& s)
template<typename ColT, typename MsgT>
void invokeMsgImpl(VirtualElmProxyType<ColT> const& proxy, MsgSharedPtr<MsgT> msg, ] bool instrument)
template<typename MsgT, typename ColT>
auto broadcastCollectiveMsgImpl(CollectionProxyWrapType<ColT> const& proxy, MsgPtr<MsgT>& msg, ] bool instrument) -> messaging::PendingSend
template<typename MsgT, typename ColT, typename IdxT>
auto broadcastMsgUntypedHandler(CollectionProxyWrapType<ColT, IdxT> const& toProxy, MsgT* raw_msg, HandlerType const handler, ] bool instrument) -> messaging::PendingSend
template<typename ColT, typename MsgT, ActiveTypedFnType<MsgT>* f>
auto reduceMsgExpr(CollectionProxyWrapType<ColT> const& proxy, MsgT*const msg, ] ReduceIdxFuncType<typename ColT::IndexType> expr_fn, ReduceStamp stamp, typename ColT::IndexType const& idx) -> messaging::PendingSend
template<typename ColT, mapping::ActiveMapTypedFnType<typename ColT::IndexType> fn>
auto constructCollective(typename ColT::IndexType range, std::string const& label) -> CollectionManager::IsDefaultConstructableType<ColT, typename ColT::IndexType>
template<typename ColT, mapping::ActiveMapTypedFnType<typename ColT::IndexType> fn>
auto constructCollective(typename ColT::IndexType range, DistribConstructFn<ColT> cons_fn, std::string const& label) -> CollectionManager::CollectionProxyWrapType<ColT, typename ColT::IndexType>
template<typename ColT>
auto beginModification(] CollectionProxyWrapType<ColT> const& proxy, std::string const& label) -> ModifierToken
template<typename ColT>
void restoreFromFileInPlace(CollectionProxyWrapType<ColT> proxy, ] typename ColT::IndexType range, std::string const& file_base)

Protected functions

void insertCollectionInfo(VirtualProxyType const& proxy, HandlerType const map_han)
Insert collection into TypelessHolder.

Function documentation

template<typename ColT>
static HandlerType vt::vrt::collection::CollectionManager::getDefaultMap()

Get the default map registered handler for a collection.

Returns the registered map

template<typename ColT, typename ParamT, typename... Args>
static HandlerType vt::vrt::collection::CollectionManager::getDefaultMapImpl(std::tuple<Args...>)

Register a map functor for arguments.

Returns the registered map

template<typename IndexT>
static IndexT const * vt::vrt::collection::CollectionManager::queryIndexContext()

Query the current index context of the running handler.

Returns the running index

This function can be called legally during the constructor of a virtual collection element and when a handler for it is running.

template<typename IndexT>
static VirtualProxyType vt::vrt::collection::CollectionManager::queryProxyContext()

Query the current proxy context of the running handler.

Returns the running proxy

template<typename IndexT>
static bool vt::vrt::collection::CollectionManager::hasContext()

Check if a collection is running in the current context.

Returns whether a collection handler is running

template<typename CoLT, typename IndexT>
static void vt::vrt::collection::CollectionManager::collectionMsgHandler(BaseMessage* msg)

Base collection message handler.

Parameters
msg in the message

template<typename ColT, typename IndexT, typename MsgT>
static void vt::vrt::collection::CollectionManager::collectionMsgTypedHandler(MsgT* msg)

Typed collection message handler.

Parameters
msg in the message

template<typename ColT, typename MsgT>
static void vt::vrt::collection::CollectionManager::recordLBData(ColT* col_ptr, MsgT* msg)

Record LB data for collection message handler when a message arrives for the element.

Parameters
col_ptr in the collection element pointer
msg in the message to deliver

\internalRecords where the message came from, size of message, and type of communication (e.g., broadcast or send)

template<typename ColT, typename IndexT, typename MsgT>
static void vt::vrt::collection::CollectionManager::collectionAutoMsgDeliver(MsgT* msg, Indexable<IndexT>* col, HandlerType han, NodeType from, trace::TraceEventIDType event, bool immediate)

Deliver a message to a collection element.

Parameters
msg in the message
col in the collection element pointer
han in the handler to invoke
from in the node that sent it
event in the associated trace event
immediate

template<typename ColT, typename IndexT, typename MsgT>
static void vt::vrt::collection::CollectionManager::collectionBcastHandler(MsgT* msg)

Receive a broadcast to a collection.

Parameters
msg in collection message

template<typename ColT, typename IndexT, typename MsgT>
static void vt::vrt::collection::CollectionManager::broadcastRootHandler(MsgT* msg)

Receive a broadcast at the root for stamping.

Parameters
msg in the message

template<typename ColT, typename IndexT, typename... Args>
static VirtualPtrType<IndexT> vt::vrt::collection::CollectionManager::runConstructor(Args && ... args)

Run the collection element's constructor.

Parameters
args in the constructor args
Returns unique pointer to the new element

template<typename ColT, typename MsgT>
static void vt::vrt::collection::CollectionManager::insertHandler(InsertMsg<ColT, MsgT>* msg)

Handler to insert an element on this node.

Parameters
msg in insert message

template<typename ColT, typename MsgT>
static void vt::vrt::collection::CollectionManager::pingHomeHandler(InsertMsg<ColT, MsgT>* msg)

Handler to query home before inserting on this node.

Parameters
msg in insert message

static void vt::vrt::collection::CollectionManager::computeReduceStamp(CollectionStampMsg* msg)

Handler that receives the reduce stamp after insertions are complete.

Parameters
msg in the stamp message

template<typename ColT>
static void vt::vrt::collection::CollectionManager::destroyElmHandler(ColT*, DestroyElmMsg<ColT>* msg)

Send message to element to delete it during a modification epoch.

Parameters
msg in the destroy message

template<typename ColT>
static void vt::vrt::collection::CollectionManager::migrateToRestoreLocation(NodeType node, typename ColT::IndexType idx, CollectionProxyWrapType<ColT> proxy)

Migrate element to restore location from checkpoint.

Parameters
node in the node
idx in the element index
proxy in the collection proxy

template<typename ColT, typename IndexT, typename MsgT>
static void vt::vrt::collection::CollectionManager::collectionAutoMsgDeliver(MsgT* msg, Indexable<IndexT>* base, HandlerType han, NodeType from, ] trace::TraceEventIDType event, bool immediate)

template<typename ColT>
CollectionProxyWrapType<ColT, typename ColT::IndexType> vt::vrt::collection::CollectionManager::constructMap(typename ColT::IndexType range, HandlerType const map, std::string const& label = {})

Construct a new virtual context collection with an explicit, pre-registered map handler.

Parameters
range in index range for the collection
map in pre-registered map handler
label in collection label
Returns proxy to the new collection

template<typename ColT, mapping::ActiveMapTypedFnType<typename ColT::IndexType> fn>
CollectionProxyWrapType<ColT, typename ColT::IndexType> vt::vrt::collection::CollectionManager::construct(typename ColT::IndexType range, std::string const& label = {})

Construct a new virtual context collection with templated map.

Parameters
range in index range for the collection
label in collection label
Returns proxy to the new collection

template<typename ColT>
CollectionProxyWrapType<ColT, typename ColT::IndexType> vt::vrt::collection::CollectionManager::construct(typename ColT::IndexType range, std::string const& label = {})

Construct a new virtual context collection using the default map for the given index.

Parameters
range in index range for the collection
label in collection label
Returns proxy to the new collection

The default map is found by looking up the vrt::collection::DefaultMap<...> specialization on the Index type.

template<typename ColT, mapping::ActiveMapTypedFnType<typename ColT::IndexType> fn>
IsDefaultConstructableType<ColT> vt::vrt::collection::CollectionManager::constructCollective(typename ColT::IndexType range, std::string const& label = {})

Collectively construct a new virtual context collection with templated map.

Parameters
range in index range for the collection
label in collection label
Returns proxy to the new collection

Construct virtual context collection with an explicit map. This construct method enables distributed SPMD construction of the virtual context collection where each index is mapped with the MapFnT.

template<typename ColT, mapping::ActiveMapTypedFnType<typename ColT::IndexType> fn>
CollectionProxyWrapType<ColT> vt::vrt::collection::CollectionManager::constructCollective(typename ColT::IndexType range, DistribConstructFn<ColT> cons_fn, std::string const& label = {})

Collectively construct a new virtual context collection with templated map.

Parameters
range in index range for the collection
cons_fn in construct function to create an element on each node
label in collection label
Returns proxy to the new collection

Construct virtual context collection with an explicit map. This construct method enables distributed SPMD construction of the virtual context collection using the DistribConstructFn. The system will invoke that function for every index in the system based on the where each index is mapped with the MapFnT.

template<typename ColT>
IsDefaultConstructableType<ColT> vt::vrt::collection::CollectionManager::constructCollective(typename ColT::IndexType range, std::string const& label = {})

Collectively construct a new virtual context collection with the default map.

Parameters
range in index range for the collection
label in collection label
Returns proxy to the new collection

Construct virtual context collection with the default map. This construct method enables distributed SPMD construction of the virtual context collection where each index is mapped with the default mapping function.

template<typename ColT>
CollectionProxyWrapType<ColT> vt::vrt::collection::CollectionManager::constructCollective(typename ColT::IndexType range, DistribConstructFn<ColT> cons_fn, std::string const& label = {})

Collectively construct a new virtual context collection with the default map.

Parameters
range in index range for the collection
cons_fn in construct function to create an element on each node
label in collection label
Returns proxy to the new collection

Construct virtual context collection with the default map. This construct method enables distributed SPMD construction of the virtual context collection using the DistribConstructFn. The system will invoke that function for every index in the system based on the where each index is mapped with the default mapping function for this index type selected.

template<typename ColT>
CollectionProxyWrapType<ColT> vt::vrt::collection::CollectionManager::constructCollectiveMap(typename ColT::IndexType range, DistribConstructFn<ColT> cons_fn, HandlerType const map_hanm, std::string const& label = {})

Collectively construct a new virtual context collection with a pre-registered map function.

Parameters
range in index range for the collection
cons_fn in construct function to create an element on each node
map_hanm
label in collection label
Returns proxy to new collection

Construct virtual context collection with a pre-registered map function handler. This construct method enables distributed SPMD construction of the virtual context collection using the DistribConstructFn. The system will invoke that function for every index in the system based on the where each index is mapped with the registered map function.

template<typename ColT, typename... Args>
void vt::vrt::collection::CollectionManager::insertMetaCollection(std::string const& label, VirtualProxyType const proxy, Args && ... inner_holder_args)

Insert meta-data for this collection on this node.

Parameters
label in the collection label
proxy in the collection proxy
inner_holder_args in arguments to construct the inner holder

Type-erase some lambdas for doing the collective broadcast that collects up the LB data on each node for each collection element

VirtualProxyType vt::vrt::collection::CollectionManager::makeCollectionProxy(bool is_collective, bool is_migratable)

Make the next collection proxy.

Parameters
is_collective in whether the collection is collective
is_migratable in whether the collection is migratable
Returns the collection proxy bits

template<typename ColT>
void vt::vrt::collection::CollectionManager::constructGroup(VirtualProxyType const& proxy)

Construct a group for the collection.

Parameters
proxy in the collection proxy

\internalThis must be called for every collection before any reductions can safely complete. If the collection spans all node, this will fire a lambda that tells the system that the default_group can be used for broadcasts and reductions. Broadcasts are always valid to run (unless the group expands after LB) because it will just hit extra nodes that may not have elements.

template<typename MsgT, typename ColT = typename MsgT::CollectionType, typename IdxT = typename ColT::IndexType>
messaging::PendingSend vt::vrt::collection::CollectionManager::sendMsgUntypedHandler(VirtualElmProxyType<ColT> const& proxy, MsgT* msg, HandlerType const handler, bool imm_context = true)

Send a message to a collection element with handler type erased.

Parameters
proxy in the collection proxy
msg in the message
handler in the handler to run
imm_context in whether in an immediate context (running a collection element handler vs. directly in the scheduler)— if in a handler, local delivery must be postponed
Returns a pending send

template<typename MsgT, typename ColT>
IsNotColMsgType<MsgT> vt::vrt::collection::CollectionManager::sendMsgWithHan(VirtualElmProxyType<ColT> const& proxy, MsgT* msg, HandlerType const handler)

Send a message to a collection element when not using a collection message.

Parameters
proxy in the collection proxy
msg in the message
handler in the handler to run

\internalThis overload will wrap the message in a CollectionMessage<ColT> to hold the index meta-data for the collection send.

template<typename MsgT, typename ColT>
IsColMsgType<MsgT> vt::vrt::collection::CollectionManager::sendMsgWithHan(VirtualElmProxyType<ColT> const& proxy, MsgT* msg, HandlerType const handler)

Send a message to a collection element when using a collection message.

Parameters
proxy in the collection proxy
msg in the message
handler in the handler to run

\internalThis overload will directly send the message without promotion

template<typename MsgT, typename ColT>
messaging::PendingSend vt::vrt::collection::CollectionManager::sendNormalMsg(VirtualElmProxyType<ColT> const& proxy, MsgT* msg, HandlerType const handler)

Send a normal message to a collection element with handler type-erased.

Parameters
proxy in the collection proxy
msg in the message
handler in the handler to run
Returns the pending send

template<typename MsgT, ActiveColTypedFnType<MsgT, typename MsgT::CollectionType>* f>
messaging::PendingSend vt::vrt::collection::CollectionManager::sendMsg(VirtualElmProxyType<typename MsgT::CollectionType> const& proxy, MsgT* msg)

Send collection element a message from active function handler.

Parameters
proxy in the collection proxy
msg in the message
Returns a pending send

template<auto f>
messaging::PendingSend vt::vrt::collection::CollectionManager::sendMsg(VirtualElmProxyType<typename ObjFuncTraits<decltype(f)>::MsgT::CollectionType> const& proxy, typename ObjFuncTraits<decltype(f)>::MsgT* msg)

Send collection element a message from active function handler.

Parameters
proxy in the collection proxy
msg in the message
Returns a pending send

template<typename MsgT, ActiveColMemberTypedFnType<MsgT, typename MsgT::CollectionType> f>
messaging::PendingSend vt::vrt::collection::CollectionManager::sendMsg(VirtualElmProxyType<typename MsgT::CollectionType> const& proxy, MsgT* msg)

Send collection element a message from active member handler.

Parameters
proxy in the collection proxy
msg in the message
Returns a pending send

template<typename MsgT, typename ColT, ActiveColTypedFnType<MsgT, ColT>* f>
IsColMsgType<MsgT> vt::vrt::collection::CollectionManager::sendMsg(VirtualElmProxyType<ColT> const& proxy, MsgT* msg)

Send collection element a message from active function handler with a proper CollectionMessage<ColT>

Parameters
proxy in the collection proxy
msg in the message
Returns a pending send

template<typename MsgT, typename ColT, ActiveColTypedFnType<MsgT, ColT>* f>
IsNotColMsgType<MsgT> vt::vrt::collection::CollectionManager::sendMsg(VirtualElmProxyType<ColT> const& proxy, MsgT* msg)

Send collection element a message from active function handler with a non-collection message, doing a promotion.

Parameters
proxy in the collection proxy
msg in the message
Returns a pending send

template<typename MsgT, typename ColT, ActiveColMemberTypedFnType<MsgT, ColT> f>
IsColMsgType<MsgT> vt::vrt::collection::CollectionManager::sendMsg(VirtualElmProxyType<ColT> const& proxy, MsgT* msg)

Send collection element a message from active member handler with a proper CollectionMessage<ColT>

Parameters
proxy in the collection proxy
msg in the message
Returns a pending send

template<typename MsgT, typename ColT, ActiveColMemberTypedFnType<MsgT, ColT> f>
IsNotColMsgType<MsgT> vt::vrt::collection::CollectionManager::sendMsg(VirtualElmProxyType<ColT> const& proxy, MsgT* msg)

Send collection element a message from active member handler with a non-collection message, doing a promotion.

Parameters
proxy in the collection proxy
msg in the message
Returns a pending send

template<typename MsgT, typename ColT, ActiveColTypedFnType<MsgT, ColT>* f>
messaging::PendingSend vt::vrt::collection::CollectionManager::sendMsgImpl(VirtualElmProxyType<ColT> const& proxy, MsgT* msg)

Send a collection element a message with active function handler.

Parameters
proxy in the collection proxy
msg in the message
Returns the pending send

template<typename MsgT, typename ColT, ActiveColMemberTypedFnType<MsgT, typename MsgT::CollectionType> f>
messaging::PendingSend vt::vrt::collection::CollectionManager::sendMsgImpl(VirtualElmProxyType<ColT> const& proxy, MsgT* msg)

Send a collection element a message with active member handler.

Parameters
proxy in the collection proxy
msg in the message
Returns the pending send

template<typename ColT, auto f, typename... Args>
auto vt::vrt::collection::CollectionManager::invoke(VirtualElmProxyType<ColT> const& proxy, Args && ... args)

Invoke function 'f' inline without going through scheduler.

Parameters
proxy in the collection proxy
args in function params

template<typename MsgT, ActiveColTypedFnType<MsgT, typename MsgT::CollectionType>* f>
void vt::vrt::collection::CollectionManager::invokeCollectiveMsg(CollectionProxyWrapType<typename MsgT::CollectionType> const& proxy, messaging::MsgPtrThief<MsgT> msg)

Invoke message action function handler without going through scheduler for all elements.

Parameters
proxy in the whole collection proxy
msg in the msg

template<typename ColT, auto f, typename... Args>
void vt::vrt::collection::CollectionManager::invokeCollective(CollectionProxyWrapType<ColT> const& proxy, Args && ... args)

Invoke function handler without going through scheduler for all elements.

Parameters
proxy in the whole collection proxy
args in the arguments

template<typename MsgT, ActiveColMemberTypedFnType<MsgT, typename MsgT::CollectionType> f>
void vt::vrt::collection::CollectionManager::invokeCollectiveMsg(CollectionProxyWrapType<typename MsgT::CollectionType> const& proxy, messaging::MsgPtrThief<MsgT> msg)

Invoke message action function handler without going through scheduler for all elements.

Parameters
proxy in the whole collection proxy
msg in the msg

template<typename MsgT, ActiveColTypedFnType<MsgT, typename MsgT::CollectionType>* f>
void vt::vrt::collection::CollectionManager::invokeMsg(VirtualElmProxyType<typename MsgT::CollectionType> const& proxy, messaging::MsgPtrThief<MsgT> msg, bool instrument = true)

Invoke message action function handler without going through scheduler.

Parameters
proxy in the collection proxy
msg in the message
instrument in whether to instrument the broadcast for load balancing (some system calls use this to disable instrumentation)

template<typename MsgT, ActiveColMemberTypedFnType<MsgT, typename MsgT::CollectionType> f>
void vt::vrt::collection::CollectionManager::invokeMsg(VirtualElmProxyType<typename MsgT::CollectionType> const& proxy, messaging::MsgPtrThief<MsgT> msg, bool instrument = true)

Invoke message action member handler without going through scheduler.

Parameters
proxy in the collection proxy
msg in the message
instrument in whether to instrument the broadcast for load balancing (some system calls use this to disable instrumentation)

template<typename ColT, typename MsgT>
void vt::vrt::collection::CollectionManager::invokeMsgImpl(VirtualElmProxyType<ColT> const& proxy, MsgSharedPtr<MsgT> msg, bool instrument)

Invoke message handler without going through scheduler.

Parameters
proxy in the collection proxy
msg in the message with the virtual handler
instrument in whether to instrument the broadcast for load balancing (some system calls use this to disable instrumentation)

template<typename ColT, typename MsgT, ActiveTypedFnType<MsgT>* f>
messaging::PendingSend vt::vrt::collection::CollectionManager::reduceMsg(CollectionProxyWrapType<ColT> const& proxy, MsgT*const msg, ReduceStamp stamp = ReduceStamp{}, NodeType root_node = uninitialized_destination)

Reduce over a collection.

Parameters
proxy in the collection proxy
msg in the reduce message
stamp in the reduce stamp
root_node in node to receive the ultimately reduced message and run the associated handler (if a callback is specified on a particular node, the root will run the handler that triggers the callback at the appropriate location)
Returns a PendingSend corresponding to the reduce

template<typename ColT, typename MsgT, ActiveTypedFnType<MsgT>* f>
messaging::PendingSend vt::vrt::collection::CollectionManager::reduceMsg(CollectionProxyWrapType<ColT> const& proxy, MsgT*const msg, ReduceStamp stamp, typename ColT::IndexType const& idx)

Reduce over a collection.

Parameters
proxy in the collection proxy
msg in the reduce message
stamp in the reduce stamp
idx in the index of collection element being reduced
Returns a PendingSend corresponding to the reduce

template<typename ColT, typename MsgT, ActiveTypedFnType<MsgT>* f>
messaging::PendingSend vt::vrt::collection::CollectionManager::reduceMsgExpr(CollectionProxyWrapType<ColT> const& proxy, MsgT*const msg, ReduceIdxFuncType<typename ColT::IndexType> expr_fn, ReduceStamp stamp = ReduceStamp{}, NodeType root_node = uninitialized_destination)

Reduce over the whole collection or a subset of a collection, based on their indices matching an expression.

Parameters
proxy in the collection proxy
msg in the reduce message
expr_fn in expression function to pick indices
stamp in the reduce stamp
root_node in node to receive the ultimately reduced message and run the associated handler (if a callback is specified on a particular node, the root will run the handler that triggers the callback at the appropriate location)
Returns a PendingSend corresponding to the reduce

template<typename ColT, typename MsgT, ActiveTypedFnType<MsgT>* f>
messaging::PendingSend vt::vrt::collection::CollectionManager::reduceMsgExpr(CollectionProxyWrapType<ColT> const& proxy, MsgT*const msg, ReduceIdxFuncType<typename ColT::IndexType> expr_fn, ReduceStamp stamp, typename ColT::IndexType const& idx)

Reduce over the whole collection or a subset of a collection, based on their indices matching an expression.

Parameters
proxy in the collection proxy
msg in the reduce message
expr_fn in expression function to pick indices
stamp in the reduce stamp
idx in the index of collection element being reduced
Returns a PendingSend corresponding to the reduce

template<typename MsgT, typename ColT>
IsNotColMsgType<MsgT> vt::vrt::collection::CollectionManager::broadcastMsgWithHan(CollectionProxyWrapType<ColT> const& proxy, MsgT* msg, HandlerType const handler, bool instrument = true)

Broadcast to collection with a promoted message.

Parameters
proxy in the collection proxy
msg in the message
handler in the handler to invoke
instrument in whether to instrument the broadcast for load balancing (some system calls use this to disable instrumentation)

template<typename MsgT, typename ColT>
IsColMsgType<MsgT> vt::vrt::collection::CollectionManager::broadcastMsgWithHan(CollectionProxyWrapType<ColT> const& proxy, MsgT* msg, HandlerType const handler, bool instrument = true)

Broadcast to collection with a collection message.

Parameters
proxy in the collection proxy
msg in the message
handler in the handler to invoke
instrument in whether to instrument the broadcast for load balancing (some system calls use this to disable instrumentation)

template<typename MsgT, typename ColT>
messaging::PendingSend vt::vrt::collection::CollectionManager::broadcastNormalMsg(CollectionProxyWrapType<ColT> const& proxy, MsgT* msg, HandlerType const handler, bool instrument = true)

Broadcast a normal message.

Parameters
proxy in the collection proxy
msg in the message
handler in the handler to invoke
instrument in whether to instrument the broadcast for load balancing (some system calls use this to disable instrumentation)
Returns a pending send

template<typename MsgT, typename ColT, typename IdxT>
messaging::PendingSend vt::vrt::collection::CollectionManager::broadcastMsgUntypedHandler(CollectionProxyWrapType<ColT, IdxT> const& proxy, MsgT* msg, HandlerType const handler, bool instrument)

Broadcast a message with type-erased handler.

Parameters
proxy in the collection proxy
msg in the message
handler in the handler to invoke
instrument in whether to instrument the broadcast for load balancing (some system calls use this to disable instrumentation)
Returns a pending send

template<typename MsgT, ActiveColTypedFnType<MsgT, typename MsgT::CollectionType>* f>
messaging::PendingSend vt::vrt::collection::CollectionManager::broadcastCollectiveMsg(CollectionProxyWrapType<typename MsgT::CollectionType> const& proxy, messaging::MsgPtrThief<MsgT> msg, bool instrument = true)

Broadcast collective a message with action function handler.

Parameters
proxy in the collection proxy
msg in the message
instrument in whether to instrument the broadcast for load balancing (some system calls use this to disable instrumentation)
Returns a pending send

template<typename MsgT, ActiveColMemberTypedFnType<MsgT, typename MsgT::CollectionType> f>
messaging::PendingSend vt::vrt::collection::CollectionManager::broadcastCollectiveMsg(CollectionProxyWrapType<typename MsgT::CollectionType> const& proxy, messaging::MsgPtrThief<MsgT> msg, bool instrument = true)

Broadcast collective a message with action member handler.

Parameters
proxy in the collection proxy
msg in the message
instrument in whether to instrument the broadcast for load balancing (some system calls use this to disable instrumentation)
Returns a pending send

template<typename MsgT, typename ColT>
messaging::PendingSend vt::vrt::collection::CollectionManager::broadcastCollectiveMsgImpl(CollectionProxyWrapType<ColT> const& proxy, MsgPtr<MsgT>& msg, bool instrument)

Broadcast collective a message.

Parameters
proxy in the collection proxy
msg in the message
instrument in whether to instrument the broadcast for load balancing (some system calls use this to disable instrumentation)
Returns a pending send

template<auto f>
messaging::PendingSend vt::vrt::collection::CollectionManager::broadcastMsg(CollectionProxyWrapType<typename ObjFuncTraits<decltype(f)>::MsgT::CollectionType> const& proxy, typename ObjFuncTraits<decltype(f)>::MsgT* msg, bool instrument = true)

Broadcast a message with action function handler.

Parameters
proxy in the collection proxy
msg in the message
instrument in whether to instrument the broadcast for load balancing (some system calls use this to disable instrumentation)
Returns a pending send

template<typename MsgT, typename ColT, ActiveColTypedFnType<MsgT, ColT>* f>
IsColMsgType<MsgT> vt::vrt::collection::CollectionManager::broadcastMsg(CollectionProxyWrapType<ColT> const& proxy, MsgT* msg, bool instrument = true)

Broadcast a message with action function handler with collection message.

Parameters
proxy in the collection proxy
msg in the message
instrument in whether to instrument the broadcast for load balancing (some system calls use this to disable instrumentation)
Returns a pending send

template<typename MsgT, typename ColT, ActiveColTypedFnType<MsgT, ColT>* f>
IsNotColMsgType<MsgT> vt::vrt::collection::CollectionManager::broadcastMsg(CollectionProxyWrapType<ColT> const& proxy, MsgT* msg, bool instrument = true)

Broadcast a message with action function handler with normal message promoted automatically to CollectionMessage<ColT>

Parameters
proxy in the collection proxy
msg in the message
instrument in whether to instrument the broadcast for load balancing (some system calls use this to disable instrumentation)
Returns a pending send

template<typename MsgT, typename ColT, ActiveColMemberTypedFnType<MsgT, ColT> f>
IsColMsgType<MsgT> vt::vrt::collection::CollectionManager::broadcastMsg(CollectionProxyWrapType<ColT> const& proxy, MsgT* msg, bool instrument = true)

Broadcast a message with action member handler with collection message.

Parameters
proxy in the collection proxy
msg in the message
instrument in whether to instrument the broadcast for load balancing (some system calls use this to disable instrumentation)
Returns a pending send

template<typename MsgT, typename ColT, ActiveColMemberTypedFnType<MsgT, ColT> f>
IsNotColMsgType<MsgT> vt::vrt::collection::CollectionManager::broadcastMsg(CollectionProxyWrapType<ColT> const& proxy, MsgT* msg, bool instrument = true)

Broadcast a message with action member handler with normal message promoted automatically to CollectionMessage<ColT>

Parameters
proxy in the collection proxy
msg in the message
instrument in whether to instrument the broadcast for load balancing (some system calls use this to disable instrumentation)
Returns a pending send

template<typename MsgT, typename ColT, ActiveColTypedFnType<MsgT, ColT>* f>
messaging::PendingSend vt::vrt::collection::CollectionManager::broadcastMsgImpl(CollectionProxyWrapType<ColT> const& proxy, MsgT* msg, bool instrument = true)

Broadcast a message with active function handler.

Parameters
proxy in the collection proxy
msg in the message
instrument in whether to instrument the broadcast for load balancing (some system calls use this to disable instrumentation)
Returns a pending send

template<typename MsgT, typename ColT, ActiveColMemberTypedFnType<MsgT, ColT> f>
messaging::PendingSend vt::vrt::collection::CollectionManager::broadcastMsgImpl(CollectionProxyWrapType<ColT> const& proxy, MsgT* msg, bool instrument = true)

Broadcast a message with active member handler.

Parameters
proxy in the collection proxy
msg in the message
instrument in whether to instrument the broadcast for load balancing (some system calls use this to disable instrumentation)
Returns a pending send

template<typename ColT, typename IndexT, typename MsgT>
messaging::PendingSend vt::vrt::collection::CollectionManager::broadcastFromRoot(MsgT* msg)

Bounce broadcast off of the root node to stamp them to avoid multiple delivery during migrations.

Parameters
msg in the message
Returns a pending send

template<typename MsgT, typename ColT>
DispatchHandlerType vt::vrt::collection::CollectionManager::getDispatchHandler()

Get the type-erased dispatcher handler for sending/broadcasting without the collection type.

Returns the type-erased dispatch handler

\internalUsed for type-free sends/broadcast, like a callback that erases the type but still needs to reach a typed endpoint

template<typename = void>
DispatchBasePtrType vt::vrt::collection::CollectionManager::getDispatcher(DispatchHandlerType const& han)

Get pointer to the dispatcher base class in a type-erased setting to operate on the collection.

Parameters
han in the registered dispatch handler
Returns the base dispatcher

template<typename ColT>
std::size_t vt::vrt::collection::CollectionManager::groupElementCount(VirtualProxyType const& proxy)

Count the number of elements for a collection on this node.

Parameters
proxy in the collection proxy bits
Returns number of local elements

\internalUsed for automatic group creation for each collection instance for broadcasts (optimization) and reduce (correctness).

template<typename ColT>
GroupType vt::vrt::collection::CollectionManager::createGroupCollection(VirtualProxyType const& proxy, bool const in_group)

Create the group.

Parameters
proxy in the collection proxy bits
in_group in whether this node is in the group
Returns the new group ID

template<typename ColT, typename IndexT = typename ColT::IndexType>
bool vt::vrt::collection::CollectionManager::insertCollectionElement(VirtualPtrType<IndexT> vc, VirtualProxyType const proxy, IndexT const& idx, NodeType const home_node, bool const is_migrated_in = false, NodeType const migrated_from = uninitialized_destination)

Insert a new collection element.

Parameters
vc in unique pointer to the new, constructed collection element
proxy in collection proxy bits
idx in element index
home_node in the home node for this element
is_migrated_in in whether it just migrated in
migrated_from in where it migrated in from
Returns whether it successfully inserted the element

\internalSystem call to insert a new collection element on this node. Called either during construction/staged insertion or when an element migrates into this node. Before this is called, one must construct the element. Then, one must use the CollectionTypeAttorney to do the setup for the element—which sets the index and other properties on the element. Once that is done, this call will register the element with the location manager and add it to the collection holders.

template<typename ColT, typename IndexT>
void vt::vrt::collection::CollectionManager::destroy(CollectionProxyWrapType<ColT, IndexT> const& proxy)

Destroy a collection.

Parameters
proxy in the collection proxy

template<typename ColT>
NodeType vt::vrt::collection::CollectionManager::getMappedNode(CollectionProxyWrapType<ColT> const& proxy, typename ColT::IndexType const& idx)

Get the default mapped node for an element.

Parameters
proxy in the collection proxy
idx in the index
Returns the mapped node

template<typename IdxT>
NodeType vt::vrt::collection::CollectionManager::getMappedNode(VirtualProxyType proxy, IdxT const& idx)

Get the default mapped node for an element.

Parameters
proxy in the collection proxy
idx in the index
Returns the mapped node

template<typename ColT>
MigrateStatus vt::vrt::collection::CollectionManager::migrate(VrtElmProxy<ColT, typename ColT::IndexType> proxy, NodeType const& dest)

Migrate element to a new node.

Parameters
proxy in the element proxy
dest in the destination node
Returns status of migration operation

Element must exist on this node to call this method.

template<typename ColT>
ModifierToken vt::vrt::collection::CollectionManager::beginModification(CollectionProxyWrapType<ColT> const& proxy, std::string const& label)

Begin a modification epoch collectively for a collection with dynamic membership.

Parameters
proxy in the collection proxy
label in label for the insertion epoch
Returns the modifier token

template<typename ColT>
void vt::vrt::collection::CollectionManager::finishModification(CollectionProxyWrapType<ColT> const& proxy, ModifierToken&& token)

Finish an modification epoch collectively for a collection.

Parameters
proxy in the collection proxy
token in the insertion token

template<typename ColT, typename MsgT>
void vt::vrt::collection::CollectionManager::insert(CollectionProxyWrapType<ColT> const& proxy, typename ColT::IndexType idx, NodeType const node, ModifierToken& token, MsgSharedPtr<MsgT> msg = nullptr, bool pinged_home_already = false)

Dynamically insert an element or send a message to mapped node to insert. If the node parameter is set, ignore the mapped node and insert wherever specified by the user.

Parameters
proxy in the collection proxy
idx in the index to insert
node in the node to insert on
token in the inserter token with the insertion epoch
msg
pinged_home_already in whether the home node has been contacted to ensure an insertion has not occurred already

template<typename ColT>
void vt::vrt::collection::CollectionManager::destroyElm(CollectionProxyWrapType<ColT> const& proxy, typename ColT::IndexType idx, ModifierToken& token)

Dynamically delete a collection element.

Parameters
proxy in the collection proxy
idx in the index to insert
token in the inserter token with the insertion epoch

template<typename ColT, typename IndexT = typename ColT::IndexType>
ColT* vt::vrt::collection::CollectionManager::tryGetLocalPtr(CollectionProxyWrapType<ColT, IndexT> const& proxy, IndexT idx)

Try to get a pointer to a collection element.

Parameters
proxy in the collection proxy
idx in the index
Returns raw pointer to element

template<typename ColT>
void vt::vrt::collection::CollectionManager::addCleanupFn(VirtualProxyType proxy)

Add a cleanup function for a collection after destruction.

Parameters
proxy in the collection proxy bits

TypelessHolder& vt::vrt::collection::CollectionManager::getTypelessHolder()

Get the typeless holder data about the collection.

Returns the typeless holder

template<typename ColT, typename IndexT = typename ColT::IndexType>
int vt::vrt::collection::CollectionManager::registerElementListener(VirtualProxyType proxy, listener::ListenFnType<IndexT> fn)

Register listener function for a given collection.

Parameters
proxy in the proxy of the collection
fn in the listener function

template<typename ColT, typename IndexT = typename ColT::IndexType>
void vt::vrt::collection::CollectionManager::unregisterElementListener(VirtualProxyType proxy, int element)

Unregister listener function for a given collection.

Parameters
proxy in the proxy of the collection
element in the index of the registered listener function

template<typename ColT, typename IndexT = typename ColT::IndexType>
IndexT vt::vrt::collection::CollectionManager::getRange(VirtualProxyType proxy)

Get the range that a collection was constructed with.

Parameters
proxy in the proxy of the collection
Returns the range of the collection

template<typename ColT, typename IndexT = typename ColT::IndexType>
std::set<IndexT> vt::vrt::collection::CollectionManager::getLocalIndices(CollectionProxyWrapType<ColT> proxy)

Get the local indices that are currently on this node.

Parameters
proxy in the proxy of the collection
Returns the set of indices on this node

template<typename IndexT>
std::string vt::vrt::collection::CollectionManager::makeFilename(IndexT range, IndexT idx, std::string file_base, bool make_sub_dirs, int files_per_directory)

Make the filename for checkpoint/restore.

Parameters
range in range for collection
idx in index of element
file_base in base file name
make_sub_dirs in whether to make sub-directories for elements: useful when the number of collection elements are large
files_per_directory in number of files to output for each sub-dir
Returns full path of a file for the element

template<typename IndexT>
std::string vt::vrt::collection::CollectionManager::makeMetaFilename(std::string file_base, bool make_sub_dirs)

Make the filename for meta-data related to checkpoint/restore.

Parameters
file_base in base file name
make_sub_dirs
Returns meta-data file name for the node

template<typename ColT, typename IndexT = typename ColT::IndexType>
void vt::vrt::collection::CollectionManager::checkpointToFile(CollectionProxyWrapType<ColT> proxy, std::string const& file_base, bool make_sub_dirs = true, int files_per_directory = 4)

Checkpoint the collection (collective). Must wait for termination (consistent snapshot) of work on the collection before invoking.

Parameters
proxy in the proxy of the collection
file_base in the base file name of the files write
make_sub_dirs in whether to make sub-directories for elements: useful when the number of collection elements are large
files_per_directory in number of files to output for each sub-dir
Returns the range of the collection

template<typename ColT>
CollectionProxyWrapType<ColT> vt::vrt::collection::CollectionManager::restoreFromFile(typename ColT::IndexType range, std::string const& file_base)

Restore the collection (collective) from file.

Parameters
range in the range of the collection to restart
file_base in the base file name for the files to read
Returns proxy to the new collection

template<typename ColT>
void vt::vrt::collection::CollectionManager::restoreFromFileInPlace(CollectionProxyWrapType<ColT> proxy, typename ColT::IndexType range, std::string const& file_base)

Restore the collection (collective) from file on top of an existing collection. Migrates collection elements to the rank saved from the checkpoint.

Parameters
proxy in the collection proxy
range in the range of the collection to restore
file_base in the base file name for the files to read

std::string vt::vrt::collection::CollectionManager::getLabel(VirtualProxyType const proxy) const

Get collection label.

Parameters
proxy in Collection proxy
Returns collection lable

template<typename ColT, typename MsgT>
void vt::vrt::collection::CollectionManager::invokeMsgImpl(VirtualElmProxyType<ColT> const& proxy, MsgSharedPtr<MsgT> msg, ] bool instrument)

template<typename MsgT, typename ColT>
messaging::PendingSend vt::vrt::collection::CollectionManager::broadcastCollectiveMsgImpl(CollectionProxyWrapType<ColT> const& proxy, MsgPtr<MsgT>& msg, ] bool instrument)

template<typename MsgT, typename ColT, typename IdxT>
messaging::PendingSend vt::vrt::collection::CollectionManager::broadcastMsgUntypedHandler(CollectionProxyWrapType<ColT, IdxT> const& toProxy, MsgT* raw_msg, HandlerType const handler, ] bool instrument)

template<typename ColT, typename MsgT, ActiveTypedFnType<MsgT>* f>
messaging::PendingSend vt::vrt::collection::CollectionManager::reduceMsgExpr(CollectionProxyWrapType<ColT> const& proxy, MsgT*const msg, ] ReduceIdxFuncType<typename ColT::IndexType> expr_fn, ReduceStamp stamp, typename ColT::IndexType const& idx)

template<typename ColT, mapping::ActiveMapTypedFnType<typename ColT::IndexType> fn>
CollectionManager::IsDefaultConstructableType<ColT, typename ColT::IndexType> vt::vrt::collection::CollectionManager::constructCollective(typename ColT::IndexType range, std::string const& label)

template<typename ColT, mapping::ActiveMapTypedFnType<typename ColT::IndexType> fn>
CollectionManager::CollectionProxyWrapType<ColT, typename ColT::IndexType> vt::vrt::collection::CollectionManager::constructCollective(typename ColT::IndexType range, DistribConstructFn<ColT> cons_fn, std::string const& label)

template<typename ColT>
ModifierToken vt::vrt::collection::CollectionManager::beginModification(] CollectionProxyWrapType<ColT> const& proxy, std::string const& label)

template<typename ColT>
void vt::vrt::collection::CollectionManager::restoreFromFileInPlace(CollectionProxyWrapType<ColT> proxy, ] typename ColT::IndexType range, std::string const& file_base)

void vt::vrt::collection::CollectionManager::insertCollectionInfo(VirtualProxyType const& proxy, HandlerType const map_han) protected

Insert collection into TypelessHolder.

Parameters
proxy in the collection proxy bits
map_han in the map function