16#include <Comm_Group.h>
25static int ngroups = 0;
26static int max_ngroups = 100;
27const Comm_Group * PE_Groups::current_group_ = 0;
35int PE_Groups::check_current_group()
38 assert(current_group_ == &(groups[ngroups-1].valeur()));
57 if (liste_pe.
size_array()==1 && force_Comm_Group_NoParallel)
60 group.typer(
"Comm_Group_NoParallel");
65 group.typer(groups[0]->que_suis_je());
123 if (ngroups >= max_ngroups-1)
125 Cerr <<
"Comm_Group::enter_group : fatal, too many groups" << finl;
129 if (my_rank_in_group >= 0)
132 groups[ngroups] = group;
133 current_group_ = &group;
161 Cerr <<
"Comm_Group::exit_group() error : trying to exit from TRUST main group." << finl;
165 current_group_ = &(groups[ngroups-1].valeur());
181 const int world_rank = group.world_ranks_[rank];
182 const int local_rank = dest_group.local_ranks_[world_rank];
193 return groups[0].valeur();
203 return node_group.valeur();
213 return node_master.valeur();
222 assert(user_defined_group);
223 return user_defined_group.valeur();
232 assert(ngroups == 0);
234 groups[0] = groupe_trio_u;
235 current_group_ = &groupe_trio_u;
250 assert(!user_defined_group);
251 user_defined_group = ngrp;
256 return bool(user_defined_group);
265 assert(!node_master);
274 assert(ngroups == 1);
280 user_defined_group.reset();
: This class describes a group of processors on which
static int check_enabled()
virtual void barrier(int tag) const =0
virtual void init_group(const ArrOfInt &pe_list)
This function must be called simultaneously by all PEs of the current_group with the same parameters.
static void initialize_user_defined_group(const Comm_Group &ngrp)
static int enter_group(const Comm_Group &group)
If the local processor belongs to the group, the current group for this processor becomes "group" and...
static void create_group(const ArrOfInt &liste_pe, OWN_PTR(Comm_Group) &group, int force_Comm_Group_NoParallel=0)
Creates a new processor group (can be called anywhere in the code).
static void init_group(const ArrOfInt &liste_pe, OWN_PTR(Comm_Group) &group)
Initializes a new processor group that is already instantiated (can be called anywhere in the code).
static void initialize_node_master(const Comm_Group &ngrp)
Method to call after the initialization of trio_u_world, node_group, and TRUST's statistical counters...
static const int & get_nb_groups()
static void finalize()
Method to call at the end of execution, once back in groupe_TRUST() and just before destroying the ma...
static const Comm_Group & get_node_master()
Returns the group containing the master of my node.
static void initialize(const Comm_Group &groupe_trio_u)
Method to call at the beginning of execution (MAIN.cpp). Initializes current_group() with groupe_trio...
static void initialize_node(const Comm_Group &ngrp)
Method to call after the initialization of trio_u_world and TRUST's statistical counters.
static const Comm_Group & get_user_defined_group()
Returns a reference to the user-defined group.
static const Comm_Group & get_node_group()
Returns a reference to the node-level communicator group.
static bool has_user_defined_group()
static const Comm_Group & current_group()
Returns a reference to the current active processor group.
static int rank_translate(int rank, const Comm_Group &group, const Comm_Group &dest_group=current_group())
Computes the rank in the current group of the processor with rank "rank" in "group".
static const Comm_Group & groupe_TRUST()
Returns a reference to the group containing all TRUST processors.
static void exit_group()
Returns to the group that was active before the last successful enter_group() call (which returned 1)...
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
_SIZE_ size_array() const