Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Otf2MpiProfiling.h
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.h (C) 2000-2025 */
9/* */
10/* Implementation of the IMpiProfiling interface allowing instrumentation */
11/* in OTF2 format. */
12/*---------------------------------------------------------------------------*/
13#ifndef ARCANE_STD_INTERNAL_OTF2MPIPROFILING_H
14#define ARCANE_STD_INTERNAL_OTF2MPIPROFILING_H
15/*---------------------------------------------------------------------------*/
16/*---------------------------------------------------------------------------*/
17
19#include "arccore/collections/CollectionsGlobal.h"
20#include "arccore/message_passing/Request.h"
21#include "arccore/message_passing_mpi/internal/IMpiProfiling.h"
22#include "arccore/message_passing_mpi/internal/MessagePassingMpiEnum.h"
23#include "arcane/std/internal/Otf2LibWrapper.h"
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
28namespace Arcane
29{
30using namespace MessagePassing::Mpi;
31
32/*---------------------------------------------------------------------------*/
33/*---------------------------------------------------------------------------*/
34
42: public IMpiProfiling
43{
44 public:
45
46 // For now void for compatibility reasons but will eventually have to
47 // be IMpiProfiling::ReturnType
48 using ReturnType = void;
49
50 public:
51
52 explicit Otf2MpiProfiling(Otf2LibWrapper* otf2_wrapper);
53 ~Otf2MpiProfiling() override = default;
54
55 public:
56
57 // Bcast
58 ReturnType broadcast(void* buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm) final;
59 // Gather
60 ReturnType gather(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
61 int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm) final;
62 // Gatherv
63 ReturnType gatherVariable(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
64 const int* recvcounts, const int* displs, MPI_Datatype recvtype, int root, MPI_Comm comm) final;
65 // Allgather
66 ReturnType allGather(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
67 int recvcount, MPI_Datatype recvtype, MPI_Comm comm) final;
68 // Allgatherv
69 ReturnType allGatherVariable(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
70 const int* recvcounts, const int* displs, MPI_Datatype recvtype, MPI_Comm comm) final;
71 // Scatterv
72 ReturnType scatterVariable(const void* sendbuf, const int* sendcounts, const int* displs,
73 MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype,
74 int root, MPI_Comm comm) final;
75 // Alltoall
76 ReturnType allToAll(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
77 int recvcount, MPI_Datatype recvtype, MPI_Comm comm) final;
78 // Alltoallv
79 ReturnType allToAllVariable(const void* sendbuf, const int* sendcounts, const int* sdispls,
80 MPI_Datatype sendtype, void* recvbuf, const int* recvcounts,
81 const int* rdispls, MPI_Datatype recvtype, MPI_Comm comm) final;
82 // Barrier
83 ReturnType barrier(MPI_Comm comm) final;
84 // Reduce
85 ReturnType reduce(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype,
86 MPI_Op op, int root, MPI_Comm comm) final;
87 // Allreduce
88 ReturnType allReduce(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype,
89 MPI_Op op, MPI_Comm comm) final;
90 // Scan
91 ReturnType scan(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) final;
92 // Sendrecv
93 ReturnType sendRecv(const void* sendbuf, int sendcount, MPI_Datatype sendtype, int dest,
94 int sendtag, void* recvbuf, int recvcount, MPI_Datatype recvtype,
95 int source, int recvtag, MPI_Comm comm, MPI_Status* status) final;
96 // Isend
97 ReturnType iSend(const void* buf, int count, MPI_Datatype datatype, int dest, int tag,
98 MPI_Comm comm, MPI_Request* request) final;
99 // Send
100 ReturnType send(const void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) final;
101 // Irecv
102 ReturnType iRecv(void* buf, int count, MPI_Datatype datatype, int source, int tag,
103 MPI_Comm comm, MPI_Request* request) final;
104 // recv
105 ReturnType recv(void* buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Status* status) final;
106 // Test
107 ReturnType test(MPI_Request* request, int* flag, MPI_Status* status) final;
108 // Probe
109 ReturnType probe(int source, int tag, MPI_Comm comm, MPI_Status* status) final;
110 // Get_count
111 ReturnType getCount(const MPI_Status* status, MPI_Datatype datatype, int* count) final;
112 // Wait
113 ReturnType wait(MPI_Request* request, MPI_Status* status) final;
114 // Waitall
115 ReturnType waitAll(int count, MPI_Request array_of_requests[], MPI_Status array_of_statuses[]) final;
116 // Testsome
117 ReturnType testSome(int incount, MPI_Request array_of_requests[], int* outcount,
118 int array_of_indices[], MPI_Status array_of_statuses[]) final;
119 // Waitsome
120 ReturnType waitSome(int incount, MPI_Request array_of_requests[], int* outcount,
121 int array_of_indices[], MPI_Status array_of_statuses[]) final;
122
123 private:
124
125 Otf2LibWrapper* m_otf2_wrapper;
126
127 private:
128
129 void _doEventEnter(eMpiName event_name);
130 void _doEventLeave(eMpiName event_name);
131 ReturnType _ret(int r) const
132 {
133 return (ReturnType)(r);
134 }
135};
136
137/*---------------------------------------------------------------------------*/
138/*---------------------------------------------------------------------------*/
139
140} // namespace Arcane
141
142/*---------------------------------------------------------------------------*/
143/*---------------------------------------------------------------------------*/
144
145#endif
Declarations of types for the 'base' component of Arccore.
Wrapper class for OTF2 library functions.
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 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 --