22 std::optional<u32> node_local_rank() {
24 if (MV2_COMM_WORLD_LOCAL_RANK) {
25 return std::atoi(MV2_COMM_WORLD_LOCAL_RANK->c_str());
28 if (OMPI_COMM_WORLD_LOCAL_RANK) {
29 return std::atoi(OMPI_COMM_WORLD_LOCAL_RANK->c_str());
32 if (MPI_LOCALRANKID) {
33 return std::atoi(MPI_LOCALRANKID->c_str());
37 return std::atoi(SLURM_PROCID->c_str());
41 return std::atoi(LOCAL_RANK->c_str());
44 if (PALS_LOCAL_RANKID) {
45 return std::atoi(PALS_LOCAL_RANKID->c_str());
51 bool is_main_node_rank(
u32 main_local_rank_id) {
52 auto loc_r = node_local_rank();
53 return (loc_r) ? *loc_r == main_local_rank_id :
true;
std::uint32_t u32
32 bit unsigned integer
namespace for communication related stuff