39#ifndef PFC_MPI_WORKER_HPP
40#define PFC_MPI_WORKER_HPP
88 std::cout <<
"MPI_Init(): initialized " << m_num_procs <<
" processes"
130 void mute() { std::cout.setstate(std::ios::failbit); }
An MPI worker class that wraps MPI_Init and MPI_Finalize.
Definition worker.hpp:55
~MPI_Worker()
Destroys the MPI worker instance and finalizes MPI if it owns it.
Definition worker.hpp:100
void unmute()
Unmutes the standard output.
Definition worker.hpp:138
void mute()
Mutes the standard output.
Definition worker.hpp:130
int get_num_ranks() const
Returns the number of processes in the MPI communicator.
Definition worker.hpp:122
MPI_Worker(int argc, char *argv[], MPI_Comm comm=MPI_COMM_WORLD, bool verbose=true)
Constructs an MPI worker instance and initializes MPI if needed.
Definition worker.hpp:74
int get_rank() const
Returns the rank of this worker process in the MPI communicator.
Definition worker.hpp:115
Represents the global simulation domain (the "world").
Definition world.hpp:91