Arcane  v3.14.10.0
Documentation utilisateur
Chargement...
Recherche...
Aucune correspondance
IMpiProfiling.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2022 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-2020 */
9/* */
10/* Interface d'abstraction des operations MPI. */
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 Arccore::MessagePassing::Mpi
29{
30
31/*---------------------------------------------------------------------------*/
32/*---------------------------------------------------------------------------*/
33/*!
34 * \internal
35 * \brief Interface d'abstraction pour les operations MPI.
36 * Sert principalement a utiliser un decorateur pour les fonctions MPI
37 * afin de les profiler sans etre trop verbeux et intrusif dans le MPIAdapter
38 */
39class ARCCORE_MESSAGEPASSINGMPI_EXPORT IMpiProfiling
40: public IProfiler
41{
42 public:
43 // Type de retour. Pour l'instant 'void' pour être conforme avec l'existant
44 // mais cela devrait être 'int' car c'est le type de retour de toutes les méthodes MPI.
45 using ReturnType = void;
46
47 public:
48 IMpiProfiling() = default;
49 virtual ~IMpiProfiling() = default;
50
51 public:
52 // Bcast
53 virtual ReturnType broadcast(void* buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm) = 0;
54 // Gather
55 virtual ReturnType gather(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
56 int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm) = 0;
57 // Gatherv
58 virtual ReturnType gatherVariable(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
59 const int* recvcounts, const int* displs, MPI_Datatype recvtype, int root,
60 MPI_Comm comm) = 0;
61 // allGather
62 virtual ReturnType allGather(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
63 int recvcount, MPI_Datatype recvtype, MPI_Comm comm) = 0;
64 // Allgatherv
65 virtual ReturnType allGatherVariable(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
66 const int* recvcounts, const int* displs, MPI_Datatype recvtype, MPI_Comm comm) = 0;
67 // Scatterv
68 virtual ReturnType scatterVariable(const void* sendbuf, const int* sendcounts, const int* displs,
69 MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype,
70 int root, MPI_Comm comm) = 0;
71 // Alltoall
72 virtual ReturnType allToAll(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
73 int recvcount, MPI_Datatype recvtype, MPI_Comm comm) = 0;
74 // Alltoallv
75 virtual ReturnType allToAllVariable(const void* sendbuf, const int* sendcounts, const int* sdispls,
76 MPI_Datatype sendtype, void* recvbuf, const int* recvcounts,
77 const int* rdispls, MPI_Datatype recvtype, MPI_Comm comm) = 0;
78 // Barrier
79 virtual ReturnType barrier(MPI_Comm comm) = 0;
80 // Reduce
81 virtual ReturnType reduce(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype,
82 MPI_Op op, int root, MPI_Comm comm) = 0;
83 // Allreduce
84 virtual ReturnType allReduce(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype,
85 MPI_Op op, MPI_Comm comm) = 0;
86 // Scan
87 virtual ReturnType scan(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op,
88 MPI_Comm comm) = 0;
89 // Sendrecv
90 virtual ReturnType sendRecv(const void* sendbuf, int sendcount, MPI_Datatype sendtype, int dest,
91 int sendtag, void* recvbuf, int recvcount, MPI_Datatype recvtype,
92 int source, int recvtag, MPI_Comm comm, MPI_Status* status) = 0;
93 // Isend
94 virtual ReturnType iSend(const void* buf, int count, MPI_Datatype datatype, int dest, int tag,
95 MPI_Comm comm, MPI_Request* request) = 0;
96 // Send
97 virtual ReturnType send(const void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) = 0;
98 // Irecv
99 virtual ReturnType iRecv(void* buf, int count, MPI_Datatype datatype, int source, int tag,
100 MPI_Comm comm, MPI_Request* request) = 0;
101 // recv
102 virtual ReturnType recv(void* buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm,
103 MPI_Status* status) = 0;
104 // Test
105 virtual ReturnType test(MPI_Request* request, int* flag, MPI_Status* status) = 0;
106 // Probe
107 virtual ReturnType probe(int source, int tag, MPI_Comm comm, MPI_Status* status) = 0;
108 // Get_count
109 virtual ReturnType getCount(const MPI_Status* status, MPI_Datatype datatype, int* count) = 0;
110 // Wait
111 virtual ReturnType wait(MPI_Request* request, MPI_Status* status) = 0;
112 // Waitall
113 virtual ReturnType waitAll(int count, MPI_Request* array_of_requests, MPI_Status* array_of_statuses) = 0;
114 // Testsome
115 virtual ReturnType testSome(int incount, MPI_Request* array_of_requests, int* outcount,
116 int* array_of_indices, MPI_Status* array_of_statuses) = 0;
117 // Waitsome
118 virtual ReturnType waitSome(int incount, MPI_Request* array_of_requests, int* outcount,
119 int* array_of_indices, MPI_Status* array_of_statuses) = 0;
120};
121
122/*---------------------------------------------------------------------------*/
123/*---------------------------------------------------------------------------*/
124
125} // namespace Arccore::MessagePassing::Mpi
126
127/*---------------------------------------------------------------------------*/
128/*---------------------------------------------------------------------------*/
129
130#endif
Déclarations des types de la composante 'base' de Arccore.
Interface d'un profiler pour les échanges de messages.
Definition IProfiler.h:31