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