Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
env_variables.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
20#include "shamcmdopt/env.hpp"
21#include <cstdlib>
22
23namespace shamcomm {
24 // rank related env variable
25 const std::optional<std::string> MV2_COMM_WORLD_LOCAL_RANK
26 = shamcmdopt::getenv_str("MV2_COMM_WORLD_LOCAL_RANK");
27 const std::optional<std::string> OMPI_COMM_WORLD_LOCAL_RANK
28 = shamcmdopt::getenv_str("OMPI_COMM_WORLD_LOCAL_RANK");
29 const std::optional<std::string> MPI_LOCALRANKID = shamcmdopt::getenv_str("MPI_LOCALRANKID");
30 const std::optional<std::string> SLURM_PROCID = shamcmdopt::getenv_str("SLURM_PROCID");
31 const std::optional<std::string> LOCAL_RANK = shamcmdopt::getenv_str("LOCAL_RANK");
32 const std::optional<std::string> PALS_LOCAL_RANKID
33 = shamcmdopt::getenv_str("PALS_LOCAL_RANKID");
34
35 const std::optional<std::string> PSM2_CUDA = shamcmdopt::getenv_str("PSM2_CUDA");
36} // namespace shamcomm
std::optional< std::string > getenv_str(const char *env_var)
Get the content of the environment variable if it exist.
Definition env.cpp:24
namespace for communication related stuff