GADGET-4
mpi_utils.h File Reference

declares some numerical values for MPI tags and function prototypes for MPI helper functions More...

#include <mpi.h>
#include "../data/dtypes.h"
#include "../data/mymalloc.h"

Go to the source code of this file.

Macros

#define TAG_TOPNODE_FREE   4
 
#define TAG_TOPNODE_OFFSET   5
 
#define TAG_TOPNODE_ALLOC   6
 
#define TAG_EWALD_ALLOC   7
 
#define TAG_TABLE_ALLOC   8
 
#define TAG_TABLE_FREE   9
 
#define TAG_N   10
 
#define TAG_HEADER   11
 
#define TAG_PDATA   12
 
#define TAG_SPHDATA   13
 
#define TAG_KEY   14
 
#define TAG_DMOM   15
 
#define TAG_NODELEN   16
 
#define TAG_HMAX   17
 
#define TAG_GRAV_A   18
 
#define TAG_GRAV_B   19
 
#define TAG_DIRECT_A   20
 
#define TAG_DIRECT_B   21
 
#define TAG_HYDRO_A   22
 
#define TAG_HYDRO_B   23
 
#define TAG_NFORTHISTASK   24
 
#define TAG_PERIODIC_A   25
 
#define TAG_PERIODIC_B   26
 
#define TAG_PERIODIC_C   27
 
#define TAG_PERIODIC_D   28
 
#define TAG_NONPERIOD_A   29
 
#define TAG_NONPERIOD_B   30
 
#define TAG_NONPERIOD_C   31
 
#define TAG_NONPERIOD_D   32
 
#define TAG_POTENTIAL_A   33
 
#define TAG_POTENTIAL_B   34
 
#define TAG_DENS_A   35
 
#define TAG_DENS_B   36
 
#define TAG_LOCALN   37
 
#define TAG_BH_A   38
 
#define TAG_BH_B   39
 
#define TAG_SMOOTH_A   40
 
#define TAG_SMOOTH_B   41
 
#define TAG_ENRICH_A   42
 
#define TAG_CONDUCT_A   43
 
#define TAG_CONDUCT_B   44
 
#define TAG_FOF_A   45
 
#define TAG_FOF_B   46
 
#define TAG_FOF_C   47
 
#define TAG_FOF_D   48
 
#define TAG_FOF_E   49
 
#define TAG_FOF_F   50
 
#define TAG_FOF_G   51
 
#define TAG_HOTNGB_A   52
 
#define TAG_HOTNGB_B   53
 
#define TAG_GRAD_A   54
 
#define TAG_GRAD_B   55
 
#define TAG_SE   56
 
#define TAG_SEARCH_A   58
 
#define TAG_SEARCH_B   59
 
#define TAG_INJECT_A   61
 
#define TAG_PDATA_SPH   70
 
#define TAG_KEY_SPH   71
 
#define TAG_PDATA_STAR   72
 
#define TAG_STARDATA   73
 
#define TAG_KEY_STAR   74
 
#define TAG_PDATA_BH   75
 
#define TAG_BHDATA   76
 
#define TAG_KEY_BH   77
 
#define TAG_GRAVCOST_A   79
 
#define TAG_GRAVCOST_B   80
 
#define TAG_PM_FOLD   81
 
#define TAG_BARRIER   82
 
#define TAG_PART_DATA   83
 
#define TAG_NODE_DATA   84
 
#define TAG_RESULTS   85
 
#define TAG_DRIFT_INIT   86
 
#define TAG_ALL_UPDATE   87
 
#define TAG_METDATA   500
 
#define TAG_FETCH_GRAVTREE   1000
 
#define TAG_FETCH_SPH_DENSITY   2000
 
#define TAG_FETCH_SPH_HYDRO   3000
 
#define TAG_FETCH_SPH_TREETIMESTEP   4000
 

Functions

void my_mpi_types_init (void)
 
int myMPI_Sendrecv (void *sendbuf, size_t sendcount, MPI_Datatype sendtype, int dest, int sendtag, void *recvbuf, size_t recvcount, MPI_Datatype recvtype, int source, int recvtag, MPI_Comm comm, MPI_Status *status)
 
int myMPI_Alltoallv_new_prep (int *sendcnt, int *recvcnt, int *rdispls, MPI_Comm comm, int method)
 
void myMPI_Alltoallv_new (void *sendb, int *sendcounts, int *sdispls, MPI_Datatype sendtype, void *recvb, int *recvcounts, int *rdispls, MPI_Datatype recvtype, MPI_Comm comm, int method)
 
void myMPI_Alltoallv (void *sendbuf, size_t *sendcounts, size_t *sdispls, void *recvbuf, size_t *recvcounts, size_t *rdispls, int len, int big_flag, MPI_Comm comm)
 
void my_int_MPI_Alltoallv (void *sendb, int *sendcounts, int *sdispls, void *recvb, int *recvcounts, int *rdispls, int len, int big_flag, MPI_Comm comm)
 
int myMPI_Allreduce (const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
 
int myMPI_Allgatherv (void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int *recvcount, int *displs, MPI_Datatype recvtype, MPI_Comm comm)
 
int myMPI_Alltoall (const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm)
 
void allreduce_sparse_double_sum (double *loc, double *glob, int N, MPI_Comm comm)
 
void minimum_large_ints (int n, long long *src, long long *res, MPI_Comm comm)
 
void sumup_longs (int n, long long *src, long long *res, MPI_Comm comm)
 
void sumup_large_ints (int n, int *src, long long *res, MPI_Comm comm)
 
template<typename T >
void allreduce_sum (T *glob, int N, MPI_Comm Communicator)
 

Variables

MPI_Datatype MPI_MyIntPosType
 
MPI_Op MPI_MIN_MyIntPosType
 
MPI_Op MPI_MAX_MyIntPosType
 
MPI_Op MPI_MIN_MySignedIntPosType
 
MPI_Op MPI_MAX_MySignedIntPosType
 

Detailed Description

declares some numerical values for MPI tags and function prototypes for MPI helper functions

Definition in file mpi_utils.h.

Macro Definition Documentation

◆ TAG_ALL_UPDATE

#define TAG_ALL_UPDATE   87

Definition at line 100 of file mpi_utils.h.

◆ TAG_BARRIER

#define TAG_BARRIER   82

Definition at line 95 of file mpi_utils.h.

◆ TAG_BH_A

#define TAG_BH_A   38

Definition at line 53 of file mpi_utils.h.

◆ TAG_BH_B

#define TAG_BH_B   39

Definition at line 54 of file mpi_utils.h.

◆ TAG_BHDATA

#define TAG_BHDATA   76

Definition at line 87 of file mpi_utils.h.

◆ TAG_CONDUCT_A

#define TAG_CONDUCT_A   43

Definition at line 58 of file mpi_utils.h.

◆ TAG_CONDUCT_B

#define TAG_CONDUCT_B   44

Definition at line 59 of file mpi_utils.h.

◆ TAG_DENS_A

#define TAG_DENS_A   35

Definition at line 50 of file mpi_utils.h.

◆ TAG_DENS_B

#define TAG_DENS_B   36

Definition at line 51 of file mpi_utils.h.

◆ TAG_DIRECT_A

#define TAG_DIRECT_A   20

Definition at line 35 of file mpi_utils.h.

◆ TAG_DIRECT_B

#define TAG_DIRECT_B   21

Definition at line 36 of file mpi_utils.h.

◆ TAG_DMOM

#define TAG_DMOM   15

Definition at line 30 of file mpi_utils.h.

◆ TAG_DRIFT_INIT

#define TAG_DRIFT_INIT   86

Definition at line 99 of file mpi_utils.h.

◆ TAG_ENRICH_A

#define TAG_ENRICH_A   42

Definition at line 57 of file mpi_utils.h.

◆ TAG_EWALD_ALLOC

#define TAG_EWALD_ALLOC   7

Definition at line 22 of file mpi_utils.h.

◆ TAG_FETCH_GRAVTREE

#define TAG_FETCH_GRAVTREE   1000

Definition at line 102 of file mpi_utils.h.

◆ TAG_FETCH_SPH_DENSITY

#define TAG_FETCH_SPH_DENSITY   2000

Definition at line 103 of file mpi_utils.h.

◆ TAG_FETCH_SPH_HYDRO

#define TAG_FETCH_SPH_HYDRO   3000

Definition at line 104 of file mpi_utils.h.

◆ TAG_FETCH_SPH_TREETIMESTEP

#define TAG_FETCH_SPH_TREETIMESTEP   4000

Definition at line 105 of file mpi_utils.h.

◆ TAG_FOF_A

#define TAG_FOF_A   45

Definition at line 60 of file mpi_utils.h.

◆ TAG_FOF_B

#define TAG_FOF_B   46

Definition at line 61 of file mpi_utils.h.

◆ TAG_FOF_C

#define TAG_FOF_C   47

Definition at line 62 of file mpi_utils.h.

◆ TAG_FOF_D

#define TAG_FOF_D   48

Definition at line 63 of file mpi_utils.h.

◆ TAG_FOF_E

#define TAG_FOF_E   49

Definition at line 64 of file mpi_utils.h.

◆ TAG_FOF_F

#define TAG_FOF_F   50

Definition at line 65 of file mpi_utils.h.

◆ TAG_FOF_G

#define TAG_FOF_G   51

Definition at line 66 of file mpi_utils.h.

◆ TAG_GRAD_A

#define TAG_GRAD_A   54

Definition at line 69 of file mpi_utils.h.

◆ TAG_GRAD_B

#define TAG_GRAD_B   55

Definition at line 70 of file mpi_utils.h.

◆ TAG_GRAV_A

#define TAG_GRAV_A   18

Definition at line 33 of file mpi_utils.h.

◆ TAG_GRAV_B

#define TAG_GRAV_B   19

Definition at line 34 of file mpi_utils.h.

◆ TAG_GRAVCOST_A

#define TAG_GRAVCOST_A   79

Definition at line 90 of file mpi_utils.h.

◆ TAG_GRAVCOST_B

#define TAG_GRAVCOST_B   80

Definition at line 91 of file mpi_utils.h.

◆ TAG_HEADER

#define TAG_HEADER   11

Definition at line 26 of file mpi_utils.h.

◆ TAG_HMAX

#define TAG_HMAX   17

Definition at line 32 of file mpi_utils.h.

◆ TAG_HOTNGB_A

#define TAG_HOTNGB_A   52

Definition at line 67 of file mpi_utils.h.

◆ TAG_HOTNGB_B

#define TAG_HOTNGB_B   53

Definition at line 68 of file mpi_utils.h.

◆ TAG_HYDRO_A

#define TAG_HYDRO_A   22

Definition at line 37 of file mpi_utils.h.

◆ TAG_HYDRO_B

#define TAG_HYDRO_B   23

Definition at line 38 of file mpi_utils.h.

◆ TAG_INJECT_A

#define TAG_INJECT_A   61

Definition at line 77 of file mpi_utils.h.

◆ TAG_KEY

#define TAG_KEY   14

Definition at line 29 of file mpi_utils.h.

◆ TAG_KEY_BH

#define TAG_KEY_BH   77

Definition at line 88 of file mpi_utils.h.

◆ TAG_KEY_SPH

#define TAG_KEY_SPH   71

Definition at line 80 of file mpi_utils.h.

◆ TAG_KEY_STAR

#define TAG_KEY_STAR   74

Definition at line 84 of file mpi_utils.h.

◆ TAG_LOCALN

#define TAG_LOCALN   37

Definition at line 52 of file mpi_utils.h.

◆ TAG_METDATA

#define TAG_METDATA   500

Definition at line 101 of file mpi_utils.h.

◆ TAG_N

#define TAG_N   10

Definition at line 25 of file mpi_utils.h.

◆ TAG_NFORTHISTASK

#define TAG_NFORTHISTASK   24

Definition at line 39 of file mpi_utils.h.

◆ TAG_NODE_DATA

#define TAG_NODE_DATA   84

Definition at line 97 of file mpi_utils.h.

◆ TAG_NODELEN

#define TAG_NODELEN   16

Definition at line 31 of file mpi_utils.h.

◆ TAG_NONPERIOD_A

#define TAG_NONPERIOD_A   29

Definition at line 44 of file mpi_utils.h.

◆ TAG_NONPERIOD_B

#define TAG_NONPERIOD_B   30

Definition at line 45 of file mpi_utils.h.

◆ TAG_NONPERIOD_C

#define TAG_NONPERIOD_C   31

Definition at line 46 of file mpi_utils.h.

◆ TAG_NONPERIOD_D

#define TAG_NONPERIOD_D   32

Definition at line 47 of file mpi_utils.h.

◆ TAG_PART_DATA

#define TAG_PART_DATA   83

Definition at line 96 of file mpi_utils.h.

◆ TAG_PDATA

#define TAG_PDATA   12

Definition at line 27 of file mpi_utils.h.

◆ TAG_PDATA_BH

#define TAG_PDATA_BH   75

Definition at line 86 of file mpi_utils.h.

◆ TAG_PDATA_SPH

#define TAG_PDATA_SPH   70

Definition at line 79 of file mpi_utils.h.

◆ TAG_PDATA_STAR

#define TAG_PDATA_STAR   72

Definition at line 82 of file mpi_utils.h.

◆ TAG_PERIODIC_A

#define TAG_PERIODIC_A   25

Definition at line 40 of file mpi_utils.h.

◆ TAG_PERIODIC_B

#define TAG_PERIODIC_B   26

Definition at line 41 of file mpi_utils.h.

◆ TAG_PERIODIC_C

#define TAG_PERIODIC_C   27

Definition at line 42 of file mpi_utils.h.

◆ TAG_PERIODIC_D

#define TAG_PERIODIC_D   28

Definition at line 43 of file mpi_utils.h.

◆ TAG_PM_FOLD

#define TAG_PM_FOLD   81

Definition at line 93 of file mpi_utils.h.

◆ TAG_POTENTIAL_A

#define TAG_POTENTIAL_A   33

Definition at line 48 of file mpi_utils.h.

◆ TAG_POTENTIAL_B

#define TAG_POTENTIAL_B   34

Definition at line 49 of file mpi_utils.h.

◆ TAG_RESULTS

#define TAG_RESULTS   85

Definition at line 98 of file mpi_utils.h.

◆ TAG_SE

#define TAG_SE   56

Definition at line 72 of file mpi_utils.h.

◆ TAG_SEARCH_A

#define TAG_SEARCH_A   58

Definition at line 74 of file mpi_utils.h.

◆ TAG_SEARCH_B

#define TAG_SEARCH_B   59

Definition at line 75 of file mpi_utils.h.

◆ TAG_SMOOTH_A

#define TAG_SMOOTH_A   40

Definition at line 55 of file mpi_utils.h.

◆ TAG_SMOOTH_B

#define TAG_SMOOTH_B   41

Definition at line 56 of file mpi_utils.h.

◆ TAG_SPHDATA

#define TAG_SPHDATA   13

Definition at line 28 of file mpi_utils.h.

◆ TAG_STARDATA

#define TAG_STARDATA   73

Definition at line 83 of file mpi_utils.h.

◆ TAG_TABLE_ALLOC

#define TAG_TABLE_ALLOC   8

Definition at line 23 of file mpi_utils.h.

◆ TAG_TABLE_FREE

#define TAG_TABLE_FREE   9

Definition at line 24 of file mpi_utils.h.

◆ TAG_TOPNODE_ALLOC

#define TAG_TOPNODE_ALLOC   6

Definition at line 21 of file mpi_utils.h.

◆ TAG_TOPNODE_FREE

#define TAG_TOPNODE_FREE   4

< Various tags used for labeling MPI messages

Definition at line 19 of file mpi_utils.h.

◆ TAG_TOPNODE_OFFSET

#define TAG_TOPNODE_OFFSET   5

Definition at line 20 of file mpi_utils.h.

Function Documentation

◆ allreduce_sparse_double_sum()

void allreduce_sparse_double_sum ( double *  loc,
double *  glob,
int  N,
MPI_Comm  comm 
)

Definition at line 25 of file allreduce_sparse_double_sum.cc.

◆ allreduce_sum()

void allreduce_sum ( T *  glob,
int  N,
MPI_Comm  Communicator 
)

Definition at line 145 of file mpi_utils.h.

◆ minimum_large_ints()

void minimum_large_ints ( int  n,
long long *  src,
long long *  res,
MPI_Comm  comm 
)

Definition at line 25 of file sums_and_minmax.cc.

◆ my_int_MPI_Alltoallv()

void my_int_MPI_Alltoallv ( void *  sendb,
int *  sendcounts,
int *  sdispls,
void *  recvb,
int *  recvcounts,
int *  rdispls,
int  len,
int  big_flag,
MPI_Comm  comm 
)

Definition at line 241 of file myalltoall.cc.

◆ my_mpi_types_init()

void my_mpi_types_init ( void  )

Definition at line 72 of file mpi_types.cc.

◆ myMPI_Allgatherv()

int myMPI_Allgatherv ( void *  sendbuf,
int  sendcount,
MPI_Datatype  sendtype,
void *  recvbuf,
int *  recvcount,
int *  displs,
MPI_Datatype  recvtype,
MPI_Comm  comm 
)

Definition at line 26 of file hypercube_allgatherv.cc.

◆ myMPI_Allreduce()

int myMPI_Allreduce ( const void *  sendbuf,
void *  recvbuf,
int  count,
MPI_Datatype  datatype,
MPI_Op  op,
MPI_Comm  comm 
)

Definition at line 24 of file allreduce_debugcheck.cc.

◆ myMPI_Alltoall()

int myMPI_Alltoall ( const void *  sendbuf,
int  sendcount,
MPI_Datatype  sendtype,
void *  recvbuf,
int  recvcount,
MPI_Datatype  recvtype,
MPI_Comm  comm 
)

Definition at line 301 of file myalltoall.cc.

◆ myMPI_Alltoallv()

void myMPI_Alltoallv ( void *  sendbuf,
size_t *  sendcounts,
size_t *  sdispls,
void *  recvbuf,
size_t *  recvcounts,
size_t *  rdispls,
int  len,
int  big_flag,
MPI_Comm  comm 
)

Definition at line 181 of file myalltoall.cc.

◆ myMPI_Alltoallv_new()

void myMPI_Alltoallv_new ( void *  sendb,
int *  sendcounts,
int *  sdispls,
MPI_Datatype  sendtype,
void *  recvb,
int *  recvcounts,
int *  rdispls,
MPI_Datatype  recvtype,
MPI_Comm  comm,
int  method 
)

Definition at line 74 of file myalltoall.cc.

◆ myMPI_Alltoallv_new_prep()

int myMPI_Alltoallv_new_prep ( int *  sendcnt,
int *  recvcnt,
int *  rdispls,
MPI_Comm  comm,
int  method 
)

Definition at line 36 of file myalltoall.cc.

◆ myMPI_Sendrecv()

int myMPI_Sendrecv ( void *  sendbuf,
size_t  sendcount,
MPI_Datatype  sendtype,
int  dest,
int  sendtag,
void *  recvbuf,
size_t  recvcount,
MPI_Datatype  recvtype,
int  source,
int  recvtag,
MPI_Comm  comm,
MPI_Status *  status 
)

Definition at line 25 of file sizelimited_sendrecv.cc.

◆ sumup_large_ints()

void sumup_large_ints ( int  n,
int *  src,
long long *  res,
MPI_Comm  comm 
)

Definition at line 33 of file sums_and_minmax.cc.

◆ sumup_longs()

void sumup_longs ( int  n,
long long *  src,
long long *  res,
MPI_Comm  comm 
)

Definition at line 44 of file sums_and_minmax.cc.

Variable Documentation

◆ MPI_MAX_MyIntPosType

MPI_Op MPI_MAX_MyIntPosType
extern

Definition at line 27 of file mpi_vars.cc.

◆ MPI_MAX_MySignedIntPosType

MPI_Op MPI_MAX_MySignedIntPosType
extern

Definition at line 29 of file mpi_vars.cc.

◆ MPI_MIN_MyIntPosType

MPI_Op MPI_MIN_MyIntPosType
extern

Definition at line 26 of file mpi_vars.cc.

◆ MPI_MIN_MySignedIntPosType

MPI_Op MPI_MIN_MySignedIntPosType
extern

Definition at line 28 of file mpi_vars.cc.

◆ MPI_MyIntPosType

MPI_Datatype MPI_MyIntPosType
extern

Definition at line 24 of file mpi_vars.cc.