(git:e966546)
Loading...
Searching...
No Matches
cp_mpi.c File Reference
#include "cp_mpi.h"
#include <assert.h>
#include <omp.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

Go to the source code of this file.

Functions

void cp_mpi_init (int *argc, char ***argv)
 Wrapper around MPI_Init.
 
void cp_mpi_finalize (void)
 Wrapper around MPI_Finalize.
 
cp_mpi_comm_t cp_mpi_get_comm_world (void)
 Returns MPI_COMM_WORLD.
 
cp_mpi_comm_t cp_mpi_comm_f2c (const int fortran_comm)
 Wrapper around MPI_Comm_f2c.
 
int cp_mpi_comm_c2f (const cp_mpi_comm_t comm)
 Wrapper around MPI_Comm_c2f.
 
int cp_mpi_comm_rank (const cp_mpi_comm_t comm)
 Wrapper around MPI_Comm_rank.
 
int cp_mpi_comm_size (const cp_mpi_comm_t comm)
 Wrapper around MPI_Comm_size.
 
void cp_mpi_dims_create (const int nnodes, const int ndims, int dims[])
 Wrapper around MPI_Dims_create.
 
cp_mpi_comm_t cp_mpi_cart_create (const cp_mpi_comm_t comm_old, const int ndims, const int dims[], const int periods[], const int reorder)
 Wrapper around MPI_Cart_create.
 
void cp_mpi_cart_get (const cp_mpi_comm_t comm, int maxdims, int dims[], int periods[], int coords[])
 Wrapper around MPI_Cart_get.
 
int cp_mpi_cart_rank (const cp_mpi_comm_t comm, const int coords[])
 Wrapper around MPI_Cart_rank.
 
cp_mpi_comm_t cp_mpi_cart_sub (const cp_mpi_comm_t comm, const int remain_dims[])
 Wrapper around MPI_Cart_sub.
 
void cp_mpi_comm_free (cp_mpi_comm_t *comm)
 Wrapper around MPI_Comm_free.
 
bool cp_mpi_comms_are_similar (const cp_mpi_comm_t comm1, const cp_mpi_comm_t comm2)
 Wrapper around MPI_Comm_compare.
 
void cp_mpi_max_int (int *values, const int count, const cp_mpi_comm_t comm)
 Wrapper around MPI_Allreduce for op MPI_MAX and datatype MPI_INT.
 
void cp_mpi_max_uint64 (uint64_t *values, const int count, const cp_mpi_comm_t comm)
 Wrapper around MPI_Allreduce for op MPI_MAX and datatype MPI_UINT64_T.
 
void cp_mpi_max_double (double *values, const int count, const cp_mpi_comm_t comm)
 Wrapper around MPI_Allreduce for op MPI_MAX and datatype MPI_DOUBLE.
 
void cp_mpi_sum_int (int *values, const int count, const cp_mpi_comm_t comm)
 Wrapper around MPI_Allreduce for op MPI_SUM and datatype MPI_INT.
 
void cp_mpi_sum_int64 (int64_t *values, const int count, const cp_mpi_comm_t comm)
 Wrapper around MPI_Allreduce for op MPI_SUM and datatype MPI_INT64_T.
 
void cp_mpi_sum_double (double *values, const int count, const cp_mpi_comm_t comm)
 Wrapper around MPI_Allreduce for op MPI_SUM and datatype MPI_DOUBLE.
 
int cp_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 cp_mpi_comm_t comm)
 Wrapper around MPI_Sendrecv for datatype MPI_BYTE.
 
int cp_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 cp_mpi_comm_t comm)
 Wrapper around MPI_Sendrecv for datatype MPI_DOUBLE.
 
void cp_mpi_alltoall_int (const int *sendbuf, const int sendcount, int *recvbuf, const int recvcount, const cp_mpi_comm_t comm)
 Wrapper around MPI_Alltoall for datatype MPI_INT.
 
void cp_mpi_alltoallv_byte (const void *sendbuf, const int *sendcounts, const int *sdispls, void *recvbuf, const int *recvcounts, const int *rdispls, const cp_mpi_comm_t comm)
 Wrapper around MPI_Alltoallv for datatype MPI_BYTE.
 
void cp_mpi_alltoallv_double (const double *sendbuf, const int *sendcounts, const int *sdispls, double *recvbuf, const int *recvcounts, const int *rdispls, const cp_mpi_comm_t comm)
 Wrapper around MPI_Alltoallv for datatype MPI_DOUBLE.
 
void * cp_mpi_alloc_mem (size_t size)
 Wrapper around MPI_Alloc_mem.
 
void cp_mpi_free_mem (void *mem)
 Wrapper around MPI_Free_mem.
 

Function Documentation

◆ cp_mpi_init()

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

Wrapper around MPI_Init.

Author
Ole Schuett

Definition at line 34 of file cp_mpi.c.

Here is the caller graph for this function:

◆ cp_mpi_finalize()

void cp_mpi_finalize ( void  )

Wrapper around MPI_Finalize.

Author
Ole Schuett

Definition at line 47 of file cp_mpi.c.

Here is the caller graph for this function:

◆ cp_mpi_get_comm_world()

cp_mpi_comm_t cp_mpi_get_comm_world ( void  )

Returns MPI_COMM_WORLD.

Author
Ole Schuett

Definition at line 57 of file cp_mpi.c.

Here is the caller graph for this function:

◆ cp_mpi_comm_f2c()

cp_mpi_comm_t cp_mpi_comm_f2c ( const int  fortran_comm)

Wrapper around MPI_Comm_f2c.

Author
Ole Schuett

Definition at line 69 of file cp_mpi.c.

Here is the caller graph for this function:

◆ cp_mpi_comm_c2f()

int cp_mpi_comm_c2f ( const cp_mpi_comm_t  comm)

Wrapper around MPI_Comm_c2f.

Author
Ole Schuett

Definition at line 82 of file cp_mpi.c.

Here is the caller graph for this function:

◆ cp_mpi_comm_rank()

int cp_mpi_comm_rank ( const cp_mpi_comm_t  comm)

Wrapper around MPI_Comm_rank.

Author
Ole Schuett

Definition at line 95 of file cp_mpi.c.

Here is the caller graph for this function:

◆ cp_mpi_comm_size()

int cp_mpi_comm_size ( const cp_mpi_comm_t  comm)

Wrapper around MPI_Comm_size.

Author
Ole Schuett

Definition at line 110 of file cp_mpi.c.

Here is the caller graph for this function:

◆ cp_mpi_dims_create()

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

Wrapper around MPI_Dims_create.

Author
Ole Schuett

Definition at line 125 of file cp_mpi.c.

Here is the caller graph for this function:

◆ cp_mpi_cart_create()

cp_mpi_comm_t cp_mpi_cart_create ( const cp_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 140 of file cp_mpi.c.

Here is the caller graph for this function:

◆ cp_mpi_cart_get()

void cp_mpi_cart_get ( const cp_mpi_comm_t  comm,
int  maxdims,
int  dims[],
int  periods[],
int  coords[] 
)

Wrapper around MPI_Cart_get.

Author
Ole Schuett

Definition at line 161 of file cp_mpi.c.

Here is the caller graph for this function:

◆ cp_mpi_cart_rank()

int cp_mpi_cart_rank ( const cp_mpi_comm_t  comm,
const int  coords[] 
)

Wrapper around MPI_Cart_rank.

Author
Ole Schuett

Definition at line 179 of file cp_mpi.c.

Here is the caller graph for this function:

◆ cp_mpi_cart_sub()

cp_mpi_comm_t cp_mpi_cart_sub ( const cp_mpi_comm_t  comm,
const int  remain_dims[] 
)

Wrapper around MPI_Cart_sub.

Author
Ole Schuett

Definition at line 195 of file cp_mpi.c.

Here is the caller graph for this function:

◆ cp_mpi_comm_free()

void cp_mpi_comm_free ( cp_mpi_comm_t comm)

Wrapper around MPI_Comm_free.

Author
Ole Schuett

Definition at line 212 of file cp_mpi.c.

Here is the caller graph for this function:

◆ cp_mpi_comms_are_similar()

bool cp_mpi_comms_are_similar ( const cp_mpi_comm_t  comm1,
const cp_mpi_comm_t  comm2 
)

Wrapper around MPI_Comm_compare.

Author
Ole Schuett

Definition at line 224 of file cp_mpi.c.

Here is the caller graph for this function:

◆ cp_mpi_max_int()

void cp_mpi_max_int ( int *  values,
const int  count,
const cp_mpi_comm_t  comm 
)

Wrapper around MPI_Allreduce for op MPI_MAX and datatype MPI_INT.

Author
Ole Schuett

Definition at line 241 of file cp_mpi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cp_mpi_max_uint64()

void cp_mpi_max_uint64 ( uint64_t *  values,
const int  count,
const cp_mpi_comm_t  comm 
)

Wrapper around MPI_Allreduce for op MPI_MAX and datatype MPI_UINT64_T.

Author
Ole Schuett

Definition at line 261 of file cp_mpi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cp_mpi_max_double()

void cp_mpi_max_double ( double *  values,
const int  count,
const cp_mpi_comm_t  comm 
)

Wrapper around MPI_Allreduce for op MPI_MAX and datatype MPI_DOUBLE.

Author
Ole Schuett

Definition at line 283 of file cp_mpi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cp_mpi_sum_int()

void cp_mpi_sum_int ( int *  values,
const int  count,
const cp_mpi_comm_t  comm 
)

Wrapper around MPI_Allreduce for op MPI_SUM and datatype MPI_INT.

Author
Ole Schuett

Definition at line 305 of file cp_mpi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cp_mpi_sum_int64()

void cp_mpi_sum_int64 ( int64_t *  values,
const int  count,
const cp_mpi_comm_t  comm 
)

Wrapper around MPI_Allreduce for op MPI_SUM and datatype MPI_INT64_T.

Author
Ole Schuett

Definition at line 325 of file cp_mpi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cp_mpi_sum_double()

void cp_mpi_sum_double ( double *  values,
const int  count,
const cp_mpi_comm_t  comm 
)

Wrapper around MPI_Allreduce for op MPI_SUM and datatype MPI_DOUBLE.

Author
Ole Schuett

Definition at line 347 of file cp_mpi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cp_mpi_sendrecv_byte()

int cp_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 cp_mpi_comm_t  comm 
)

Wrapper around MPI_Sendrecv for datatype MPI_BYTE.

Author
Ole Schuett

Definition at line 369 of file cp_mpi.c.

Here is the caller graph for this function:

◆ cp_mpi_sendrecv_double()

int cp_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 cp_mpi_comm_t  comm 
)

Wrapper around MPI_Sendrecv for datatype MPI_DOUBLE.

Author
Ole Schuett

Definition at line 399 of file cp_mpi.c.

Here is the caller graph for this function:

◆ cp_mpi_alltoall_int()

void cp_mpi_alltoall_int ( const int *  sendbuf,
const int  sendcount,
int *  recvbuf,
const int  recvcount,
const cp_mpi_comm_t  comm 
)

Wrapper around MPI_Alltoall for datatype MPI_INT.

Author
Ole Schuett

Definition at line 429 of file cp_mpi.c.

Here is the caller graph for this function:

◆ cp_mpi_alltoallv_byte()

void cp_mpi_alltoallv_byte ( const void *  sendbuf,
const int *  sendcounts,
const int *  sdispls,
void *  recvbuf,
const int *  recvcounts,
const int *  rdispls,
const cp_mpi_comm_t  comm 
)

Wrapper around MPI_Alltoallv for datatype MPI_BYTE.

Author
Ole Schuett

Definition at line 445 of file cp_mpi.c.

Here is the caller graph for this function:

◆ cp_mpi_alltoallv_double()

void cp_mpi_alltoallv_double ( const double *  sendbuf,
const int *  sendcounts,
const int *  sdispls,
double *  recvbuf,
const int *  recvcounts,
const int *  rdispls,
const cp_mpi_comm_t  comm 
)

Wrapper around MPI_Alltoallv for datatype MPI_DOUBLE.

Author
Ole Schuett

Definition at line 464 of file cp_mpi.c.

Here is the caller graph for this function:

◆ cp_mpi_alloc_mem()

void * cp_mpi_alloc_mem ( size_t  size)

Wrapper around MPI_Alloc_mem.

Author
Hans Pabst

Definition at line 483 of file cp_mpi.c.

Here is the caller graph for this function:

◆ cp_mpi_free_mem()

void cp_mpi_free_mem ( void *  mem)

Wrapper around MPI_Free_mem.

Author
Hans Pabst

Definition at line 499 of file cp_mpi.c.

Here is the caller graph for this function: