template<typename Index>
CollectionChainSet struct final
A set of chains to maintain a sequence for a set of collection elements that may be local or remote.
Manages a set of chains (sequences) on a set of elements where this is constructed. It may sequence objects that reside on this node or a remote node (either is valid). This enables the user to enqueue sequences of tasks on each object and coordinate data dependencies.
Public static functions
- static void mergeStepCollective(CollectionChainSet& a, CollectionChainSet& b, std::function<PendingSend(Index)> step_action)
- The next collective step of both CollectionChainSets to execute over all shared indices of the CollectionChainSets over all nodes.
- static void mergeStepCollective(std::string const& label, CollectionChainSet& a, CollectionChainSet& b, std::function<PendingSend(Index)> step_action)
- The next collective step of both CollectionChainSets to execute over all shared indices of the CollectionChainSets over all nodes.
Constructors, destructors, conversion operators
- CollectionChainSet() defaulted
- CollectionChainSet(const CollectionChainSet&) deleted
- CollectionChainSet(CollectionChainSet&&) deleted
-
template<typename ProxyT, typename IndexT = typename ProxyT::IndexType>CollectionChainSet(ProxyT proxy, ChainSetLayout layout = Local) explicit
- Construct with a collection proxy to track indices on each node depending on the layout specified. Tracking dependencies on the local node may be better for performance as it may reduce the number of messages that must be sent.
- ~CollectionChainSet()
Public functions
- void addIndex(Index idx)
- Add an index to the set.
- void removeIndex(Index idx)
- Remove an index from the set.
- void nextStep(std::string const& label, std::function<PendingSend(Index)> step_action)
- The next step to execute on all the chain indices in this collection chain set.
- void nextStep(std::function<PendingSend(Index)> step_action)
- The next step to execute on all the chain indices in this collection chain set.
- void nextStepCollective(std::string const& label, std::function<PendingSend(Index)> step_action)
- The next collective step to execute for each index that is added to the CollectionChainSet on each node.
- void nextStepCollective(std::function<PendingSend(Index)> step_action)
- The next collective step to execute for each index that is added to the CollectionChainSet on each node.
- void phaseDone()
- Indicate that the current phase is complete. Resets the state on each
DependentSendChain
. - auto getSet() -> std::unordered_set<Index>
- Get the set of indices registered with this chain set.
- void foreach(std::function<void(Index)> fn)
- Run a lambda immediately on each element in the index set.
Function documentation
template<typename Index>
static void vt::messaging::CollectionChainSet<Index>:: mergeStepCollective(CollectionChainSet& a,
CollectionChainSet& b,
std::function<PendingSend(Index)> step_action)
The next collective step of both CollectionChainSets to execute over all shared indices of the CollectionChainSets over all nodes.
Parameters | |
---|---|
a in | the first chainset |
b in | the second chainset |
step_action in | the next step to be executed, dependent on the previous step of chainsets a and b |
This function ensures that the step is dependent on the previous step of both chainsets a and b. Additionally any additional steps in each chainset will occur after the merged step.
template<typename Index>
static void vt::messaging::CollectionChainSet<Index>:: mergeStepCollective(std::string const& label,
CollectionChainSet& a,
CollectionChainSet& b,
std::function<PendingSend(Index)> step_action)
The next collective step of both CollectionChainSets to execute over all shared indices of the CollectionChainSets over all nodes.
Parameters | |
---|---|
label in | the label for the step |
a in | the first chainset |
b in | the second chainset |
step_action in | the next step to be executed, dependent on the previous step of chainsets a and b |
This function ensures that the step is dependent on the previous step of both chainsets a and b. Additionally any additional steps in each chainset will occur after the merged step.
template<typename Index>
template<typename ProxyT, typename IndexT = typename ProxyT::IndexType>
vt::messaging::CollectionChainSet<Index>:: CollectionChainSet(ProxyT proxy,
ChainSetLayout layout = Local) explicit
Construct with a collection proxy to track indices on each node depending on the layout specified. Tracking dependencies on the local node may be better for performance as it may reduce the number of messages that must be sent.
Parameters | |
---|---|
proxy in | the collection proxy |
layout in | the location the chain set tracks each element |
template<typename Index>
void vt::messaging::CollectionChainSet<Index>:: addIndex(Index idx)
Add an index to the set.
Parameters | |
---|---|
idx in | the index to add |
Creates a new, empty DependentSendChain
for the given index
template<typename Index>
void vt::messaging::CollectionChainSet<Index>:: removeIndex(Index idx)
Remove an index from the set.
Parameters | |
---|---|
idx in | the index to remove |
The chain for that index being removed must be terminated (at the end of the chain). This may be called during migration or when a collection element's control sequencing is no longer being tracked (on this node) with this chain set
template<typename Index>
void vt::messaging::CollectionChainSet<Index>:: nextStep(std::string const& label,
std::function<PendingSend(Index)> step_action)
The next step to execute on all the chain indices in this collection chain set.
Parameters | |
---|---|
label in | Label for the epoch created for debugging |
step_action in | The action to perform as a function that returns a PendingSend |
Goes through every chain index and enqueues the action at the end of the current chain when the preceding steps terminate. Creates a new rooted epoch for this step to contain/track completion of all the causally related messages.
template<typename Index>
void vt::messaging::CollectionChainSet<Index>:: nextStep(std::function<PendingSend(Index)> step_action)
The next step to execute on all the chain indices in this collection chain set.
Parameters | |
---|---|
step_action in | The action to perform as a function that returns a PendingSend |
Goes through every chain index and enqueues the action at the end of the current chain when the preceding steps terminate. Creates a new rooted epoch for this step to contain/track completion of all the causally related messages.
template<typename Index>
void vt::messaging::CollectionChainSet<Index>:: nextStepCollective(std::string const& label,
std::function<PendingSend(Index)> step_action)
The next collective step to execute for each index that is added to the CollectionChainSet on each node.
Parameters | |
---|---|
label in | Label for the epoch created for debugging |
step_action in | the next step to execute, returning a PendingSend |
Should be used for steps with internal recursive communication and global inter-dependence. Creates a global (on the communicator), collective epoch to track all the casually related messages and collectively wait for termination of all of the recursive sends.
template<typename Index>
void vt::messaging::CollectionChainSet<Index>:: nextStepCollective(std::function<PendingSend(Index)> step_action)
The next collective step to execute for each index that is added to the CollectionChainSet on each node.
Parameters | |
---|---|
step_action in | the next step to execute, returning a PendingSend |
Should be used for steps with internal recursive communication and global inter-dependence. Creates a global (on the communicator), collective epoch to track all the casually related messages and collectively wait for termination of all of the recursive sends.