16#ifndef Comm_Group_MPI_included
17#define Comm_Group_MPI_included
19#include <Comm_Group_Noparallel.h>
38 Declare_instanciable_sans_constructeur_ni_destructeur(
Comm_Group_MPI);
42 void abort()
const override;
55 void barrier(
int tag)
const override;
57 const ArrOfInt& send_size,
58 const char *
const *
const send_buffers,
59 const ArrOfInt& recv_list,
60 const ArrOfInt& recv_size,
61 char *
const *
const recv_buffers,
64 void send(
int pe,
const void *buffer,
int size,
int tag)
const override;
65 void recv(
int pe,
void *buffer,
int size,
int tag)
const override;
66 void broadcast(
void *buffer,
int size,
int pe_source)
const override;
67 void all_to_all(
const void *src_buffer,
void *dest_buffer,
int data_size)
const override;
68 void all_gather(
const void *src_buffer,
void *dest_buffer,
int data_size)
const override;
69 void gather(
const void *src_buffer,
void *dest_buffer,
int data_size,
int root)
const override;
70 void all_gatherv(
const void *src_buffer,
void *dest_buffer,
int send_size,
const int* recv_size,
const int* displs)
const override;
74 void init_comm_on_numa_node();
75 void init_comm_on_node_master();
78 void all_to_allv(
const void *src_buffer,
int *send_data_size,
int *send_data_offset,
79 void *dest_buffer,
int *recv_data_size,
int *recv_data_offset)
const;
80 static void set_trio_u_world(MPI_Comm world);
81 static MPI_Comm get_trio_u_world();
82 static void set_must_mpi_initialize(
bool flag);
84 void ptop_send_recv(
const void * send_buf,
int send_buf_size,
int send_proc,
85 void * recv_buf,
int recv_buf_size,
int recv_proc)
const;
87 void set_must_finalize(
int flag) { must_finalize_=flag; }
88 MPI_Comm get_mpi_comm()
const {
return mpi_comm_; }
90 void init_group(
const ArrOfInt& pe_list)
override;
91 void internal_collective(
const int *x,
int *resu,
int nx,
const Collective_Op *op,
int nop,
int level)
const;
93 void internal_collective(
const trustIdType *x, trustIdType *resu,
int nx,
const Collective_Op *op,
int nop,
int level)
const;
95 void internal_collective(
const double *x,
double *resu,
int nx,
const Collective_Op *op,
int nop,
int level)
const;
96 void internal_collective(
const float *x,
float *resu,
int nx,
const Collective_Op *op,
int nop,
int level)
const;
101 template <
typename _TYPE_,
int TYP_IDX>
103 trustIdType mppartial_sum_impl(trustIdType x)
const;
106 static bool must_mpi_initialize_;
109 static MPI_Comm trio_u_world_;
110 static MPI_Status * mpi_status_;
111 static MPI_Request * mpi_requests_;
112 static int mpi_nrequests_;
113 static int mpi_maxrequests_;
114 static int current_msg_size_;
116 MPI_Group mpi_group_;
void recv(int pe, void *buffer, int size, int tag) const override
Blocking reception of a message.
void all_to_all(const void *src_buffer, void *dest_buffer, int data_size) const override
void all_gather(const void *src_buffer, void *dest_buffer, int data_size) const override
void abort() const override
Calls MPI_Abort and returns.
void send(int pe, const void *buffer, int size, int tag) const override
Blocking send.
void broadcast(void *buffer, int size, int pe_source) const override
void all_gatherv(const void *src_buffer, void *dest_buffer, int send_size, const int *recv_size, const int *displs) const override
~Comm_Group_MPI() override
void send_recv_finish() const override
Waits until all communications started by send_recv_start are finished.
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 override
Starts sending and receiving buffers.
Comm_Group_MPI()
Default constructor.
void gather(const void *src_buffer, void *dest_buffer, int data_size, int root) const override
void mp_collective_op(const double *x, double *resu, int n, Collective_Op op) const override
: This class describes a group of processors on which
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.
void init_group_trio(int nproc, int rank)
Initializes groupe_TRUST().
static void barrier()
Synchronizes all processors in the current group (waits until all processors have reached the barrier...