Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
NoMpiProfiling.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/* NoMpiProfiling.h (C) 2000-2025 */
9/* */
10/* Implementation of the IMpiProfiling interface. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCCORE_MESSAGEPASSINGMPI_INTERNAL_NOMPIPROFILING_H
13#define ARCCORE_MESSAGEPASSINGMPI_INTERNAL_NOMPIPROFILING_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arccore/message_passing_mpi/MessagePassingMpiGlobal.h"
18#include "arccore/message_passing_mpi/internal/IMpiProfiling.h"
19#include "arccore/message_passing/Request.h"
20#include "arccore/collections/CollectionsGlobal.h"
22
23/*---------------------------------------------------------------------------*/
24/*---------------------------------------------------------------------------*/
25
26namespace Arcane::MessagePassing::Mpi
27{
28
29/*---------------------------------------------------------------------------*/
30/*---------------------------------------------------------------------------*/
31
37class ARCCORE_MESSAGEPASSINGMPI_EXPORT NoMpiProfiling
38: public IMpiProfiling
39{
40 public:
41
42 NoMpiProfiling() = default;
43 virtual ~NoMpiProfiling() = default;
44
45 ReturnType _ret(int r)
46 {
47 return (ReturnType)(r);
48 }
49
50 public:
51
52 // Bcast
53 ReturnType broadcast(void* buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm) final
54 {
55 return _ret(MPI_Bcast(buffer, count, datatype, root, comm));
56 }
57 // Gather
58 ReturnType gather(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
59 int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm) final
60 {
61 return _ret(MPI_Gather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm));
62 }
63 // Gatherv
64 ReturnType gatherVariable(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
65 const int* recvcounts, const int* displs, MPI_Datatype recvtype, int root, MPI_Comm comm) final
66 {
67 return _ret(MPI_Gatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, comm));
68 }
69 // allGather
70 ReturnType allGather(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
71 int recvcount, MPI_Datatype recvtype, MPI_Comm comm) final
72 {
73 return _ret(MPI_Allgather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm));
74 }
75 // Allgatherv
76 ReturnType allGatherVariable(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
77 const int* recvcounts, const int* displs, MPI_Datatype recvtype, MPI_Comm comm) final
78 {
79 return _ret(MPI_Allgatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm));
80 }
81 // Scatterv
82 ReturnType scatterVariable(const void* sendbuf, const int* sendcounts, const int* displs,
83 MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype,
84 int root, MPI_Comm comm) final
85 {
86 return _ret(MPI_Scatterv(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm));
87 }
88 // Alltoall
89 ReturnType allToAll(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
90 int recvcount, MPI_Datatype recvtype, MPI_Comm comm) final
91 {
92 return _ret(MPI_Alltoall(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm));
93 }
94 // Alltoallv
95 ReturnType allToAllVariable(const void* sendbuf, const int* sendcounts, const int* sdispls,
96 MPI_Datatype sendtype, void* recvbuf, const int* recvcounts,
97 const int* rdispls, MPI_Datatype recvtype, MPI_Comm comm) final
98 {
99 return _ret(MPI_Alltoallv(sendbuf, sendcounts, sdispls, sendtype, recvbuf, recvcounts, rdispls, recvtype, comm));
100 }
101 // Barrier
102 ReturnType barrier(MPI_Comm comm) final
103 {
104 return _ret(MPI_Barrier(comm));
105 }
106 // Reduce
107 ReturnType reduce(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype,
108 MPI_Op op, int root, MPI_Comm comm) final
109 {
110 return _ret(MPI_Reduce(sendbuf, recvbuf, count, datatype, op, root, comm));
111 }
112 // Allreduce
113 ReturnType allReduce(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype,
114 MPI_Op op, MPI_Comm comm) final
115 {
116 return _ret(MPI_Allreduce(sendbuf, recvbuf, count, datatype, op, comm));
117 }
118 // Scan
119 ReturnType scan(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) final
120 {
121 return _ret(MPI_Scan(sendbuf, recvbuf, count, datatype, op, comm));
122 }
123 // Sendrecv
124 ReturnType sendRecv(const void* sendbuf, int sendcount, MPI_Datatype sendtype, int dest,
125 int sendtag, void* recvbuf, int recvcount, MPI_Datatype recvtype,
126 int source, int recvtag, MPI_Comm comm, MPI_Status* status) final
127 {
128 return _ret(MPI_Sendrecv(sendbuf, sendcount, sendtype, dest, sendtag, recvbuf, recvcount, recvtype,
129 source, recvtag, comm, status));
130 }
131 // Isend
132 ReturnType iSend(const void* buf, int count, MPI_Datatype datatype, int dest, int tag,
133 MPI_Comm comm, MPI_Request* request) final
134 {
135 return _ret(MPI_Isend(buf, count, datatype, dest, tag, comm, request));
136 }
137 // Send
138 ReturnType send(const void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) final
139 {
140 return _ret(MPI_Send(buf, count, datatype, dest, tag, comm));
141 }
142 // Irecv
143 ReturnType iRecv(void* buf, int count, MPI_Datatype datatype, int source, int tag,
144 MPI_Comm comm, MPI_Request* request) final
145 {
146 return _ret(MPI_Irecv(buf, count, datatype, source, tag, comm, request));
147 }
148 // recv
149 ReturnType recv(void* buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Status* status) final
150 {
151 return _ret(MPI_Recv(buf, count, datatype, source, tag, comm, status));
152 }
153 // Test
154 ReturnType test(MPI_Request* request, int* flag, MPI_Status* status) final
155 {
156 return _ret(MPI_Test(request, flag, status));
157 }
158 // Probe
159 ReturnType probe(int source, int tag, MPI_Comm comm, MPI_Status* status) final
160 {
161 return _ret(MPI_Probe(source, tag, comm, status));
162 }
163 // Get_count
164 ReturnType getCount(const MPI_Status* status, MPI_Datatype datatype, int* count) final
165 {
166 return _ret(MPI_Get_count(status, datatype, count));
167 }
168 // Wait
169 ReturnType wait(MPI_Request* request, MPI_Status* status) final
170 {
171 return _ret(MPI_Wait(request, status));
172 }
173 // Waitall
174 ReturnType waitAll(int count, MPI_Request* array_of_requests, MPI_Status* array_of_statuses) final
175 {
176 return _ret(MPI_Waitall(count, array_of_requests, array_of_statuses));
177 }
178 // Testsome
179 ReturnType testSome(int incount, MPI_Request* array_of_requests, int* outcount,
180 int* array_of_indices, MPI_Status* array_of_statuses) final
181 {
182 return _ret(MPI_Testsome(incount, array_of_requests, outcount, array_of_indices, array_of_statuses));
183 }
184 // Waitsome
185 ReturnType waitSome(int incount, MPI_Request* array_of_requests, int* outcount,
186 int* array_of_indices, MPI_Status* array_of_statuses) final
187 {
188 return _ret(MPI_Waitsome(incount, array_of_requests, outcount, array_of_indices, array_of_statuses));
189 }
190};
191
192/*---------------------------------------------------------------------------*/
193/*---------------------------------------------------------------------------*/
194
195} // namespace Arcane::MessagePassing::Mpi
196
197/*---------------------------------------------------------------------------*/
198/*---------------------------------------------------------------------------*/
199
200#endif
Declarations of types for the 'base' component of Arccore.