16#ifndef Comm_Group_included
17#define Comm_Group_included
19#include <TRUST_Deriv.h>
20#include <TRUSTArray.h>
38 Declare_base_sans_constructeur_ni_destructeur(
Comm_Group);
67 inline int rank()
const;
68 inline int nproc()
const;
90 const ArrOfInt& send_size,
91 const char *
const *
const send_buffers,
92 const ArrOfInt& recv_list,
93 const ArrOfInt& recv_size,
94 char *
const *
const recv_buffers,
101 virtual void send(
int pe,
const void *buffer,
int size,
int tag)
const = 0;
102 virtual void recv(
int pe,
void *buffer,
int size,
int tag)
const = 0;
105 virtual void broadcast(
void *buffer,
int size,
int pe_source)
const = 0;
108 virtual void all_to_all(
const void *src_buffer,
void *dest_buffer,
int data_size)
const = 0;
109 virtual void all_gather(
const void *src_buffer,
void *dest_buffer,
int data_size)
const = 0;
110 virtual void gather(
const void *src_buffer,
void *dest_buffer,
int data_size,
int root)
const = 0;
111 virtual void all_gatherv(
const void *src_buffer,
void *dest_buffer,
int send_size,
const int* recv_size,
const int* displs)
const = 0;
117 virtual void init_group(
const ArrOfInt& pe_list);
129 static int check_enabled_;
130 static int static_group_number_;
139 ArrOfInt local_ranks_;
142 ArrOfInt world_ranks_;
145 int group_number_ = -1;
149 int group_tag_increment_ = -1;
151 mutable int group_communication_tag_ = -1;
156 return check_enabled_;
169 return group_communication_tag_;
static int check_enabled()
virtual void mp_collective_op(const double *x, double *resu, const Collective_Op *op, int n) const =0
virtual void all_gather(const void *src_buffer, void *dest_buffer, int data_size) const =0
static void set_check_enabled(int flag)
virtual void send(int pe, const void *buffer, int size, int tag) const =0
int get_node_id() const
Retrieve ID of my numa node.
virtual void send_recv_finish() const =0
int nproc() const
Returns the number of processors in the group *this.
virtual void mp_collective_op(const int *x, int *resu, const Collective_Op *op, int n) const =0
virtual void send_recv_start(const ArrOfInt &send_list, const ArrOfInt &send_size, const char *const *const send_buffers, const ArrOfInt &recv_list, const ArrOfInt &recv_size, char *const *const recv_buffers, TypeHint typehint=CHAR) const =0
int rank() const
Returns the rank of the local processor in the group *this.
virtual void all_gatherv(const void *src_buffer, void *dest_buffer, int send_size, const int *recv_size, const int *displs) const =0
const Comm_Group & operator=(const Comm_Group &)
Assignment is forbidden!
virtual void broadcast(void *buffer, int size, int pe_source) const =0
virtual void abort() const =0
virtual void mp_collective_op(const float *x, float *resu, const Collective_Op *op, int n) const =0
virtual void mp_collective_op(const float *x, float *resu, int n, Collective_Op op) const =0
virtual void mp_collective_op(const double *x, double *resu, int n, Collective_Op op) const =0
virtual void all_to_all(const void *src_buffer, void *dest_buffer, int data_size) const =0
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)
This function must be called simultaneously by all PEs of the current_group with the same parameters.
virtual void mp_collective_op(const int *x, int *resu, int n, Collective_Op op) const =0
virtual void recv(int pe, void *buffer, int size, int tag) const =0
int get_number_of_nodes() const
virtual void gather(const void *src_buffer, void *dest_buffer, int data_size, int root) const =0
~Comm_Group() override
Destructor (nothing to do for now).
void init_group_trio(int nproc, int rank)
Initializes groupe_TRUST().
int get_new_tag() const
Returns a new communication tag for the group.
Objet_U()
Default constructor: assigns a unique identifier to the object (object_id_) and registers the object ...