16#include <communications.h>
17#include <Comm_Group.h>
23int Comm_Group::check_enabled_ = 0;
24int Comm_Group::static_group_number_ = 0;
40 static const int group_increment = 32;
45 group_number_ = static_group_number_;
46 group_tag_increment_ = group_increment;
47 static_group_number_++;
48 group_communication_tag_ = group_number_ % group_increment;
56 Cerr <<
"Comm_Group::Comm_Group(const Comm_Group &) error" << finl;
94 Cerr <<
"Comm_Group::set_group_properties : empty process list" << finl;
99 local_ranks_.resize_array(groupe_trio.
nproc());
101 world_ranks_.resize_array(nproc_);
103 for (
int i = 0; i < nproc_; i++)
107 const bool in_group = std::find(pe_list.
begin(), pe_list.
end(),
me) != pe_list.
end();
113 for(
int j=1; j < nproc_; j++)
120 if (rcv != pe_list[i])
122 Cerr <<
"Comm_Group::init_group : processes have different pe_lists" << finl;
127 if (pe < 0 || pe >= current.nproc_)
129 Cerr <<
"Comm_Group::set_group_properties : process "
130 << pe <<
" is not in current_group()" << finl;
134 const int world_rank = current.world_ranks_[pe];
136 if (local_ranks_[world_rank] >= 0)
138 Cerr <<
"Comm_Group::set_group_properties : duplicate pe in pe_list" << finl;
142 world_ranks_[i] = world_rank;
143 local_ranks_[world_rank] = i;
144 if (pe == current.rank_)
156 assert(arank >= 0 && arank < nproc_tot);
159 local_ranks_.resize_array(nproc_);
160 world_ranks_.resize_array(nproc_);
161 for (
int i = 0; i < nproc_; i++)
179 local_ranks_.resize_array(groupe_trio.
nproc());
181 groupe_trio.
all_gather(&loc_rank, local_ranks_.addr(), (
int)
sizeof(
int));
183 world_ranks_.resize_array(nproc_);
184 world_ranks_ = glob_rank;
186 all_gather(&glob_rank, world_ranks_.data(), (
int)
sizeof(
int));
: Cette classe decrit un groupe de processeurs sur lesquels
static int check_enabled()
virtual void all_gather(const void *src_buffer, void *dest_buffer, int data_size) const =0
static void set_check_enabled(int flag)
int nproc() const
Renvoie le nombre de processeurs dans le groupe *this.
const Comm_Group & operator=(const Comm_Group &)
La copie est interdite !
virtual void barrier(int tag) const =0
void init_group_node(int nproc, int loc_rank, int glob_rank)
Initialize all the information relative to world sizes and ranks for node communicator.
virtual void init_group(const ArrOfInt &pe_list)
Cette fonction doit etre appelee simultanement par tous les PEs du groupe current_group avec les meme...
~Comm_Group() override
Destructeur (pour l'instant, rien a faire).
void init_group_trio(int nproc, int rank)
Initialise le groupe_TRUST().
Class defining operators and methods for all reading operation in an input flow (file,...
classe Objet_U Cette classe est la classe de base des Objets de TRUST
virtual Entree & readOn(Entree &)
Lecture d'un Objet_U sur un flot d'entree Methode a surcharger.
Objet_U()
Constructeur par defaut : attribue un numero d'identifiant unique a l'objet (object_id_),...
virtual Sortie & printOn(Sortie &) const
Ecriture de l'objet sur un flot de sortie Methode a surcharger.
static const Comm_Group & current_group()
renvoie une reference au groupe de processeurs actif courant
static const Comm_Group & groupe_TRUST()
Renvoie une reference au groupe de tous les processeurs TRUST.
static int me()
renvoie mon rang dans le groupe de communication courant.
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Classe de base des flux de sortie.
_SIZE_ size_array() const