57 MPI_Comm comm,
MpiLock* mpi_lock,
73 void broadcast(
void* buf,
Int64 nb_elem,
Int32 root,MPI_Datatype datatype);
74 void allGather(
const void* send_buf,
void* recv_buf,
75 Int64 nb_elem,MPI_Datatype datatype);
76 void gather(
const void* send_buf,
void* recv_buf,
77 Int64 nb_elem,
Int32 root,MPI_Datatype datatype);
78 void allGatherVariable(
const void* send_buf,
void* recv_buf,
const int* recv_counts,
79 const int* recv_indexes,
Int64 nb_elem,MPI_Datatype datatype);
80 void gatherVariable(
const void* send_buf,
void* recv_buf,
const int* recv_counts,
81 const int* recv_indexes,
Int64 nb_elem,
Int32 root,MPI_Datatype datatype);
82 void scatterVariable(
const void* send_buf,
const int* send_count,
const int* send_indexes,
83 void* recv_buf,
Int64 nb_elem,
Int32 root,MPI_Datatype datatype);
84 void allToAll(
const void* send_buf,
void* recv_buf,
Int32 count,MPI_Datatype datatype);
85 void allToAllVariable(
const void* send_buf,
const int* send_counts,
86 const int* send_indexes,
void* recv_buf,
const int* recv_counts,
87 const int* recv_indexes,MPI_Datatype datatype);
88 void reduce(
const void* send_buf,
void* recv_buf,
Int64 count,MPI_Datatype datatype,MPI_Op op,
Int32 root);
89 void allReduce(
const void* send_buf,
void* recv_buf,
Int64 count,MPI_Datatype datatype,MPI_Op op);
90 void scan(
const void* send_buf,
void* recv_buf,
Int64 count,MPI_Datatype datatype,MPI_Op op);
91 void directSendRecv(
const void* send_buffer,
Int64 send_buffer_size,
92 void* recv_buffer,
Int64 recv_buffer_size,
93 Int32 proc,
Int64 elem_size,MPI_Datatype data_type);
95 Request directSend(
const void* send_buffer,
Int64 send_buffer_size,
96 Int32 proc,
Int64 elem_size,MPI_Datatype data_type,
97 int mpi_tag,
bool is_blocked);
100 Request sendNonBlockingNoStat(
const void* send_buffer,
Int64 send_buffer_size,
101 Int32 proc,MPI_Datatype data_type,
int mpi_tag);
103 Request directRecv(
void* recv_buffer,
Int64 recv_buffer_size,
104 Int32 source_rank,
Int64 elem_size,MPI_Datatype data_type,
105 int mpi_tag,
bool is_blocked);
108 Request receiveNonBlockingNoStat(
void* recv_buffer,
Int64 recv_buffer_size,
109 Int32 source_rank,MPI_Datatype data_type,
int mpi_tag);
111 Request directSendPack(
const void* send_buffer,
Int64 send_buffer_size,
112 Int32 proc,
int mpi_tag,
bool is_blocked);
120 Request directRecv(
void* recv_buffer,
Int64 recv_buffer_size,
124 Request directRecvPack(
void* recv_buffer,
Int64 recv_buffer_size,
125 Int32 proc,
int mpi_tag,
bool is_blocking);
136 bool is_non_blocking);
150 void freeRequest(
Request& request);
151 bool testRequest(
Request& request);
153 void enableDebugRequest(
bool enable_debug_request);
155 MpiLock* mpiLock()
const {
return m_mpi_lock; }
157 Request nonBlockingBroadcast(
void* buf,
Int64 nb_elem,
Int32 root,MPI_Datatype datatype);
158 Request nonBlockingAllGather(
const void* send_buf,
void* recv_buf,
Int64 nb_elem,MPI_Datatype datatype);
159 Request nonBlockingGather(
const void* send_buf,
void* recv_buf,
Int64 nb_elem,
Int32 root,MPI_Datatype datatype);
161 Request nonBlockingAllToAll(
const void* send_buf,
void* recv_buf,
Int32 count,MPI_Datatype datatype);
162 Request nonBlockingAllReduce(
const void* send_buf,
void* recv_buf,
Int64 count,MPI_Datatype datatype,MPI_Op op);
163 Request nonBlockingAllToAllVariable(
const void* send_buf,
const int* send_counts,
164 const int* send_indexes,
void* recv_buf,
const int* recv_counts,
165 const int* recv_indexes,MPI_Datatype datatype);
170 int toMPISize(
Int64 count);
173 Request buildRequest(
int ret,MPI_Request request);
178 void setRequestErrorAreFatal(
bool v);
179 bool isRequestErrorAreFatal()
const;
182 void setPrintRequestError(
bool v);
183 bool isPrintRequestError()
const;
187 bool isTraceMPIMessage()
const {
return m_is_trace; }
194 void setCheckRequest(
bool v);
195 bool isCheckRequest()
const;
199 void setMpiProfiling(IMpiProfiling* mpi_profiling);
201 IMpiProfiling* getMpiProfiling()
const;
209 bool isAllowNullRankForAnySource()
const {
return m_is_allow_null_rank_for_any_source; }
215 IMpiProfiling* m_mpi_prof;
216 ITimeMetricCollector* m_metric_collector =
nullptr;
217 MPI_Comm m_communicator;
218 int m_comm_rank = A_PROC_NULL_RANK;
220 Int64 m_nb_all_reduce = 0;
221 Int64 m_nb_reduce = 0;
222 bool m_is_trace =
false;
223 RequestSet* m_request_set =
nullptr;
225 MPI_Request m_empty_request1;
226 MPI_Request m_empty_request2;
227 int m_recv_buffer_for_empty_request[1];
228 int m_send_buffer_for_empty_request2[1];
229 int m_recv_buffer_for_empty_request2[1];
236 bool m_is_allow_null_rank_for_any_source =
true;
240 void _trace(
const char* function);
241 void _addRequest(MPI_Request request);
242 void _removeRequest(MPI_Request request);
243 void _checkFatalInRequest();
244 MessageId _probeMessage(MessageRank source,MessageTag tag,
bool is_blocking);
245 MessageSourceInfo _legacyProbeMessage(MessageRank source,MessageTag tag,
bool is_blocking);
246 bool _handleEndRequests(ArrayView<Request> requests,ArrayView<bool> done_indexes,
247 ArrayView<MPI_Status> status);
248 void _checkHasNoRequests();
249 MessageSourceInfo _buildSourceInfoFromStatus(
const MPI_Status& status);