vt::collective::barrier::Barrier struct

Perform a collective barrier that is safe to use with VT handlers in flight.

Align execution across multiple nodes to ensure each node across the communicator/runtime reach a "matching" barrier.

Base classes

struct vt::collective::tree::Tree virtual
General interface for storing a spanning tree.

Derived classes

struct vt::collective::CollectiveAlg virtual
Perform asynchronous collectives within VT.

Public types

using BarrierStateType = BarrierState
template<typename T>
using ContainerType = std::unordered_map<BarrierType, T>

Public static functions

static void barrierUp(BarrierMsg* msg)
Active handler to send a barrier up the spanning tree.
static void barrierDown(BarrierMsg* msg)
Active handler to send a barrier down the spanning tree.

Constructors, destructors, conversion operators

Barrier()
Construct a new barrier manager.

Public functions

auto insertFindBarrier(bool const& is_named, bool const& is_wait, BarrierType const& barrier, ActionType cont_action = nullptr) -> BarrierStateType&
Insert/find a barrier.
void removeBarrier(bool const& is_named, BarrierType const& barrier)
Remove the state of a barrier.
auto newNamedBarrier() -> BarrierType
Rooted call to create a new named barrier, returning the ID.
auto newNamedCollectiveBarrier() -> BarrierType
Collective call to create a new named barrier, returning the ID.
void barrierUp(bool const& is_named, bool const& is_wait, BarrierType const& barrier, bool const& skip_term)
Send a barrier up the tree.
void barrierDown(bool const& is_named, bool const& is_wait, BarrierType const& barrier)
Send a barrier down the tree to release nodes (barrier is reached!)
void barrier(ActionType poll_action = nullptr, BarrierType const& barrier = no_barrier)
Wait on a barrier.
void barrierThen(ActionType fn)
Collectively create a new barrier and once completed execute an action.
void barrierThen(BarrierType const& barrier, ActionType fn)
Collective wait for a barrier and once completed execute an action.
void systemMetaBarrier()
Collectively barrier skipping termination.
void systemMetaBarrierCont(ActionType fn)
Collectively barrier skipping termination and then execute a continuation.

Function documentation

static void vt::collective::barrier::Barrier::barrierUp(BarrierMsg* msg)

Active handler to send a barrier up the spanning tree.

Parameters
msg in the barrier message

static void vt::collective::barrier::Barrier::barrierDown(BarrierMsg* msg)

Active handler to send a barrier down the spanning tree.

Parameters
msg in the barrier message

BarrierStateType& vt::collective::barrier::Barrier::insertFindBarrier(bool const& is_named, bool const& is_wait, BarrierType const& barrier, ActionType cont_action = nullptr)

Insert/find a barrier.

Parameters
is_named in whether the barrier is named
is_wait in whether the barrier is of waiting type
barrier in the barrier ID
cont_action in (optional) continuation to attach after completion
Returns the barrier state

void vt::collective::barrier::Barrier::removeBarrier(bool const& is_named, BarrierType const& barrier)

Remove the state of a barrier.

Parameters
is_named in whether the barrier is named
barrier in the barrier ID

BarrierType vt::collective::barrier::Barrier::newNamedBarrier()

Rooted call to create a new named barrier, returning the ID.

Returns the barrier ID

After calling this, one must broadcast/send this to other nodes. Typical use case is to put it in a message for later coordination.

BarrierType vt::collective::barrier::Barrier::newNamedCollectiveBarrier()

Collective call to create a new named barrier, returning the ID.

Returns the barrier ID

All nodes must call this in the same order to generate a consistent barrier ID for waiting on later.

void vt::collective::barrier::Barrier::barrierUp(bool const& is_named, bool const& is_wait, BarrierType const& barrier, bool const& skip_term)

Send a barrier up the tree.

Parameters
is_named in whether the barrier is named
is_wait in whether the barrier is of waiting type
barrier in the barrier ID
skip_term in whether to skip termination (mark barrier a TD message)

void vt::collective::barrier::Barrier::barrierDown(bool const& is_named, bool const& is_wait, BarrierType const& barrier)

Send a barrier down the tree to release nodes (barrier is reached!)

Parameters
is_named in whether the barrier is named
is_wait in whether the barrier is of waiting type
barrier in the barrier ID

void vt::collective::barrier::Barrier::barrier(ActionType poll_action = nullptr, BarrierType const& barrier = no_barrier)

Wait on a barrier.

Parameters
poll_action in action to execute while polling for barrier completion in addition to polling scheduler
barrier in the barrier ID to wait on

void vt::collective::barrier::Barrier::barrierThen(ActionType fn)

Collectively create a new barrier and once completed execute an action.

Parameters
fn in the action to execute after the barrier is reached by all nodes

void vt::collective::barrier::Barrier::barrierThen(BarrierType const& barrier, ActionType fn)

Collective wait for a barrier and once completed execute an action.

Parameters
barrier in the barrier to wait on
fn in the action to execute after the barrier is reached by all nodes

void vt::collective::barrier::Barrier::systemMetaBarrier()

Collectively barrier skipping termination.

void vt::collective::barrier::Barrier::systemMetaBarrierCont(ActionType fn)

Collectively barrier skipping termination and then execute a continuation.

Parameters
fn in action to execute after barrier is reached