Astaroth  3.1
Scalable Multi-GPU Stencil Computations
Loading...
Searching...
No Matches
ac_mpi.h
Go to the documentation of this file.
1#pragma once
2
3#include "func_define.h"
4#include "host_datatypes.h"
5
6#if AC_MPI_ENABLED && __has_include(<mpi.h>)
7#include <mpi.h>
8#endif
9
10//TP: opaque pointer for the MPI comm to enable having the opaque type in modules which do not about MPI_Comm
11typedef struct AcCommunicator AcCommunicator;
12
13#if AC_MPI_ENABLED && __has_include(<mpi.h>)
14
15struct AcCommunicator {
16 MPI_Comm handle;
17};
18
19typedef struct AcSubCommunicators {
20 MPI_Comm all;
21 MPI_Comm x;
22 MPI_Comm y;
23 MPI_Comm z;
24
25 MPI_Comm reverse_x;
26 MPI_Comm reverse_y;
27 MPI_Comm reverse_z;
28
29 MPI_Comm xy;
30 MPI_Comm xz;
31 MPI_Comm yz;
32} AcSubCommunicators;
33
34#else
35
37 // OM: Padding is necessary because C and C++ both make structs a different size if they are
38 // left empty.
39 void* padding[8];
40};
41
42#endif
Definition ac_mpi.h:36
void * padding[8]
Definition ac_mpi.h:39