UPstreamAllToAll.C
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2022 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26\*---------------------------------------------------------------------------*/
27
28#include "Pstream.H"
29#include "UPstreamWrapping.H"
30
31#include <mpi.h>
32#include <cinttypes>
33#include <cstring> // memmove
34
35// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
36
37#undef Pstream_CommonRoutines
38#define Pstream_CommonRoutines(Native, TaggedType) \
39void Foam::UPstream::allToAll \
40( \
41 const UList<Native>& sendData, \
42 UList<Native>& recvData, \
43 const label comm \
44) \
45{ \
46 PstreamDetail::allToAll \
47 ( \
48 sendData, recvData, TaggedType, comm \
49 ); \
50} \
51
52
53Pstream_CommonRoutines(int32_t, MPI_INT32_T);
54Pstream_CommonRoutines(int64_t, MPI_INT64_T);
55
56#undef Pstream_CommonRoutines
57
58
59// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
60
61#undef Pstream_CommonRoutines
62#define Pstream_CommonRoutines(Native, TaggedType) \
63void Foam::UPstream::allToAll \
64( \
65 const Native* sendData, \
66 const UList<int>& sendCounts, \
67 const UList<int>& sendOffsets, \
68 Native* recvData, \
69 const UList<int>& recvCounts, \
70 const UList<int>& recvOffsets, \
71 const label comm \
72) \
73{ \
74 PstreamDetail::allToAllv \
75 ( \
76 sendData, sendCounts, sendOffsets, \
77 recvData, recvCounts, recvOffsets, \
78 TaggedType, comm \
79 ); \
80}
81
82// Unused: Pstream_CommonRoutines(char, MPI_BYTE);
83
84#undef Pstream_CommonRoutines
85
86// ************************************************************************* //
#define Pstream_CommonRoutines(Native, TaggedType)