(git:34ef472)
dbm_mpi.c File Reference
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "dbm_mpi.h"

Go to the source code of this file.

Functions

void dbm_mpi_init (int *argc, char ***argv)
 Wrapper around MPI_Init. More...
 
void dbm_mpi_finalize ()
 Wrapper around MPI_Finalize. More...
 
dbm_mpi_comm_t dbm_mpi_get_comm_world ()
 Returns MPI_COMM_WORLD. More...
 
dbm_mpi_comm_t dbm_mpi_comm_f2c (const int fortran_comm)
 Wrapper around MPI_Comm_f2c. More...
 
int dbm_mpi_comm_c2f (const dbm_mpi_comm_t comm)
 Wrapper around MPI_Comm_c2f. More...
 
int dbm_mpi_comm_rank (const dbm_mpi_comm_t comm)
 Wrapper around MPI_Comm_rank. More...
 
int dbm_mpi_comm_size (const dbm_mpi_comm_t comm)
 Wrapper around MPI_Comm_size. More...
 
void dbm_mpi_dims_create (const int nnodes, const int ndims, int dims[])
 Wrapper around MPI_Dims_create. More...
 
dbm_mpi_comm_t dbm_mpi_cart_create (const dbm_mpi_comm_t comm_old, const int ndims, const int dims[], const int periods[], const int reorder)
 Wrapper around MPI_Cart_create. More...
 
void dbm_mpi_cart_get (const dbm_mpi_comm_t comm, int maxdims, int dims[], int periods[], int coords[])
 Wrapper around MPI_Cart_get. More...
 
int dbm_mpi_cart_rank (const dbm_mpi_comm_t comm, const int coords[])
 Wrapper around MPI_Cart_rank. More...
 
dbm_mpi_comm_t dbm_mpi_cart_sub (const dbm_mpi_comm_t comm, const int remain_dims[])
 Wrapper around MPI_Cart_sub. More...
 
void dbm_mpi_comm_free (dbm_mpi_comm_t *comm)
 Wrapper around MPI_Comm_free. More...
 
bool dbm_mpi_comms_are_similar (const dbm_mpi_comm_t comm1, const dbm_mpi_comm_t comm2)
 Wrapper around MPI_Comm_compare. More...
 
void dbm_mpi_max_int (int *values, const int count, const dbm_mpi_comm_t comm)
 Wrapper around MPI_Allreduce for op MPI_MAX and datatype MPI_INT. More...
 
void dbm_mpi_max_double (double *values, const int count, const dbm_mpi_comm_t comm)
 Wrapper around MPI_Allreduce for op MPI_MAX and datatype MPI_DOUBLE. More...
 
void dbm_mpi_sum_int (int *values, const int count, const dbm_mpi_comm_t comm)
 Wrapper around MPI_Allreduce for op MPI_SUM and datatype MPI_INT. More...
 
void dbm_mpi_sum_int64 (int64_t *values, const int count, const dbm_mpi_comm_t comm)
 Wrapper around MPI_Allreduce for op MPI_SUM and datatype MPI_INT64_T. More...
 
void dbm_mpi_sum_double (double *values, const int count, const dbm_mpi_comm_t comm)
 Wrapper around MPI_Allreduce for op MPI_SUM and datatype MPI_DOUBLE. More...
 
int dbm_mpi_sendrecv_byte (const void *sendbuf, const int sendcount, const int dest, const int sendtag, void *recvbuf, const int recvcount, const int source, const int recvtag, const dbm_mpi_comm_t comm)
 Wrapper around MPI_Sendrecv for datatype MPI_BYTE. More...
 
int dbm_mpi_sendrecv_double (const double *sendbuf, const int sendcount, const int dest, const int sendtag, double *recvbuf, const int recvcount, const int source, const int recvtag, const dbm_mpi_comm_t comm)
 Wrapper around MPI_Sendrecv for datatype MPI_DOUBLE. More...
 
void dbm_mpi_alltoall_int (const int *sendbuf, const int sendcount, int *recvbuf, const int recvcount, const dbm_mpi_comm_t comm)
 Wrapper around MPI_Alltoall for datatype MPI_INT. More...
 
void dbm_mpi_alltoallv_byte (const void *sendbuf, const int *sendcounts, const int *sdispls, void *recvbuf, const int *recvcounts, const int *rdispls, const dbm_mpi_comm_t comm)
 Wrapper around MPI_Alltoallv for datatype MPI_BYTE. More...
 
void dbm_mpi_alltoallv_double (const double *sendbuf, const int *sendcounts, const int *sdispls, double *recvbuf, const int *recvcounts, const int *rdispls, const dbm_mpi_comm_t comm)
 Wrapper around MPI_Alltoallv for datatype MPI_DOUBLE. More...
 

Function Documentation

◆ dbm_mpi_init()

void dbm_mpi_init ( int *  argc,
char ***  argv 
)

Wrapper around MPI_Init.

Author
Ole Schuett

Definition at line 31 of file dbm_mpi.c.

Here is the caller graph for this function:

◆ dbm_mpi_finalize()

void dbm_mpi_finalize ( )

Wrapper around MPI_Finalize.

Author
Ole Schuett

Definition at line 44 of file dbm_mpi.c.

◆ dbm_mpi_get_comm_world()

dbm_mpi_comm_t dbm_mpi_get_comm_world ( )

Returns MPI_COMM_WORLD.

Author
Ole Schuett

Definition at line 54 of file dbm_mpi.c.

Here is the caller graph for this function:

◆ dbm_mpi_comm_f2c()

dbm_mpi_comm_t dbm_mpi_comm_f2c ( const int  fortran_comm)

Wrapper around MPI_Comm_f2c.

Author
Ole Schuett

Definition at line 66 of file dbm_mpi.c.

Here is the caller graph for this function:

◆ dbm_mpi_comm_c2f()

int dbm_mpi_comm_c2f ( const dbm_mpi_comm_t  comm)

Wrapper around MPI_Comm_c2f.

Author
Ole Schuett

Definition at line 79 of file dbm_mpi.c.

Here is the caller graph for this function:

◆ dbm_mpi_comm_rank()

int dbm_mpi_comm_rank ( const dbm_mpi_comm_t  comm)

Wrapper around MPI_Comm_rank.

Author
Ole Schuett

Definition at line 92 of file dbm_mpi.c.

Here is the caller graph for this function:

◆ dbm_mpi_comm_size()

int dbm_mpi_comm_size ( const dbm_mpi_comm_t  comm)

Wrapper around MPI_Comm_size.

Author
Ole Schuett

Definition at line 107 of file dbm_mpi.c.

Here is the caller graph for this function:

◆ dbm_mpi_dims_create()

void dbm_mpi_dims_create ( const int  nnodes,
const int  ndims,
int  dims[] 
)

Wrapper around MPI_Dims_create.

Author
Ole Schuett

Definition at line 122 of file dbm_mpi.c.

Here is the caller graph for this function:

◆ dbm_mpi_cart_create()

dbm_mpi_comm_t dbm_mpi_cart_create ( const dbm_mpi_comm_t  comm_old,
const int  ndims,
const int  dims[],
const int  periods[],
const int  reorder 
)

Wrapper around MPI_Cart_create.

Author
Ole Schuett

Definition at line 137 of file dbm_mpi.c.

Here is the caller graph for this function:

◆ dbm_mpi_cart_get()

void dbm_mpi_cart_get ( const dbm_mpi_comm_t  comm,
int  maxdims,
int  dims[],
int  periods[],
int  coords[] 
)

Wrapper around MPI_Cart_get.

Author
Ole Schuett

Definition at line 158 of file dbm_mpi.c.

Here is the caller graph for this function:

◆ dbm_mpi_cart_rank()

int dbm_mpi_cart_rank ( const dbm_mpi_comm_t  comm,
const int  coords[] 
)

Wrapper around MPI_Cart_rank.

Author
Ole Schuett

Definition at line 176 of file dbm_mpi.c.

◆ dbm_mpi_cart_sub()

dbm_mpi_comm_t dbm_mpi_cart_sub ( const dbm_mpi_comm_t  comm,
const int  remain_dims[] 
)

Wrapper around MPI_Cart_sub.

Author
Ole Schuett

Definition at line 192 of file dbm_mpi.c.

◆ dbm_mpi_comm_free()

void dbm_mpi_comm_free ( dbm_mpi_comm_t comm)

Wrapper around MPI_Comm_free.

Author
Ole Schuett

Definition at line 209 of file dbm_mpi.c.

◆ dbm_mpi_comms_are_similar()

bool dbm_mpi_comms_are_similar ( const dbm_mpi_comm_t  comm1,
const dbm_mpi_comm_t  comm2 
)

Wrapper around MPI_Comm_compare.

Author
Ole Schuett

Definition at line 221 of file dbm_mpi.c.

◆ dbm_mpi_max_int()

void dbm_mpi_max_int ( int *  values,
const int  count,
const dbm_mpi_comm_t  comm 
)

Wrapper around MPI_Allreduce for op MPI_MAX and datatype MPI_INT.

Author
Ole Schuett

Definition at line 238 of file dbm_mpi.c.

◆ dbm_mpi_max_double()

void dbm_mpi_max_double ( double *  values,
const int  count,
const dbm_mpi_comm_t  comm 
)

Wrapper around MPI_Allreduce for op MPI_MAX and datatype MPI_DOUBLE.

Author
Ole Schuett

Definition at line 255 of file dbm_mpi.c.

Here is the caller graph for this function:

◆ dbm_mpi_sum_int()

void dbm_mpi_sum_int ( int *  values,
const int  count,
const dbm_mpi_comm_t  comm 
)

Wrapper around MPI_Allreduce for op MPI_SUM and datatype MPI_INT.

Author
Ole Schuett

Definition at line 273 of file dbm_mpi.c.

Here is the caller graph for this function:

◆ dbm_mpi_sum_int64()

void dbm_mpi_sum_int64 ( int64_t *  values,
const int  count,
const dbm_mpi_comm_t  comm 
)

Wrapper around MPI_Allreduce for op MPI_SUM and datatype MPI_INT64_T.

Author
Ole Schuett

Definition at line 290 of file dbm_mpi.c.

Here is the caller graph for this function:

◆ dbm_mpi_sum_double()

void dbm_mpi_sum_double ( double *  values,
const int  count,
const dbm_mpi_comm_t  comm 
)

Wrapper around MPI_Allreduce for op MPI_SUM and datatype MPI_DOUBLE.

Author
Ole Schuett

Definition at line 308 of file dbm_mpi.c.

Here is the caller graph for this function:

◆ dbm_mpi_sendrecv_byte()

int dbm_mpi_sendrecv_byte ( const void *  sendbuf,
const int  sendcount,
const int  dest,
const int  sendtag,
void *  recvbuf,
const int  recvcount,
const int  source,
const int  recvtag,
const dbm_mpi_comm_t  comm 
)

Wrapper around MPI_Sendrecv for datatype MPI_BYTE.

Author
Ole Schuett

Definition at line 326 of file dbm_mpi.c.

Here is the caller graph for this function:

◆ dbm_mpi_sendrecv_double()

int dbm_mpi_sendrecv_double ( const double *  sendbuf,
const int  sendcount,
const int  dest,
const int  sendtag,
double *  recvbuf,
const int  recvcount,
const int  source,
const int  recvtag,
const dbm_mpi_comm_t  comm 
)

Wrapper around MPI_Sendrecv for datatype MPI_DOUBLE.

Author
Ole Schuett

Definition at line 356 of file dbm_mpi.c.

Here is the caller graph for this function:

◆ dbm_mpi_alltoall_int()

void dbm_mpi_alltoall_int ( const int *  sendbuf,
const int  sendcount,
int *  recvbuf,
const int  recvcount,
const dbm_mpi_comm_t  comm 
)

Wrapper around MPI_Alltoall for datatype MPI_INT.

Author
Ole Schuett

Definition at line 386 of file dbm_mpi.c.

◆ dbm_mpi_alltoallv_byte()

void dbm_mpi_alltoallv_byte ( const void *  sendbuf,
const int *  sendcounts,
const int *  sdispls,
void *  recvbuf,
const int *  recvcounts,
const int *  rdispls,
const dbm_mpi_comm_t  comm 
)

Wrapper around MPI_Alltoallv for datatype MPI_BYTE.

Author
Ole Schuett

Definition at line 402 of file dbm_mpi.c.

◆ dbm_mpi_alltoallv_double()

void dbm_mpi_alltoallv_double ( const double *  sendbuf,
const int *  sendcounts,
const int *  sdispls,
double *  recvbuf,
const int *  recvcounts,
const int *  rdispls,
const dbm_mpi_comm_t  comm 
)

Wrapper around MPI_Alltoallv for datatype MPI_DOUBLE.

Author
Ole Schuett

Definition at line 421 of file dbm_mpi.c.