Arcane  4.2.3.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
MessagePassingMpiGlobal.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/* MessagePassingMpiGlobal.h (C) 2000-2025 */
9/* */
10/* Définitions globales de la composante 'MessagePassingMpi' de 'Arccore'. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCCORE_MESSAGEPASSINGMPI_MESSAGEPASSINGMPIGLOBAL_H
13#define ARCCORE_MESSAGEPASSINGMPI_MESSAGEPASSINGMPIGLOBAL_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22// Ces deux macros permettent de s'assurer qu'on ne compile avec le support
23// de MpiC++ qui est obsolète
24#ifndef MPICH_SKIP_MPICXX
25#define MPICH_SKIP_MPICXX
26#endif
27#ifndef OMPI_SKIP_MPICXX
28#define OMPI_SKIP_MPICXX
29#endif
30#include <mpi.h>
31
32// Vérifie la version de MPI minimale. Normalement, on ne devrait pas avoir
33// de problèmes car cela est vérifié lors de la configuration mais on ne
34// sait jamais.
35#if !defined(ARCCORE_OS_WIN32)
36#if MPI_VERSION < 3 || (MPI_VERSION == 3 && MPI_SUBVERSION < 1)
37#error "MPI_VERSION 3.1 is required. Please disable MPI".
38#endif
39#endif
40
41#if defined(ARCCORE_OS_WIN32)
42// La version de mpi est celle de microsoft. Le proto de MPI_Op doit
43// avoir la déclaration __stdcall.
44// TODO: verifier avec d'autres MPI sous Windows.
45#define ARCCORE_MPIOP_CALL __stdcall
46#endif
47
48#ifndef ARCCORE_MPIOP_CALL
49#define ARCCORE_MPIOP_CALL
50#endif
51
52/*---------------------------------------------------------------------------*/
53/*---------------------------------------------------------------------------*/
54
55#if defined(ARCCORE_COMPONENT_arccore_message_passing_mpi)
56#define ARCCORE_MESSAGEPASSINGMPI_EXPORT ARCCORE_EXPORT
57#define ARCCORE_MESSAGEPASSINGMPI_EXTERN_TPL
58#else
59#define ARCCORE_MESSAGEPASSINGMPI_EXPORT ARCCORE_IMPORT
60#define ARCCORE_MESSAGEPASSINGMPI_EXTERN_TPL extern
61#endif
62
63/*---------------------------------------------------------------------------*/
64/*---------------------------------------------------------------------------*/
65
67{
68
69/*---------------------------------------------------------------------------*/
70/*---------------------------------------------------------------------------*/
71
77ARCCORE_MESSAGEPASSINGMPI_EXPORT MPI_Comm
79
88ARCCORE_MESSAGEPASSINGMPI_EXPORT bool
89fillMpiCommunicatorIfValid(IMessagePassingMng* mpm,MPI_Comm* mpi_comm);
90}
91
92/*---------------------------------------------------------------------------*/
93/*---------------------------------------------------------------------------*/
94
95namespace Arcane::MessagePassing::Mpi
96{
97
98/*---------------------------------------------------------------------------*/
99/*---------------------------------------------------------------------------*/
100
101class MpiRequest;
102class MpiAdapter;
103class MpiLock;
105class IMpiProfiling;
106class NoMpiProfiling;
107class MpiDatatype;
109class MpiSerializeMessageList;
112class MpiSerializeMessageList;
113template <typename DataType>
115template <typename Type>
117
118/*---------------------------------------------------------------------------*/
119/*---------------------------------------------------------------------------*/
120
121} // namespace Arcane::MessagePassing::Mpi
122
123/*---------------------------------------------------------------------------*/
124/*---------------------------------------------------------------------------*/
125
126namespace Arcane::MessagePassing::Mpi::MpiBuiltIn
127{
128
129/*---------------------------------------------------------------------------*/
130/*---------------------------------------------------------------------------*/
131
132inline MPI_Datatype
133datatype(char)
134{
135 return MPI_CHAR;
136}
137inline MPI_Datatype
138datatype(unsigned char)
139{
140 return MPI_CHAR;
141}
142inline MPI_Datatype
143datatype(signed char)
144{
145 return MPI_CHAR;
146}
147inline MPI_Datatype
148datatype(short)
149{
150 return MPI_SHORT;
151}
152inline MPI_Datatype
153datatype(int)
154{
155 return MPI_INT;
156}
157inline MPI_Datatype
158datatype(float)
159{
160 return MPI_FLOAT;
161}
162inline MPI_Datatype
163datatype(double)
164{
165 return MPI_DOUBLE;
166}
167inline MPI_Datatype
168datatype(long double)
169{
170 return MPI_LONG_DOUBLE;
171}
172inline MPI_Datatype
173datatype(long int)
174{
175 return MPI_LONG;
176}
177inline MPI_Datatype
178datatype(unsigned short)
179{
180 return MPI_UNSIGNED_SHORT;
181}
182inline MPI_Datatype
183datatype(unsigned int)
184{
185 return MPI_UNSIGNED;
186}
187inline MPI_Datatype
188datatype(unsigned long)
189{
190 return MPI_UNSIGNED_LONG;
191}
192inline MPI_Datatype
193datatype(long long)
194{
195 return MPI_LONG_LONG;
196}
197inline MPI_Datatype
198datatype(unsigned long long)
199{
200 return MPI_LONG_LONG;
201}
202/*---------------------------------------------------------------------------*/
203/*---------------------------------------------------------------------------*/
204
205} // namespace Arcane::MessagePassing::Mpi::MpiBuiltIn
206
207/*---------------------------------------------------------------------------*/
208/*---------------------------------------------------------------------------*/
209
210namespace Arccore::MessagePassing::Mpi
211{
212// Pour compatibilité avec Alien
213using Arcane::MessagePassing::internal::BasicSerializeMessage;
214
215using Arcane::MessagePassing::Mpi::IMpiProfiling;
216using Arcane::MessagePassing::Mpi::IMpiReduceOperator;
217using Arcane::MessagePassing::Mpi::MpiAdapter;
218using Arcane::MessagePassing::Mpi::MpiDatatype;
219using Arcane::MessagePassing::Mpi::MpiLock;
220using Arcane::MessagePassing::Mpi::MpiMessagePassingMng;
221using Arcane::MessagePassing::Mpi::MpiRequest;
222using Arcane::MessagePassing::Mpi::MpiSerializeDispatcher;
223using Arcane::MessagePassing::Mpi::MpiSerializeMessageList;
224using Arcane::MessagePassing::Mpi::MpiTypeDispatcher;
225using Arcane::MessagePassing::Mpi::NoMpiProfiling;
226using Arcane::MessagePassing::Mpi::StandaloneMpiMessagePassingMng;
227using Arcane::MessagePassing::Mpi::StdMpiReduceOperator;
228namespace MpiBuiltIn = Arcane::MessagePassing::Mpi::MpiBuiltIn;
229}; // namespace Arccore::MessagePassing::Mpi
230
231/*---------------------------------------------------------------------------*/
232/*---------------------------------------------------------------------------*/
233
234#endif
Déclarations générales de la composante 'message_passing'.
Interface du gestionnaire des échanges de messages.
Interface d'abstraction pour les operations MPI. Sert principalement a utiliser un decorateur pour le...
Opérateurs de réduction pour les types complexes (Real2, Real3, Real2x2 et Real3x3).
Verrou pour les appels MPI.
Definition MpiLock.h:37
Implémentation MPI du gestionnaire des échanges de messages.
Spécialisation MPI d'une 'Request'.
Definition MpiRequest.h:35
Implementation de l'interface des operations MPI. Correspond a un simple appel aux fonctions MPI du m...
Version autonome de IMessagePassingMng associée à un communicateur MPI.
Déclarations des types et méthodes utilisés par les mécanismes d'échange de messages.
ARCCORE_MESSAGEPASSINGMPI_EXPORT bool fillMpiCommunicatorIfValid(IMessagePassingMng *mpm, MPI_Comm *mpi_comm)
Positionne mpi_comm avec le communicateur MPI associé à mpm s'il est valide.
ARCCORE_MESSAGEPASSINGMPI_EXPORT MPI_Comm toMpiCommunicator(IMessagePassingMng *mpm)
Retourne le communicateur MPI associé à mpm.