Arcane  4.2.3.0
Developer documentation
Loading...
Searching...
No Matches
Otf2MpiProfiling.cc
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* Otf2MpiProfiling.cc (C) 2000-2026 */
9/* */
10/* Implementation of the IMpiProfiling interface allowing instrumentation */
11/* in OTF2 format . */
12/*---------------------------------------------------------------------------*/
13/*---------------------------------------------------------------------------*/
14
15#include "arccore/message_passing_mpi/internal/MessagePassingMpiEnum.h"
16#include "arcane/utils/FatalErrorException.h"
17#include "arcane/std/internal/Otf2MpiProfiling.h"
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane
23{
24using namespace MessagePassing::Mpi;
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
29// Helper for the MPI type size function...
30namespace
31{
32 using ReturnType = Otf2MpiProfiling::ReturnType;
33
34 uint64_t
35 getSizeOfMpiType(MPI_Datatype datatype)
36 {
37 int tmp_size(0);
38 MPI_Type_size(datatype, &tmp_size);
39 return static_cast<uint64_t>(tmp_size);
40 }
41
42} // namespace
43
44/*---------------------------------------------------------------------------*/
45/*---------------------------------------------------------------------------*/
46
48// Note: We do not pass the IMpiProfiling to be decorated; we call MPI directly
49// to avoid another unnecessary call. But we can easily change this if necessary
50// by adding an IMpiProfiling to the ctor parameters.
53: m_otf2_wrapper(otf2_wrapper)
54{
55}
56
57/*---------------------------------------------------------------------------*/
58/*---------------------------------------------------------------------------*/
59
62broadcast(void* buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm)
63{
64 // calculation of the sizes of the exchanged data
65 const uint64_t byte_send(m_otf2_wrapper->getMpiRank() == root ? getSizeOfMpiType(datatype) * count : 0);
66 const uint64_t byte_recv(m_otf2_wrapper->getMpiRank() == root ? 0 : getSizeOfMpiType(datatype) * count);
67
68 _doEventEnter(eMpiName::Bcast);
69
70 OTF2_EvtWriter_MpiCollectiveBegin(m_otf2_wrapper->getEventWriter(), NULL, Otf2LibWrapper::getTime());
71
72 int r = MPI_Bcast(buffer, count, datatype, root, comm);
73
74 OTF2_EvtWriter_MpiCollectiveEnd(m_otf2_wrapper->getEventWriter(), NULL, Otf2LibWrapper::getTime(),
75 OTF2_COLLECTIVE_OP_BCAST, 0 /* comm region */, root,
76 byte_send /* bytes provided */, byte_recv /* bytes obtained */);
77
78 _doEventLeave(eMpiName::Bcast);
79 return _ret(r);
80}
81
82/*---------------------------------------------------------------------------*/
83/*---------------------------------------------------------------------------*/
84
87gather(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
88 int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm)
89{
90 // calculation of the sizes of the exchanged data
91 const uint64_t byte_send(getSizeOfMpiType(sendtype) * sendcount);
92 const uint64_t byte_recv(m_otf2_wrapper->getMpiRank() == root ? getSizeOfMpiType(recvtype) * recvcount : 0);
93
94 _doEventEnter(eMpiName::Gather);
95
96 OTF2_EvtWriter_MpiCollectiveBegin(m_otf2_wrapper->getEventWriter(), NULL, Otf2LibWrapper::getTime());
97
98 int r = MPI_Gather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm);
99
100 OTF2_EvtWriter_MpiCollectiveEnd(m_otf2_wrapper->getEventWriter(), NULL, Otf2LibWrapper::getTime(),
101 OTF2_COLLECTIVE_OP_GATHER, 0 /* comm region */, root,
102 byte_send /* bytes provided */, byte_recv /* bytes obtained */);
103
104 _doEventLeave(eMpiName::Gather);
105 return _ret(r);
106}
107
108/*---------------------------------------------------------------------------*/
109/*---------------------------------------------------------------------------*/
110
113gatherVariable(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
114 const int* recvcounts, const int* displs, MPI_Datatype recvtype, int root, MPI_Comm comm)
115{
116 // calculation of the sizes of the exchanged data
117 const uint64_t byte_send(getSizeOfMpiType(sendtype) * sendcount);
118 uint64_t byte_recv(0);
119
120 auto f_byte_recv = [&]() {for(int i(0); i < m_otf2_wrapper->getMpiNbRank(); ++i)
121 byte_recv += recvcounts[i] * getSizeOfMpiType(recvtype); };
122 if (m_otf2_wrapper->getMpiRank() == root)
123 f_byte_recv();
124
125 _doEventEnter(eMpiName::Gatherv);
126
127 OTF2_EvtWriter_MpiCollectiveBegin(m_otf2_wrapper->getEventWriter(), NULL, Otf2LibWrapper::getTime());
128
129 int r = MPI_Gatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, comm);
130
131 OTF2_EvtWriter_MpiCollectiveEnd(m_otf2_wrapper->getEventWriter(), NULL, Otf2LibWrapper::getTime(),
132 OTF2_COLLECTIVE_OP_GATHERV, 0 /* comm region */, root,
133 byte_send /* bytes provided */, byte_recv /* bytes obtained */);
134
135 _doEventLeave(eMpiName::Gatherv);
136 return _ret(r);
137}
138
139/*---------------------------------------------------------------------------*/
140/*---------------------------------------------------------------------------*/
141
144allGather(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
145 int recvcount, MPI_Datatype recvtype, MPI_Comm comm)
146{
147 // calculation of the sizes of the exchanged data
148 const uint64_t byte_send(getSizeOfMpiType(sendtype) * sendcount);
149 const uint64_t byte_recv(getSizeOfMpiType(recvtype) * recvcount * m_otf2_wrapper->getMpiNbRank());
150
151 _doEventEnter(eMpiName::Allgather);
152
153 OTF2_EvtWriter_MpiCollectiveBegin(m_otf2_wrapper->getEventWriter(), NULL, Otf2LibWrapper::getTime());
154
155 int r = MPI_Allgather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm);
156
157 OTF2_EvtWriter_MpiCollectiveEnd(m_otf2_wrapper->getEventWriter(), NULL, Otf2LibWrapper::getTime(),
158 OTF2_COLLECTIVE_OP_ALLGATHER, 0 /* comm region */, OTF2_UNDEFINED_UINT32 /* root */,
159 byte_send /* bytes provided */, byte_recv /* bytes obtained */);
160
161 _doEventLeave(eMpiName::Allgather);
162 return _ret(r);
163}
164
165/*---------------------------------------------------------------------------*/
166/*---------------------------------------------------------------------------*/
167
170allGatherVariable(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
171 const int* recvcounts, const int* displs, MPI_Datatype recvtype, MPI_Comm comm)
172{
173 // calculation of the sizes of the exchanged data
174 const uint64_t byte_send(getSizeOfMpiType(sendtype) * sendcount);
175 uint64_t byte_recv(0);
176
177 for (int i(0); i < m_otf2_wrapper->getMpiNbRank(); ++i)
178 byte_recv += recvcounts[i] * getSizeOfMpiType(recvtype);
179
180 _doEventEnter(eMpiName::Allgatherv);
181
182 OTF2_EvtWriter_MpiCollectiveBegin(m_otf2_wrapper->getEventWriter(), NULL, Otf2LibWrapper::getTime());
183
184 int r = MPI_Allgatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm);
185
186 OTF2_EvtWriter_MpiCollectiveEnd(m_otf2_wrapper->getEventWriter(), NULL, Otf2LibWrapper::getTime(),
187 OTF2_COLLECTIVE_OP_ALLGATHERV, 0 /* comm region */, OTF2_UNDEFINED_UINT32 /* root */,
188 byte_send /* bytes provided */, byte_recv /* bytes obtained */);
189
190 _doEventLeave(eMpiName::Allgatherv);
191 return _ret(r);
192}
193
194/*---------------------------------------------------------------------------*/
195/*---------------------------------------------------------------------------*/
196
199scatterVariable(const void* sendbuf, const int* sendcounts, const int* displs,
200 MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype,
201 int root, MPI_Comm comm)
202{
203 // calculation of the sizes of the exchanged data
204 const uint64_t byte_recv(getSizeOfMpiType(recvtype) * recvcount);
205 uint64_t byte_send(0);
206
207 auto f_byte_send = [&]() {for(int i(0); i < m_otf2_wrapper->getMpiNbRank(); ++i)
208 byte_send += sendcounts[i];
209 byte_send *= getSizeOfMpiType(recvtype); };
210 if (m_otf2_wrapper->getMpiRank() == root)
211 f_byte_send();
212
213 _doEventEnter(eMpiName::Scatterv);
214
215 OTF2_EvtWriter_MpiCollectiveBegin(m_otf2_wrapper->getEventWriter(), NULL, Otf2LibWrapper::getTime());
216
217 int r = MPI_Scatterv(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm);
218
219 OTF2_EvtWriter_MpiCollectiveEnd(m_otf2_wrapper->getEventWriter(), NULL, Otf2LibWrapper::getTime(),
220 OTF2_COLLECTIVE_OP_SCATTERV, 0 /* comm region */, root,
221 byte_send /* bytes provided */, byte_recv /* bytes obtained */);
222
223 _doEventLeave(eMpiName::Scatterv);
224 return _ret(r);
225}
226
227/*---------------------------------------------------------------------------*/
228/*---------------------------------------------------------------------------*/
229
232allToAll(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
233 int recvcount, MPI_Datatype recvtype, MPI_Comm comm)
234{
235 _doEventEnter(eMpiName::Alltoall);
236
237 OTF2_EvtWriter_MpiCollectiveBegin(m_otf2_wrapper->getEventWriter(), NULL, Otf2LibWrapper::getTime());
238
239 int r = MPI_Alltoall(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm);
240
241 OTF2_EvtWriter_MpiCollectiveEnd(m_otf2_wrapper->getEventWriter(), NULL, Otf2LibWrapper::getTime(),
242 OTF2_COLLECTIVE_OP_ALLTOALL, 0 /* comm region */, OTF2_UNDEFINED_UINT32 /* root */,
243 0 /* bytes provided */, 0 /* bytes obtained */);
244
245 _doEventLeave(eMpiName::Alltoall);
246 return _ret(r);
247}
248
249/*---------------------------------------------------------------------------*/
250/*---------------------------------------------------------------------------*/
251
254allToAllVariable(const void* sendbuf, const int* sendcounts, const int* sdispls,
255 MPI_Datatype sendtype, void* recvbuf, const int* recvcounts,
256 const int* rdispls, MPI_Datatype recvtype, MPI_Comm comm)
257{
258 _doEventEnter(eMpiName::Alltoallv);
259
260 OTF2_EvtWriter_MpiCollectiveBegin(m_otf2_wrapper->getEventWriter(), NULL, Otf2LibWrapper::getTime());
261
262 int r = MPI_Alltoallv(sendbuf, sendcounts, sdispls, sendtype, recvbuf, recvcounts, rdispls, recvtype, comm);
263
264 OTF2_EvtWriter_MpiCollectiveEnd(m_otf2_wrapper->getEventWriter(), NULL, Otf2LibWrapper::getTime(),
265 OTF2_COLLECTIVE_OP_ALLTOALLV, 0 /* comm region */, OTF2_UNDEFINED_UINT32 /* root */,
266 0 /* bytes provided */, 0 /* bytes obtained */);
267
268 _doEventLeave(eMpiName::Alltoallv);
269 return _ret(r);
270}
271
272/*---------------------------------------------------------------------------*/
273/*---------------------------------------------------------------------------*/
274
277barrier(MPI_Comm comm)
278{
279 _doEventEnter(eMpiName::Barrier);
280
281 OTF2_EvtWriter_MpiCollectiveBegin(m_otf2_wrapper->getEventWriter(), NULL, Otf2LibWrapper::getTime());
282
283 int r = MPI_Barrier(comm);
284
285 OTF2_EvtWriter_MpiCollectiveEnd(m_otf2_wrapper->getEventWriter(), NULL, Otf2LibWrapper::getTime(),
286 OTF2_COLLECTIVE_OP_BARRIER, 0 /* comm region */, OTF2_UNDEFINED_UINT32 /* root */,
287 0 /* bytes provided */, 0 /* bytes obtained */);
288
289 _doEventLeave(eMpiName::Barrier);
290 return _ret(r);
291}
292
293/*---------------------------------------------------------------------------*/
294/*---------------------------------------------------------------------------*/
295
298reduce(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype,
299 MPI_Op op, int root, MPI_Comm comm)
300{
301 _doEventEnter(eMpiName::Reduce);
302
303 OTF2_EvtWriter_MpiCollectiveBegin(m_otf2_wrapper->getEventWriter(), NULL, Otf2LibWrapper::getTime());
304
305 int r = MPI_Reduce(sendbuf, recvbuf, count, datatype, op, root, comm);
306
307 OTF2_EvtWriter_MpiCollectiveEnd(m_otf2_wrapper->getEventWriter(), NULL, Otf2LibWrapper::getTime(),
308 OTF2_COLLECTIVE_OP_REDUCE, 0 /* comm region */, root,
309 0 /* bytes provided */, 0 /* bytes obtained */);
310
311 _doEventLeave(eMpiName::Reduce);
312 return _ret(r);
313}
314
315/*---------------------------------------------------------------------------*/
316/*---------------------------------------------------------------------------*/
317
320allReduce(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
321{
322 // calculation of the sizes of the exchanged data
323 const uint64_t byte_send(getSizeOfMpiType(datatype) * count);
324 const uint64_t byte_recv(getSizeOfMpiType(datatype) * count);
325
326 _doEventEnter(eMpiName::Allreduce);
327
328 OTF2_EvtWriter_MpiCollectiveBegin(m_otf2_wrapper->getEventWriter(), NULL, Otf2LibWrapper::getTime());
329
330 int r = MPI_Allreduce(sendbuf, recvbuf, count, datatype, op, comm);
331
332 OTF2_EvtWriter_MpiCollectiveEnd(m_otf2_wrapper->getEventWriter(), NULL, Otf2LibWrapper::getTime(),
333 OTF2_COLLECTIVE_OP_ALLREDUCE, 0 /* comm region */, OTF2_UNDEFINED_UINT32 /* root */,
334 byte_send /* bytes provided */, byte_recv /* bytes obtained */);
335
336 _doEventLeave(eMpiName::Allreduce);
337 return _ret(r);
338}
339
340/*---------------------------------------------------------------------------*/
341/*---------------------------------------------------------------------------*/
342
345scan(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
346{
347 _doEventEnter(eMpiName::Scan);
348
349 OTF2_EvtWriter_MpiCollectiveBegin(m_otf2_wrapper->getEventWriter(), NULL, Otf2LibWrapper::getTime());
350
351 int r = MPI_Scan(sendbuf, recvbuf, count, datatype, op, comm);
352
353 int type_size;
354 MPI_Type_size(datatype, &type_size);
355 const uint64_t size = static_cast<uint64_t>(type_size) * static_cast<uint64_t>(count);
356 OTF2_EvtWriter_MpiCollectiveEnd(m_otf2_wrapper->getEventWriter(), NULL, Otf2LibWrapper::getTime(),
357 OTF2_COLLECTIVE_OP_SCAN, 0 /* comm region */, OTF2_UNDEFINED_UINT32 /* root */,
358 size /* bytes provided */, size /* bytes obtained */);
359
360 _doEventLeave(eMpiName::Scan);
361 return _ret(r);
362}
363
366scanExclusive(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
367{
368 _doEventEnter(eMpiName::Scan);
369
370 OTF2_EvtWriter_MpiCollectiveBegin(m_otf2_wrapper->getEventWriter(), NULL, Otf2LibWrapper::getTime());
371
372 int r = MPI_Exscan(sendbuf, recvbuf, count, datatype, op, comm);
373
374 int type_size;
375 MPI_Type_size(datatype, &type_size);
376 const uint64_t size = static_cast<uint64_t>(type_size) * static_cast<uint64_t>(count);
377 OTF2_EvtWriter_MpiCollectiveEnd(m_otf2_wrapper->getEventWriter(), NULL, Otf2LibWrapper::getTime(),
378 OTF2_COLLECTIVE_OP_EXSCAN, 0 /* comm region */, OTF2_UNDEFINED_UINT32 /* root */,
379 size /* bytes provided */, size /* bytes obtained */);
380
381 _doEventLeave(eMpiName::Scan);
382 return _ret(r);
383}
384
385/*---------------------------------------------------------------------------*/
386/*---------------------------------------------------------------------------*/
387
390sendRecv(const void* sendbuf, int sendcount, MPI_Datatype sendtype, int dest,
391 int sendtag, void* recvbuf, int recvcount, MPI_Datatype recvtype,
392 int source, int recvtag, MPI_Comm comm, MPI_Status* status)
393{
394 _doEventEnter(eMpiName::Sendrecv);
395
396 int r = MPI_Sendrecv(sendbuf, sendcount, sendtype, dest, sendtag, recvbuf, recvcount, recvtype,
397 source, recvtag, comm, status);
398
399 _doEventLeave(eMpiName::Sendrecv);
400 return _ret(r);
401}
402
403/*---------------------------------------------------------------------------*/
404/*---------------------------------------------------------------------------*/
405
408iSend(const void* buf, int count, MPI_Datatype datatype, int dest, int tag,
409 MPI_Comm comm, MPI_Request* request)
410{
411 _doEventEnter(eMpiName::Isend);
412
413 int r = MPI_Isend(buf, count, datatype, dest, tag, comm, request);
414 // Since OTF2 requires an integer, use the Fortran value of the request which
415 // is guaranteed to be an integer (unlike MPI_Request)
416 uint64_t request_id = MPI_Request_c2f(*request);
417 OTF2_EvtWriter_MpiIsend(m_otf2_wrapper->getEventWriter(), NULL, Otf2LibWrapper::getTime(),
418 dest, 0 /* comm region */, tag, getSizeOfMpiType(datatype) * count, request_id);
419
420 _doEventLeave(eMpiName::Isend);
421 return _ret(r);
422}
423
424/*---------------------------------------------------------------------------*/
425/*---------------------------------------------------------------------------*/
426
429send(const void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm)
430{
431 _doEventEnter(eMpiName::Send);
432
433 int r = MPI_Send(buf, count, datatype, dest, tag, comm);
434
435 OTF2_EvtWriter_MpiSend(m_otf2_wrapper->getEventWriter(), NULL, Otf2LibWrapper::getTime(),
436 dest, 0 /* comm region */, tag, getSizeOfMpiType(datatype) * count);
437
438 _doEventLeave(eMpiName::Send);
439 return _ret(r);
440}
441
442/*---------------------------------------------------------------------------*/
443/*---------------------------------------------------------------------------*/
444
447iRecv(void* buf, int count, MPI_Datatype datatype, int source, int tag,
448 MPI_Comm comm, MPI_Request* request)
449{
450 _doEventEnter(eMpiName::Irecv);
451
452 int r = MPI_Irecv(buf, count, datatype, source, tag, comm, request);
453
454 // TODO: figure out how to make this thing work...
455 // OTF2_EvtWriter_MpiIrecv(m_otf2_wrapper->getEventWriter(), NULL, Otf2LibWrapper::getTime(),
456 // source, 0 /* comm region */, tag, getSizeOfMpiType(datatype) * count, *request);
457 _doEventLeave(eMpiName::Irecv);
458 return _ret(r);
459}
460
461/*---------------------------------------------------------------------------*/
462/*---------------------------------------------------------------------------*/
463
466recv(void* buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Status* status)
467{
468 _doEventEnter(eMpiName::Recv);
469 int r = MPI_Recv(buf, count, datatype, source, tag, comm, status);
470
471 OTF2_EvtWriter_MpiRecv(m_otf2_wrapper->getEventWriter(), NULL, Otf2LibWrapper::getTime(),
472 source, 0 /* comm region */, tag, getSizeOfMpiType(datatype) * count);
473
474 _doEventLeave(eMpiName::Recv);
475 return _ret(r);
476}
477
478/*---------------------------------------------------------------------------*/
479/*---------------------------------------------------------------------------*/
480
483test(MPI_Request* request, int* flag, MPI_Status* status)
484{
485 _doEventEnter(eMpiName::Test);
486 if (!MPI_Test(request, flag, status)) {
487 uint64_t request_id = MPI_Request_c2f(*request);
488 OTF2_EvtWriter_MpiRequestTest(m_otf2_wrapper->getEventWriter(), NULL, Otf2LibWrapper::getTime(), request_id);
489 }
490 _doEventLeave(eMpiName::Test);
491 return _ret(0);
492}
493
494/*---------------------------------------------------------------------------*/
495/*---------------------------------------------------------------------------*/
496
499probe(int source, int tag, MPI_Comm comm, MPI_Status* status)
500{
501 _doEventEnter(eMpiName::Probe);
502 int r = MPI_Probe(source, tag, comm, status);
503 _doEventLeave(eMpiName::Probe);
504 return _ret(r);
505}
506
507/*---------------------------------------------------------------------------*/
508/*---------------------------------------------------------------------------*/
509
512getCount(const MPI_Status* status, MPI_Datatype datatype, int* count)
513{
514 _doEventEnter(eMpiName::Get_count);
515 int r = MPI_Get_count(status, datatype, count);
516 _doEventLeave(eMpiName::Get_count);
517 return _ret(r);
518}
519
520/*---------------------------------------------------------------------------*/
521/*---------------------------------------------------------------------------*/
522
525wait(MPI_Request* request, MPI_Status* status)
526{
527 _doEventEnter(eMpiName::Wait);
528 int r = MPI_Wait(request, status);
529 _doEventLeave(eMpiName::Wait);
530 return _ret(r);
531}
532
533/*---------------------------------------------------------------------------*/
534/*---------------------------------------------------------------------------*/
535
538waitAll(int count, MPI_Request array_of_requests[], MPI_Status array_of_statuses[])
539{
540 _doEventEnter(eMpiName::Waitall);
541 int r = MPI_Waitall(count, array_of_requests, array_of_statuses);
542 _doEventLeave(eMpiName::Waitall);
543 return _ret(r);
544}
545
546/*---------------------------------------------------------------------------*/
547/*---------------------------------------------------------------------------*/
548
551testSome(int incount, MPI_Request array_of_requests[], int* outcount,
552 int array_of_indices[], MPI_Status array_of_statuses[])
553{
554 _doEventEnter(eMpiName::Testsome);
555 int r = MPI_Testsome(incount, array_of_requests, outcount, array_of_indices, array_of_statuses);
556 _doEventLeave(eMpiName::Testsome);
557 return _ret(r);
558}
559
560/*---------------------------------------------------------------------------*/
561/*---------------------------------------------------------------------------*/
562
565waitSome(int incount, MPI_Request array_of_requests[], int* outcount,
566 int array_of_indices[], MPI_Status array_of_statuses[])
567{
568 _doEventEnter(eMpiName::Waitsome);
569 int r = MPI_Waitsome(incount, array_of_requests, outcount, array_of_indices, array_of_statuses);
570 _doEventLeave(eMpiName::Waitsome);
571 return _ret(r);
572}
573
574/*---------------------------------------------------------------------------*/
575/*---------------------------------------------------------------------------*/
576
577void Otf2MpiProfiling::
578_doEventEnter(eMpiName event_name)
579{
580 OTF2_EvtWriter_Enter(m_otf2_wrapper->getEventWriter(), NULL, Otf2LibWrapper::getTime(),
581 static_cast<uint32_t>(event_name));
582}
583
584/*---------------------------------------------------------------------------*/
585/*---------------------------------------------------------------------------*/
586
587void Otf2MpiProfiling::
588_doEventLeave(eMpiName event_name)
589{
590 OTF2_EvtWriter_Leave(m_otf2_wrapper->getEventWriter(), NULL, Otf2LibWrapper::getTime(),
591 static_cast<uint32_t>(event_name));
592}
593
594/*---------------------------------------------------------------------------*/
595/*---------------------------------------------------------------------------*/
596
597} // namespace Arcane
598
599/*---------------------------------------------------------------------------*/
600/*---------------------------------------------------------------------------*/
Wrapper class for OTF2 library functions.
OTF2_EvtWriter * getEventWriter()
static OTF2_TimeStamp getTime()
Internal static method to retrieve the timestamp.
ReturnType allGatherVariable(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, MPI_Comm comm) final
MPI_Allgatherv.
ReturnType allGather(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm) final
MPI_Allgather.
ReturnType waitAll(int count, MPI_Request array_of_requests[], MPI_Status array_of_statuses[]) final
MPI_Waitall.
ReturnType testSome(int incount, MPI_Request array_of_requests[], int *outcount, int array_of_indices[], MPI_Status array_of_statuses[]) final
MPI_Testsome.
ReturnType probe(int source, int tag, MPI_Comm comm, MPI_Status *status) final
MPI_Probe.
Otf2MpiProfiling(Otf2LibWrapper *otf2_wrapper)
Constructor.
ReturnType barrier(MPI_Comm comm) final
MPI_Barrier.
ReturnType sendRecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, int dest, int sendtag, void *recvbuf, int recvcount, MPI_Datatype recvtype, int source, int recvtag, MPI_Comm comm, MPI_Status *status) final
MPI_Sendrecv.
ReturnType scanExclusive(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) final
MPI_ExScan.
ReturnType recv(void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Status *status) final
MPI_recv.
ReturnType reduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm) final
MPI_Reduce.
ReturnType scatterVariable(const void *sendbuf, const int *sendcounts, const int *displs, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm) final
MPI_Scatterv.
ReturnType allToAllVariable(const void *sendbuf, const int *sendcounts, const int *sdispls, MPI_Datatype sendtype, void *recvbuf, const int *recvcounts, const int *rdispls, MPI_Datatype recvtype, MPI_Comm comm) final
MPI_Alltoallv.
ReturnType allToAll(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm) final
MPI_Alltoall.
ReturnType gatherVariable(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, int root, MPI_Comm comm) final
MPI_Gatherv.
ReturnType scan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) final
MPI_Scan.
ReturnType waitSome(int incount, MPI_Request array_of_requests[], int *outcount, int array_of_indices[], MPI_Status array_of_statuses[]) final
MPI_Waitsome.
ReturnType getCount(const MPI_Status *status, MPI_Datatype datatype, int *count) final
MPI_Get_count.
ReturnType broadcast(void *buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm) final
MPI_Bcast.
ReturnType gather(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm) final
MPI_Gather.
ReturnType wait(MPI_Request *request, MPI_Status *status) final
MPI_Wait.
ReturnType test(MPI_Request *request, int *flag, MPI_Status *status) final
MPI_Test.
ReturnType send(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) final
MPI_Send.
ReturnType allReduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) final
MPI_Allreduce.
ReturnType iSend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request) final
MPI_Isend.
ReturnType iRecv(void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Request *request) final
MPI_Irecv.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --