Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
worldInfo.hpp
Go to the documentation of this file.
1// -------------------------------------------------------//
2//
3// SHAMROCK code for hydrodynamics
4// Copyright (c) 2021-2026 Timothée David--Cléris <tim.shamrock@proton.me>
5// SPDX-License-Identifier: CeCILL Free Software License Agreement v2.1
6// Shamrock is licensed under the CeCILL 2.1 License, see LICENSE for more information
7//
8// -------------------------------------------------------//
9
10#pragma once
11
21#include <string>
22
23namespace shamcomm {
24
31
38
45
51 std::string mpi_process_name();
52
59 void fetch_world_info();
60
68 bool is_mpi_initialized();
69
70} // namespace shamcomm
71
73#define ON_RANK_0(x) \
74 do { \
75 if (shamcomm::world_rank() == 0) { \
76 x; \
77 } \
78 } while (false)
std::int32_t i32
32 bit integer
namespace for communication related stuff
void fetch_world_info()
Gets the information about the MPI communicator.
Definition worldInfo.cpp:64
i32 world_rank()
Gives the rank of the current process in the MPI communicator.
Definition worldInfo.cpp:40
i32 world_size()
Gives the size of the MPI communicator.
Definition worldInfo.cpp:38
i32 mpi_max_tag_value()
Gets the maximum value of the MPI tag.
Definition worldInfo.cpp:36
bool is_mpi_initialized()
Check if MPI is initialized.
Definition worldInfo.cpp:89
std::string mpi_process_name()
Gets the name of the MPI process.
Definition worldInfo.cpp:42