HyPar  1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
MPIBroadcast.c File Reference

Functions to broadcast over all MPI ranks. More...

#include <mpivars.h>

Go to the source code of this file.

Functions

int MPIBroadcast_double (double *x, int size, int root, void *comm)
 
int MPIBroadcast_integer (int *x, int size, int root, void *comm)
 
int MPIBroadcast_character (char *x, int size, int root, void *comm)
 

Detailed Description

Functions to broadcast over all MPI ranks.

Author
Debojyoti Ghosh

Definition in file MPIBroadcast.c.

Function Documentation

◆ MPIBroadcast_double()

int MPIBroadcast_double ( double *  x,
int  size,
int  root,
void *  comm 
)

Broadcast an array of type double to all MPI ranks

Parameters
xarray to broadcast to all ranks
sizesize of array to broadcast
rootrank from which to broadcast
commMPI communicator within which to broadcast

Definition at line 9 of file MPIBroadcast.c.

15 {
16 #ifndef serial
17  MPI_Bcast(x,size,MPI_DOUBLE,root,*((MPI_Comm*)comm));
18 #endif
19  return(0);
20 }

◆ MPIBroadcast_integer()

int MPIBroadcast_integer ( int *  x,
int  size,
int  root,
void *  comm 
)

Broadcast an array of type int to all MPI ranks

Parameters
xarray to broadcast to all ranks
sizesize of array to broadcast
rootrank from which to broadcast
commMPI communicator within which to broadcast

Definition at line 23 of file MPIBroadcast.c.

29 {
30 #ifndef serial
31  MPI_Bcast(x,size,MPI_INT,root,*((MPI_Comm*)comm));
32 #endif
33  return(0);
34 }

◆ MPIBroadcast_character()

int MPIBroadcast_character ( char *  x,
int  size,
int  root,
void *  comm 
)

Broadcast an array of type char to all MPI ranks

Parameters
xarray to broadcast to all ranks
sizesize of array to broadcast
rootrank from which to broadcast
commMPI communicator within which to broadcast

Definition at line 37 of file MPIBroadcast.c.

43 {
44 #ifndef serial
45  MPI_Bcast(x,size,MPI_CHAR,root,*((MPI_Comm*)comm));
46 #endif
47  return(0);
48 }