Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
mpiInfo.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 <optional>
22#include <string>
23namespace shamcomm {
24
50
51 inline bool is_direct_comm_aware(const StateMPI_Aware &v) {
52 return (v == Yes || v == ForcedYes);
53 }
54
65
76
78 std::optional<StateMPI_Aware> should_force_dgpu_state();
79
87 void fetch_mpi_capabilities(std::optional<StateMPI_Aware> forced_state);
88
93
98
104 std::string get_process_name();
105
106} // namespace shamcomm
namespace for communication related stuff
void print_mpi_comm_info()
Print the MPI communicator infos.
Definition mpiInfo.cpp:142
StateMPI_Aware
Enum to describe the MPI capabilities.
Definition mpiInfo.hpp:28
@ ForcedYes
Feature forced on by the user.
Definition mpiInfo.hpp:44
@ Unknown
The MPI implementation does not if the feature is supported.
Definition mpiInfo.hpp:32
@ ForcedNo
Feature forced off by the user.
Definition mpiInfo.hpp:48
@ No
The MPI implementation does not support the feature.
Definition mpiInfo.hpp:40
@ Yes
The MPI implementation supports the feature.
Definition mpiInfo.hpp:36
std::optional< StateMPI_Aware > should_force_dgpu_state()
Should DGPU should be forced.
Definition mpiInfo.cpp:113
void fetch_mpi_capabilities(std::optional< StateMPI_Aware > forced_state)
Fetch the MPI capabilities.
Definition mpiInfo.cpp:70
StateMPI_Aware get_mpi_cuda_aware_status()
Get the MPI CUDA aware capability.
Definition mpiInfo.cpp:52
std::string get_process_name()
Get the process name.
Definition mpiInfo.cpp:147
StateMPI_Aware get_mpi_rocm_aware_status()
Get the MPI ROCM aware capability.
Definition mpiInfo.cpp:60
void print_mpi_capabilities()
Print the MPI capabilities.
Definition mpiInfo.cpp:115