#include <cs_execution_context.h>
Public Member Functions | |
cs_execution_context () | |
Constructor. More... | |
virtual | ~cs_execution_context () |
Destructor. More... | |
int | rank () const |
Getter function for MPI communicator rank id. More... | |
int | n_ranks () const |
Getter function for MPI communicator number of ranks. More... | |
bool | use_mpi () const |
Does the execution context uses MPI parallelism ? More... | |
bool | is_mpi_root () const |
Is the current cpu/task the MPI root (rank 0) ? More... | |
int | thread_id () const |
Getter function for thread id. More... | |
void | comm_free () |
Free the MPI communicator. More... | |
int | barrier () |
Call MPI_Barrier over the MPI communicator, do nothing if no MPI. More... | |
void | set_comm (MPI_Comm comm) |
Set the execution context MPI communicator. More... | |
MPI_Comm | comm () const |
Getter function for MPI communicator. More... | |
Class used to define execution context for different methods and algorithms.
It handles both the distributed memory context (i.e. MPI communicator), and shared memory context (i.e. OpenMP thread, Cuda stream, SYCL queue).
|
inline |
Constructor.
|
inlinevirtual |
Destructor.
|
inline |
Call MPI_Barrier over the MPI communicator, do nothing if no MPI.
|
inline |
Getter function for MPI communicator.
|
inline |
Free the MPI communicator.
|
inline |
Is the current cpu/task the MPI root (rank 0) ?
|
inline |
Getter function for MPI communicator number of ranks.
|
inline |
Getter function for MPI communicator rank id.
|
inline |
Set the execution context MPI communicator.
[in] | comm | MPI communicator to set |
|
inline |
Getter function for thread id.
|
inline |
Does the execution context uses MPI parallelism ?