HyPar  1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
MPIMax.c
Go to the documentation of this file.
1 
6 #include <mpivars.h>
7 
16  int *global,
17  int *var,
18  int size,
19  void *comm
20  )
21 {
22 #ifdef serial
23  int i;
24  for (i = 0; i < size; i++) global[i] = var[i];
25 #else
26  MPI_Allreduce((var==global?MPI_IN_PLACE:var),global,size,MPI_INT,MPI_MAX,*((MPI_Comm*)comm));
27 #endif
28  return(0);
29 }
30 
39  double *global,
40  double *var,
41  int size,
42  void *comm
43  )
44 {
45 #ifdef serial
46  int i;
47  for (i = 0; i < size; i++) global[i] = var[i];
48 #else
49  MPI_Allreduce((var==global?MPI_IN_PLACE:var),global,size,MPI_DOUBLE,MPI_MAX,*((MPI_Comm*)comm));
50 #endif
51  return(0);
52 }
MPI related function definitions.
int MPIMax_integer(int *global, int *var, int size, void *comm)
Definition: MPIMax.c:15
int MPIMax_double(double *global, double *var, int size, void *comm)
Definition: MPIMax.c:38