HyPar  1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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 }
int MPIMax_integer(int *, int *, int, void *)
Definition: MPIMax.c:15
MPI related function definitions.
int MPIMax_double(double *, double *, int, void *)
Definition: MPIMax.c:38