struct
#include <src/vt/phase/phase_manager.h>
PhaseManager General management of phases in an application to delineate collective intervals of time across nodes.
Many system components use phases as a natural boundary for performing incremental operations as the runtime makes progress. For instance, traces may be flushed at phase boundaries and the load balancing framework might apply a strategy between phases.
The main interface for users is invoking vt::
to start the next phase. The system performs a reduction and blocks completion inside this call. Any work that belongs in the preceding phase should be synchronized before this is called. The runtime system or users can register hooks when a phase starts, ends, or after any migrations are complete. Hooks may be collective or rooted; collective hooks are invoked in the order in which they are registered and are always run in a collective epoch.
Base classes
-
template<typename T>struct vt::runtime::component::Component<PhaseManager>
Component
class for a generic VT runtime module, CRTP'ed over the component's actual type
Public types
-
template<typename T, typename = void>struct is_jsonable
-
template<typename T>struct is_jsonable<T, std::void_t<decltype(nlohmann::json(std::declval<T>()))>>
- using HookIDType = typename std::underlying_type<PhaseHook>::type
- using HookMapType = std::map<std::size_t, ActionType>
- using HookIDMapType = std::unordered_map<HookIDType, HookMapType>
Public static functions
- static auto construct() -> std::unique_ptr<PhaseManager>
- Construct a new
PhaseManager
as an objgroup.
Constructors, destructors, conversion operators
Public functions
- auto name() -> std::string override
- Get the name of the component.
- void startup() override
- Empty default overridden startup method.
- auto getCurrentPhase() const -> PhaseType
- Get the current phase.
- auto registerHookCollective(PhaseHook type, ActionType trigger) -> PhaseHookID
- Collectively register a phase hook that triggers depending on the type of hook.
- auto registerHookRooted(PhaseHook type, ActionType trigger) -> PhaseHookID
- Rooted register a phase hook that triggers depending on the type of hook.
- auto registerHookUnsynchronized(PhaseHook type, ActionType trigger) -> PhaseHookID
- Register an unsynchronized phase hook.
- void unregisterHook(PhaseHookID hook)
- Unregister an existing hook.
- void nextPhaseCollective()
- Start the next phase collectively.
- void setStartTime()
- Store start time for the current phase.
-
template<typename KeyT, typename ValueT>void addUserDefinedData(PhaseType phase, const KeyT& key, const ValueT& value)
-
void printSummary(vrt::
collection:: lb:: PhaseInfo* last_phase_info) - Print summary for the current phase.
- void runHooksManual(PhaseHook type)
- Run hooks manually.
-
template<typename SerializerT>void serialize(SerializerT& s)
Function documentation
static std::unique_ptr<PhaseManager> vt:: phase:: PhaseManager:: construct()
Construct a new PhaseManager
as an objgroup.
Returns | unique pointer to the new manager |
---|
PhaseType vt:: phase:: PhaseManager:: getCurrentPhase() const
Get the current phase.
Returns | the current phase |
---|
PhaseHookID vt:: phase:: PhaseManager:: registerHookCollective(PhaseHook type,
ActionType trigger)
Collectively register a phase hook that triggers depending on the type of hook.
Parameters | |
---|---|
type in | the type of trigger to register |
trigger in | the action to trigger |
Returns | registered ID that can be used to unregister the hook |
PhaseHookID vt:: phase:: PhaseManager:: registerHookRooted(PhaseHook type,
ActionType trigger)
Rooted register a phase hook that triggers depending on the type of hook.
Parameters | |
---|---|
type in | the type of trigger to register |
trigger in | the action to trigger |
Returns | registered ID that can be used to unregister the hook |
PhaseHookID vt:: phase:: PhaseManager:: registerHookUnsynchronized(PhaseHook type,
ActionType trigger)
Register an unsynchronized phase hook.
Parameters | |
---|---|
type in | the type of trigger to register |
trigger in | the action to trigger |
Returns | registered ID that can be used to unregister the hook |
void vt:: phase:: PhaseManager:: unregisterHook(PhaseHookID hook)
Unregister an existing hook.
Parameters | |
---|---|
hook in | the id of the hook to unregister |
void vt:: phase:: PhaseManager:: nextPhaseCollective()
Start the next phase collectively.
void vt:: phase:: PhaseManager:: printSummary(vrt:: collection:: lb:: PhaseInfo* last_phase_info)
Print summary for the current phase.
Parameters | |
---|---|
last_phase_info in | The info for the last phase execution |
void vt:: phase:: PhaseManager:: runHooksManual(PhaseHook type)
Run hooks manually.