Arcane  v3.14.10.0
Documentation utilisateur
Chargement...
Recherche...
Aucune correspondance
MessagePassingMpiGlobal.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/* MessagePassingMpiGlobal.h (C) 2000-2019 */
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 Arccore::MessagePassing::Mpi
67{
68class MpiRequest;
69class MpiAdapter;
70class MpiLock;
71class IMpiReduceOperator;
72class MpiDatatype;
73class MpiMessagePassingMng;
74class MpiSerializeMessageList;
75class MpiSerializeDispatcher;
76template<typename DataType>
77class StdMpiReduceOperator;
78
79/*---------------------------------------------------------------------------*/
80/*---------------------------------------------------------------------------*/
81
82namespace MpiBuiltIn
83{
84
85/*---------------------------------------------------------------------------*/
86/*---------------------------------------------------------------------------*/
87
88inline MPI_Datatype
89datatype(char)
90{ return MPI_CHAR; }
91inline MPI_Datatype
92datatype(unsigned char)
93{ return MPI_CHAR; }
94inline MPI_Datatype
95datatype(signed char)
96{ return MPI_CHAR; }
97inline MPI_Datatype
98datatype(short)
99{ return MPI_SHORT; }
100inline MPI_Datatype
101datatype(int)
102{ return MPI_INT; }
103inline MPI_Datatype
104datatype(float)
105{ return MPI_FLOAT; }
106inline MPI_Datatype
107datatype(double)
108{ return MPI_DOUBLE; }
109inline MPI_Datatype
110datatype(long double)
111{ return MPI_LONG_DOUBLE; }
112inline MPI_Datatype
113datatype(long int)
114{ return MPI_LONG; }
115inline MPI_Datatype
116datatype(unsigned short)
117{ return MPI_UNSIGNED_SHORT; }
118inline MPI_Datatype
119datatype(unsigned int)
120{ return MPI_UNSIGNED; }
121inline MPI_Datatype
122datatype(unsigned long)
123{ return MPI_UNSIGNED_LONG; }
124inline MPI_Datatype
125datatype(long long)
126{ return MPI_LONG_LONG; }
127inline MPI_Datatype
128datatype(unsigned long long)
129{ return MPI_LONG_LONG; }
130}
131
132/*---------------------------------------------------------------------------*/
133/*---------------------------------------------------------------------------*/
134
135} // End namespace Arccore::MessagePassing::Mpi
136
137/*---------------------------------------------------------------------------*/
138/*---------------------------------------------------------------------------*/
139
140#endif
141
Déclarations générales de la composante 'message_passing'.