Arcane  v3.16.0.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-2025 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
66namespace Arcane::MessagePassing::Mpi
67{
68class MpiRequest;
69class MpiAdapter;
70class MpiLock;
72class IMpiProfiling;
73class NoMpiProfiling;
74class MpiDatatype;
76class MpiSerializeMessageList;
79class MpiSerializeMessageList;
80template <typename DataType>
82template <typename Type>
84} // namespace Arcane::MessagePassing::Mpi
85
86/*---------------------------------------------------------------------------*/
87/*---------------------------------------------------------------------------*/
88
89namespace Arcane::MessagePassing::Mpi::MpiBuiltIn
90{
91
92/*---------------------------------------------------------------------------*/
93/*---------------------------------------------------------------------------*/
94
95inline MPI_Datatype
96datatype(char)
97{
98 return MPI_CHAR;
99}
100inline MPI_Datatype
101datatype(unsigned char)
102{
103 return MPI_CHAR;
104}
105inline MPI_Datatype
106datatype(signed char)
107{
108 return MPI_CHAR;
109}
110inline MPI_Datatype
111datatype(short)
112{
113 return MPI_SHORT;
114}
115inline MPI_Datatype
116datatype(int)
117{
118 return MPI_INT;
119}
120inline MPI_Datatype
121datatype(float)
122{
123 return MPI_FLOAT;
124}
125inline MPI_Datatype
126datatype(double)
127{
128 return MPI_DOUBLE;
129}
130inline MPI_Datatype
131datatype(long double)
132{
133 return MPI_LONG_DOUBLE;
134}
135inline MPI_Datatype
136datatype(long int)
137{
138 return MPI_LONG;
139}
140inline MPI_Datatype
141datatype(unsigned short)
142{
143 return MPI_UNSIGNED_SHORT;
144}
145inline MPI_Datatype
146datatype(unsigned int)
147{
148 return MPI_UNSIGNED;
149}
150inline MPI_Datatype
151datatype(unsigned long)
152{
153 return MPI_UNSIGNED_LONG;
154}
155inline MPI_Datatype
156datatype(long long)
157{
158 return MPI_LONG_LONG;
159}
160inline MPI_Datatype
161datatype(unsigned long long)
162{
163 return MPI_LONG_LONG;
164}
165/*---------------------------------------------------------------------------*/
166/*---------------------------------------------------------------------------*/
167
168} // namespace Arcane::MessagePassing::Mpi::MpiBuiltIn
169
170/*---------------------------------------------------------------------------*/
171/*---------------------------------------------------------------------------*/
172
173namespace Arccore::MessagePassing::Mpi
174{
175// Pour compatibilité avec Alien
176using Arcane::MessagePassing::internal::BasicSerializeMessage;
177
178using Arcane::MessagePassing::Mpi::IMpiProfiling;
179using Arcane::MessagePassing::Mpi::IMpiReduceOperator;
180using Arcane::MessagePassing::Mpi::MpiAdapter;
181using Arcane::MessagePassing::Mpi::MpiDatatype;
182using Arcane::MessagePassing::Mpi::MpiLock;
183using Arcane::MessagePassing::Mpi::MpiMessagePassingMng;
184using Arcane::MessagePassing::Mpi::MpiRequest;
185using Arcane::MessagePassing::Mpi::MpiSerializeDispatcher;
186using Arcane::MessagePassing::Mpi::MpiSerializeMessageList;
187using Arcane::MessagePassing::Mpi::MpiTypeDispatcher;
188using Arcane::MessagePassing::Mpi::NoMpiProfiling;
189using Arcane::MessagePassing::Mpi::StandaloneMpiMessagePassingMng;
190using Arcane::MessagePassing::Mpi::StdMpiReduceOperator;
191namespace MpiBuiltIn = Arcane::MessagePassing::Mpi::MpiBuiltIn;
192}; // namespace Arccore::MessagePassing::Mpi
193
194/*---------------------------------------------------------------------------*/
195/*---------------------------------------------------------------------------*/
196
197#endif
Déclarations générales de la composante 'message_passing'.
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...