vt
1.5.0
(Virtual Transport)
|
Go to the documentation of this file.
44 #if !defined INCLUDED_VT_MESSAGING_COLLECTION_CHAIN_SET_H
45 #define INCLUDED_VT_MESSAGING_COLLECTION_CHAIN_SET_H
50 #include <unordered_map>
51 #include <unordered_set>
53 namespace vt {
namespace messaging {
79 template <
typename Index>
97 template <
typename ProxyT,
typename IndexT =
typename ProxyT::IndexType>
146 "Cannot add an already-present chain");
164 iter->second.isTerminated(),
"Cannot remove a chain with pending work");
185 auto& idx = entry.first;
186 auto& chain = entry.second;
194 chain.add(new_epoch, step_action(idx));
235 auto& idx = entry.first;
236 auto& chain = entry.second;
237 chain.add(
epoch, step_action(idx));
304 for (
auto& entry : a.
chains_) {
305 auto& idx = entry.first;
306 auto& chaina = entry.second;
307 auto chainb_pos = b.
chains_.find(entry.first);
310 fmt::format(
"index {} must be present in chainset b", entry.first));
312 auto& chainb = chainb_pos->second;
314 chaina, chainb,
epoch, step_action(idx));
335 std::unordered_set<Index> index_set;
337 index_set.emplace(entry.first);
353 std::unordered_map<Index, DependentSendChain>
chains_;
The base class for all messages. Common alias is vt::Message which uses the default envelope.
Definition: message.h:79
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 Collec...
Definition: collection_chain_set.h:298
static void mergeChainStep(DependentSendChain &a, DependentSendChain &b, EpochType new_epoch, PendingSend &&link)
Add a task that is dependent on two DependentSendChain instances.
Definition: dependent_send_chain.h:151
Definition: debug_config.h:82
void removeIndex(Index idx)
Remove an index from the set.
Definition: collection_chain_set.h:160
ChainSetLayout
Used to specify the layout for automatically managing dependency chains for a given collection.
Definition: collection_chain_set.h:63
Definition: epoch_tags.h:65
void removeIndexHan(IdxMsg *msg)
Remove an index remotely.
Definition: collection_chain_set.h:131
std::function< void()> deallocator_
Deallocator that type erases element listener de-registration.
Definition: collection_chain_set.h:355
Definition: epoch_type.h:52
EpochType makeEpochRooted(UseDS use_ds=UseDS{true}, ParentEpochCapture parent=ParentEpochCapture{})
Create a new rooted epoch.
Definition: termination.cc:1006
void nextStep(std::function< PendingSend(Index)> step_action)
The next step to execute on all the chain indices in this collection chain set.
Definition: collection_chain_set.h:213
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 Collec...
Definition: collection_chain_set.h:275
#define vtAssert(cond, str)
Definition: config_assert.h:151
messaging::ActiveMessenger * theMsg()
Definition: runtime_get.cc:103
A pending send (or other similar operation) that is delayed until this holder goes out of scope.
Definition: pending_send.h:70
void pushEpoch(EpochType const &epoch)
Push an epoch on the stack.
Definition: active.impl.h:454
void phaseDone()
Indicate that the current phase is complete. Resets the state on each DependentSendChain.
Definition: collection_chain_set.h:325
std::unordered_map< Index, DependentSendChain > chains_
Set of DependentSendChain managed on this node for indices.
Definition: collection_chain_set.h:353
Definition: activefn.h:51
Definition: collection_chain_set.h:65
EpochType makeEpochCollective(ParentEpochCapture parent=ParentEpochCapture{})
Create a new collective epoch.
Definition: termination.cc:1051
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 no...
Definition: collection_chain_set.h:255
term::TerminationDetector * theTerm()
Definition: runtime_get.cc:106
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 no...
Definition: collection_chain_set.h:229
IdxMsg(Index in_idx)
Definition: collection_chain_set.h:113
A set of chains to maintain a sequence for a set of collection elements that may be local or remote.
Definition: collection_chain_set.h:80
std::unordered_set< Index > getSet()
Get the set of indices registered with this chain set.
Definition: collection_chain_set.h:334
EpochType popEpoch(EpochType const &epoch=no_epoch)
Pop an epoch off the stack.
Definition: active.impl.h:458
Message that contains an index sent to remove or add remotely.
Definition: collection_chain_set.h:112
CollectionChainSet()=default
Definition: collection_chain_set.h:64
void addIndex(Index idx)
Add an index to the set.
Definition: collection_chain_set.h:143
~CollectionChainSet()
Definition: collection_chain_set.h:100
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.
Definition: collection_chain_set.h:182
Index idx_
Definition: collection_chain_set.h:114
A sequenced chain of sends ordered by termination detection.
Definition: dependent_send_chain.h:117
void addIndexHan(IdxMsg *msg)
Definition: collection_chain_set.h:122
Definition: debug_config.h:99
void finishedEpoch(EpochType const &epoch)
Tell the termination detector that all initial work has been enqueued for a given epoch on this node.
Definition: termination.cc:918