Arcane  4.2.3.0
Developer documentation
Loading...
Searching...
No Matches
IMpiProfiling.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/* IMpiProfiling.h (C) 2000-2026 */
9/* */
10/* Abstraction interface for MPI operations. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCCORE_MESSAGEPASSINGMPI_INTERNAL_IMPIPROFILING_H
13#define ARCCORE_MESSAGEPASSINGMPI_INTERNAL_IMPIPROFILING_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arccore/message_passing_mpi/MessagePassingMpiGlobal.h"
18
19#include "arccore/message_passing/IProfiler.h"
20
21#include "arccore/collections/CollectionsGlobal.h"
22
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
28namespace Arcane::MessagePassing::Mpi
29{
30
31/*---------------------------------------------------------------------------*/
32/*---------------------------------------------------------------------------*/
39class ARCCORE_MESSAGEPASSINGMPI_EXPORT IMpiProfiling
40: public IProfiler
41{
42 public:
43
44 // Return type. Currently 'void' to be compliant with existing code
45 // but it should be 'int' because it is the return type of all MPI methods.
46 using ReturnType = void;
47
48 public:
49
50 IMpiProfiling() = default;
51 virtual ~IMpiProfiling() = default;
52
53 public:
54
55 // Bcast
56 virtual ReturnType broadcast(void* buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm) = 0;
57 // Gather
58 virtual ReturnType gather(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
59 int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm) = 0;
60 // Gatherv
61 virtual ReturnType gatherVariable(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
62 const int* recvcounts, const int* displs, MPI_Datatype recvtype, int root,
63 MPI_Comm comm) = 0;
64 // allGather
65 virtual ReturnType allGather(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
66 int recvcount, MPI_Datatype recvtype, MPI_Comm comm) = 0;
67 // Allgatherv
68 virtual ReturnType allGatherVariable(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
69 const int* recvcounts, const int* displs, MPI_Datatype recvtype, MPI_Comm comm) = 0;
70 // Scatterv
71 virtual ReturnType scatterVariable(const void* sendbuf, const int* sendcounts, const int* displs,
72 MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype,
73 int root, MPI_Comm comm) = 0;
74 // Alltoall
75 virtual ReturnType allToAll(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
76 int recvcount, MPI_Datatype recvtype, MPI_Comm comm) = 0;
77 // Alltoallv
78 virtual ReturnType allToAllVariable(const void* sendbuf, const int* sendcounts, const int* sdispls,
79 MPI_Datatype sendtype, void* recvbuf, const int* recvcounts,
80 const int* rdispls, MPI_Datatype recvtype, MPI_Comm comm) = 0;
81 // Barrier
82 virtual ReturnType barrier(MPI_Comm comm) = 0;
83 // Reduce
84 virtual ReturnType reduce(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype,
85 MPI_Op op, int root, MPI_Comm comm) = 0;
86 // Allreduce
87 virtual ReturnType allReduce(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype,
88 MPI_Op op, MPI_Comm comm) = 0;
89 // Scan
90 virtual ReturnType scan(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op,
91 MPI_Comm comm) = 0;
92 // Scan Exclusive
93 virtual ReturnType scanExclusive(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op,
94 MPI_Comm comm) = 0;
95 // Sendrecv
96 virtual ReturnType sendRecv(const void* sendbuf, int sendcount, MPI_Datatype sendtype, int dest,
97 int sendtag, void* recvbuf, int recvcount, MPI_Datatype recvtype,
98 int source, int recvtag, MPI_Comm comm, MPI_Status* status) = 0;
99 // Isend
100 virtual ReturnType iSend(const void* buf, int count, MPI_Datatype datatype, int dest, int tag,
101 MPI_Comm comm, MPI_Request* request) = 0;
102 // Send
103 virtual ReturnType send(const void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) = 0;
104 // Irecv
105 virtual ReturnType iRecv(void* buf, int count, MPI_Datatype datatype, int source, int tag,
106 MPI_Comm comm, MPI_Request* request) = 0;
107 // recv
108 virtual ReturnType recv(void* buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm,
109 MPI_Status* status) = 0;
110 // Test
111 virtual ReturnType test(MPI_Request* request, int* flag, MPI_Status* status) = 0;
112 // Probe
113 virtual ReturnType probe(int source, int tag, MPI_Comm comm, MPI_Status* status) = 0;
114 // Get_count
115 virtual ReturnType getCount(const MPI_Status* status, MPI_Datatype datatype, int* count) = 0;
116 // Wait
117 virtual ReturnType wait(MPI_Request* request, MPI_Status* status) = 0;
118 // Waitall
119 virtual ReturnType waitAll(int count, MPI_Request* array_of_requests, MPI_Status* array_of_statuses) = 0;
120 // Testsome
121 virtual ReturnType testSome(int incount, MPI_Request* array_of_requests, int* outcount,
122 int* array_of_indices, MPI_Status* array_of_statuses) = 0;
123 // Waitsome
124 virtual ReturnType waitSome(int incount, MPI_Request* array_of_requests, int* outcount,
125 int* array_of_indices, MPI_Status* array_of_statuses) = 0;
126};
127
128/*---------------------------------------------------------------------------*/
129/*---------------------------------------------------------------------------*/
130
131} // namespace Arcane::MessagePassing::Mpi
132
133/*---------------------------------------------------------------------------*/
134/*---------------------------------------------------------------------------*/
135
136#endif
Declarations of types for the 'base' component of Arccore.
Interface of a profiler for message exchanges.
Definition IProfiler.h:32