#include <src/vt/runnable/make_runnable.h>
template<typename MsgT>
RunnableMaker struct
Convenience builder class for setting up a RunnableNew
before enqueuing it or running it.
Constructors, destructors, conversion operators
- RunnableMaker(RunnableNew* in_impl, MsgSharedPtr<MsgT> const& in_msg, HandlerType in_handler, NodeType in_from_node)
- Construct the builder. Shall not be called directly.
- RunnableMaker(RunnableMaker const&) deleted
- RunnableMaker(RunnableMaker&&) defaulted
Public functions
- auto withContinuation(ActionType cont) -> RunnableMaker&&
- Add a continuation.
- auto withTDEpoch(EpochType ep, bool is_term = false) -> RunnableMaker&&
- Add a termination epoch.
- auto withTDEpochFromMsg(bool is_term = false) -> RunnableMaker&&
- Add a termination message to extract an epoch.
-
template<typename ElmT>auto withElementHandler(ElmT* elm) -> RunnableMaker&&
- Add an typed element handler.
-
template<typename ElmT, typename IdxT = typename ElmT::IndexType>auto withCollection(ElmT* elm) -> RunnableMaker&&
- Add a collection; sets up the handler and collection contexts.
-
template<typename ElmT>auto withObjGroup(ElmT* elm) -> RunnableMaker&&
- Add an objgroup; sets up the handler.
-
template<typename ElmT, typename MsgU>auto withLBData(] ElmT* elm, ] MsgU* msg) -> RunnableMaker&&
- Add LB data for instrumentation.
-
template<typename ElmT>auto withLBDataVoidMsg(ElmT* elm) -> RunnableMaker&&
- Add LB data for instrumentation (without a message)
-
template<typename LBDataT, typename T>auto withLBData(] LBDataT* lb_data, ] T elm_id) -> RunnableMaker&&
- Add LB data for instrumentation directly with element ID and LB data.
-
template<typename ElmT>auto withLBData(] ElmT* elm) -> RunnableMaker&&
- Add LB data for instrumentation.
- void runOrEnqueue(bool should_run)
- Run or enqueue the runnable depending on argument.
- void run()
- Run the runnable immediately.
-
template<typename Callable, typename... Args>auto runLambda(Callable&& c, Args && ... args) -> auto
- Run the runnable immediately with a lambda.
- void enqueue()
- Enqueue the runnable in the scheduler for execution later.
- auto getRunnableImpl() -> RunnableNew*
- Return the underlying
RunnableNew
.
Function documentation
template<typename MsgT>
vt:: runnable:: RunnableMaker<MsgT>:: RunnableMaker(RunnableNew* in_impl,
MsgSharedPtr<MsgT> const& in_msg,
HandlerType in_handler,
NodeType in_from_node)
Construct the builder. Shall not be called directly.
Parameters | |
---|---|
in_impl in | the runnable |
in_msg in | the associated message |
in_handler in | the handler |
in_from_node in | the from node for the runnable |
template<typename MsgT>
RunnableMaker&& vt:: runnable:: RunnableMaker<MsgT>:: withContinuation(ActionType cont)
Add a continuation.
Parameters | |
---|---|
cont in | the continuation |
template<typename MsgT>
RunnableMaker&& vt:: runnable:: RunnableMaker<MsgT>:: withTDEpoch(EpochType ep,
bool is_term = false)
Add a termination epoch.
Parameters | |
---|---|
ep in | the epoch |
is_term in | whether it's a termination message |
template<typename MsgT>
RunnableMaker&& vt:: runnable:: RunnableMaker<MsgT>:: withTDEpochFromMsg(bool is_term = false)
Add a termination message to extract an epoch.
Parameters | |
---|---|
is_term in | whether it's a termination message |
template<typename MsgT>
template<typename ElmT>
RunnableMaker&& vt:: runnable:: RunnableMaker<MsgT>:: withElementHandler(ElmT* elm)
Add an typed element handler.
Parameters | |
---|---|
elm in | the element |
template<typename MsgT>
template<typename ElmT, typename IdxT = typename ElmT::IndexType>
RunnableMaker&& vt:: runnable:: RunnableMaker<MsgT>:: withCollection(ElmT* elm)
Add a collection; sets up the handler and collection contexts.
Parameters | |
---|---|
elm in | the collection element pointer |
template<typename MsgT>
template<typename ElmT>
RunnableMaker&& vt:: runnable:: RunnableMaker<MsgT>:: withObjGroup(ElmT* elm)
Add an objgroup; sets up the handler.
Parameters | |
---|---|
elm in | the collection element pointer |
template<typename MsgT>
template<typename ElmT, typename MsgU>
RunnableMaker&& vt:: runnable:: RunnableMaker<MsgT>:: withLBData(] ElmT* elm,
] MsgU* msg)
Add LB data for instrumentation.
Parameters | |
---|---|
elm in | the element |
msg in | the associated message (might be different than the already captured one) |
template<typename MsgT>
template<typename ElmT>
RunnableMaker&& vt:: runnable:: RunnableMaker<MsgT>:: withLBDataVoidMsg(ElmT* elm)
Add LB data for instrumentation (without a message)
Parameters | |
---|---|
elm in | the element |
template<typename MsgT>
template<typename LBDataT, typename T>
RunnableMaker&& vt:: runnable:: RunnableMaker<MsgT>:: withLBData(] LBDataT* lb_data,
] T elm_id)
Add LB data for instrumentation directly with element ID and LB data.
Parameters | |
---|---|
lb_data in | the LB data |
elm_id in | the element ID |
template<typename MsgT>
template<typename ElmT>
RunnableMaker&& vt:: runnable:: RunnableMaker<MsgT>:: withLBData(] ElmT* elm)
Add LB data for instrumentation.
Parameters | |
---|---|
elm in | the element |
template<typename MsgT>
void vt:: runnable:: RunnableMaker<MsgT>:: runOrEnqueue(bool should_run)
Run or enqueue the runnable depending on argument.
Parameters | |
---|---|
should_run in | whether it should be run (if false, it will be enqueued) |
template<typename MsgT>
RunnableNew* vt:: runnable:: RunnableMaker<MsgT>:: getRunnableImpl()
Return the underlying RunnableNew
.
Returns | the underlying runnable |
---|