Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
Namespaces | Macros | Functions
worldInfo.hpp File Reference

Functions related to the MPI communicator. More...

#include "shambase/aliases_int.hpp"
#include <string>
+ Include dependency graph for worldInfo.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  shamcomm
 namespace for communication related stuff
 

Macros

#define ON_RANK_0(x)
 Macro to execute code only on rank 0.
 

Functions

i32 shamcomm::world_rank ()
 Gives the rank of the current process in the MPI communicator.
 
i32 shamcomm::world_size ()
 Gives the size of the MPI communicator.
 
i32 shamcomm::mpi_max_tag_value ()
 Gets the maximum value of the MPI tag.
 
std::string shamcomm::mpi_process_name ()
 Gets the name of the MPI process.
 
void shamcomm::fetch_world_info ()
 Gets the information about the MPI communicator.
 
bool shamcomm::is_mpi_initialized ()
 Check if MPI is initialized.
 

Detailed Description

Functions related to the MPI communicator.

Author
Timothée David–Cléris (tim.s.nosp@m.hamr.nosp@m.ock@p.nosp@m.roto.nosp@m.n.me)

This header provides functions to get information about the MPI communicator.

Definition in file worldInfo.hpp.

Macro Definition Documentation

◆ ON_RANK_0

#define ON_RANK_0 (   x)
Value:
do { \
if (shamcomm::world_rank() == 0) { \
x; \
} \
} while (false)
i32 world_rank()
Gives the rank of the current process in the MPI communicator.
Definition worldInfo.cpp:40

Macro to execute code only on rank 0.

Definition at line 73 of file worldInfo.hpp.