YASK
Yet Another Stencil Kit: a software framework for creating HPC stencil code. Copyright 2014-2023 Intel Corporation.
|
Kernel environment. More...
#include <yask_kernel_api.hpp>
Public Member Functions | |
virtual int | get_num_ranks () const =0 |
Get number of MPI ranks. | |
virtual int | get_rank_index () const =0 |
Get MPI rank index. | |
virtual void | global_barrier () const =0 |
Wait until all ranks have reached this element. | |
virtual idx_t | sum_over_ranks (idx_t rank_val) const =0 |
Find sum of an idx_t value over all ranks. | |
virtual void | assert_equality_over_ranks (idx_t rank_val, const std::string &descr) const =0 |
Makes sure an idx_t values is the same over all ranks. | |
virtual void | finalize ()=0 |
Finalize the environment. | |
virtual YASK_NORETURN void | exit (int code)=0 |
Finalize the environment and exit. | |
Static Public Member Functions | |
static void | set_debug_output (yask_output_ptr debug) |
Set object to receive debug output. | |
static void | disable_debug_output () |
Disable the debug output. | |
static yask_output_ptr | get_debug_output () |
Get object to receive debug output. | |
static void | print_splash (int argc, char **argv, std::string invocation_leader="invocation: ") |
Print a YASK spash message to debug output. | |
static void | set_trace_enabled (bool enable) |
Enable or disable additional debug tracing. | |
static bool | is_trace_enabled () |
Get whether tracing is enabled. | |
Kernel environment.
Created via yk_factory::new_env().
|
static |
Set object to receive debug output.
This is a static method, implying the following:
yk_env
object.[out] | debug | Pointer to object to receive debug output. See yask_output_factory. |
|
static |
Disable the debug output.
Shortcut for calling set_debug_output()
with a yask_null_output_ptr
;
|
static |
Get object to receive debug output.
This is a static method, implying the following:
yk_env
object.
|
inlinestatic |
Print a YASK spash message to debug output.
Splash message contains the YASK copyright, URL, and version. If argc > 1
, also prints invocation_leader
followed by the program invocation string.
|
static |
Enable or disable additional debug tracing.
This is a static method, implying the following:
yk_env
object.Must also compile with general tracing and/or memory-access tracing enabled.
|
static |
Get whether tracing is enabled.
This is a static method, implying the following:
yk_env
object.
|
pure virtual |
Get number of MPI ranks.
|
pure virtual |
Get MPI rank index.
|
pure virtual |
Wait until all ranks have reached this element.
If MPI is enabled, calls MPI_Barrier()
. Otherwise, has no effect.
Find sum of an idx_t
value over all ranks.
Must be called from all ranks.
rank_val
over all ranks or simply rank_val
if MPI is not enabled.
|
pure virtual |
Makes sure an idx_t
values is the same over all ranks.
Must be called from all ranks.
yask_exception | if rank_val does not have the same value across all ranks. Exception contains message with description of the value. |
Does nothing if MPI is not enabled.
|
pure virtual |
Finalize the environment.
If MPI is enabled and YASK initialized the MPI communicator, calls MPI_Finalize()
. This function is automatically called when a yk_env object is destroyed. Cannot call global_barrier() or any MPI-dependent API after calling this.