YetAnotherCoupler 3.4.0
Loading...
Searching...
No Matches
yac_mpi.c File Reference
#include "config.h"
#include <assert.h>
#include <inttypes.h>
#include <limits.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <mpi.h>
#include "yac_mpi_internal.h"
#include "geometry.h"
#include "ensure_array_size.h"
#include "ppm/core.h"
Include dependency graph for yac_mpi.c:

Go to the source code of this file.

Macros

#define XSTR(s)   STR(s)
 
#define STR(s)   #s
 
#define USE_P2P_ALLTOALLV
 
#define YAC_ALLTOALL_P2P_TYPE(NAME, TYPE, TYPE_SIZE, MPI_TYPE)
 
#define OPENMPI_WORKAROUND
 

Functions

int yac_mpi_is_initialised ()
 
void yac_yaxt_init (MPI_Comm comm)
 
void yac_yaxt_init_f2c (MPI_Fint comm)
 
static void yac_yaxt_cleanup ()
 
void yac_mpi_init ()
 
void yac_mpi_cleanup ()
 
void yac_mpi_finalize ()
 
void yac_mpi_error (int error_code, MPI_Comm comm)
 
void yac_alltoallv_p2p (void const *send_buffer, size_t const *sendcounts, size_t const *sdispls, void *recv_buffer, size_t const *recvcounts, size_t const *rdispls, size_t dt_size, MPI_Datatype dt, MPI_Comm comm)
 
void yac_alltoallv_p2p_group (void const *send_buffer, int const *sendcounts, int const *sdispls, void *recv_buffer, int const *recvcounts, int const *rdispls, size_t dt_size, MPI_Datatype dt, struct yac_group_comm group_comm)
 
static int nearest_power_of_two (int x)
 
void yac_allreduce_sum_dble (double *buffer, int count, struct yac_group_comm group_comm)
 
static int log2_ (int x)
 
void yac_allgather_uint64 (const uint64_t *sendbuf, uint64_t *recvbuf, int count, struct yac_group_comm group_comm)
 
void yac_bcast_group (void *buffer, int count, MPI_Datatype datatype, int root, struct yac_group_comm group_comm)
 
struct yac_group_comm yac_group_comm_new (MPI_Comm comm)
 
void yac_group_comm_delete (struct yac_group_comm group_comm)
 
int yac_group_comm_get_rank (struct yac_group_comm group_comm)
 
int yac_group_comm_get_size (struct yac_group_comm group_comm)
 
int yac_group_comm_get_global_rank (struct yac_group_comm group_comm)
 
int yac_group_comm_get_global_size (struct yac_group_comm group_comm)
 
void yac_group_comm_split (struct yac_group_comm group_comm, int split_rank, struct yac_group_comm *local_group_comm, struct yac_group_comm *remote_group_comm)
 
MPI_Datatype yac_get_bounding_circle_mpi_datatype (MPI_Comm comm)
 
MPI_Datatype yac_create_resized (MPI_Datatype dt, size_t new_size, MPI_Comm comm)
 
void yac_generate_alltoallv_args (int count, size_t const *sendcounts, size_t *recvcounts, size_t *sdispls, size_t *rdispls, MPI_Comm comm)
 
void yac_get_comm_buffers (int count, size_t **sendcounts, size_t **recvcounts, size_t **sdispls, size_t **rdispls, MPI_Comm comm)
 
void yac_free_comm_buffers (size_t *sendcounts, size_t *recvcounts, size_t *sdispls, size_t *rdispls)
 

Variables

static int mpi_initialised_by_yac = 0
 
static int yaxt_initialised_by_yac = 0
 
static int init_count = 0
 
static int yaxt_init_count = 0
 
static size_t * comm_buffer = NULL
 
static size_t comm_buffer_array_size = 0
 
static int comm_buffer_in_use = 0
 

Macro Definition Documentation

◆ OPENMPI_WORKAROUND

#define OPENMPI_WORKAROUND

◆ STR

#define STR ( s)    #s

Definition at line 75 of file yac_mpi.c.

◆ USE_P2P_ALLTOALLV

#define USE_P2P_ALLTOALLV

◆ XSTR

#define XSTR ( s)    STR(s)

Definition at line 74 of file yac_mpi.c.

◆ YAC_ALLTOALL_P2P_TYPE

#define YAC_ALLTOALL_P2P_TYPE ( NAME,
TYPE,
TYPE_SIZE,
MPI_TYPE )
Value:
void yac_alltoallv_ ## NAME ## _p2p( \
TYPE const * send_buffer, size_t const * sendcounts, size_t const * sdispls, \
TYPE * recv_buffer, size_t const * recvcounts, size_t const * rdispls, \
MPI_Comm comm) { \
yac_alltoallv_p2p( \
(void const *)send_buffer, sendcounts, sdispls, \
(void *)recv_buffer, recvcounts, rdispls, \
TYPE_SIZE, MPI_TYPE, comm); \
}

Definition at line 218 of file yac_mpi.c.

Function Documentation

◆ log2_()

static int log2_ ( int x)
static

Definition at line 353 of file yac_mpi.c.

Here is the caller graph for this function:

◆ nearest_power_of_two()

static int nearest_power_of_two ( int x)
static

Definition at line 280 of file yac_mpi.c.

Here is the caller graph for this function:

◆ yac_allgather_uint64()

void yac_allgather_uint64 ( const uint64_t * sendbuf,
uint64_t * recvbuf,
int count,
struct yac_group_comm group_comm )
Examples
test_group_comm.c.

Definition at line 361 of file yac_mpi.c.

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

◆ yac_allreduce_sum_dble()

void yac_allreduce_sum_dble ( double * buffer,
int count,
struct yac_group_comm group_comm )
Examples
test_group_comm.c.

Definition at line 289 of file yac_mpi.c.

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

◆ yac_alltoallv_p2p()

void yac_alltoallv_p2p ( void const * send_buffer,
size_t const * sendcounts,
size_t const * sdispls,
void * recv_buffer,
size_t const * recvcounts,
size_t const * rdispls,
size_t dt_size,
MPI_Datatype dt,
MPI_Comm comm )

Definition at line 131 of file yac_mpi.c.

Here is the caller graph for this function:

◆ yac_alltoallv_p2p_group()

void yac_alltoallv_p2p_group ( void const * send_buffer,
int const * sendcounts,
int const * sdispls,
void * recv_buffer,
int const * recvcounts,
int const * rdispls,
size_t dt_size,
MPI_Datatype dt,
struct yac_group_comm group_comm )

Definition at line 236 of file yac_mpi.c.

Here is the caller graph for this function:

◆ yac_bcast_group()

void yac_bcast_group ( void * buffer,
int count,
MPI_Datatype datatype,
int root,
struct yac_group_comm group_comm )
Examples
test_group_comm.c.

Definition at line 405 of file yac_mpi.c.

Here is the caller graph for this function:

◆ yac_create_resized()

MPI_Datatype yac_create_resized ( MPI_Datatype dt,
size_t new_size,
MPI_Comm comm )

Definition at line 550 of file yac_mpi.c.

Here is the caller graph for this function:

◆ yac_free_comm_buffers()

void yac_free_comm_buffers ( size_t * sendcounts,
size_t * recvcounts,
size_t * sdispls,
size_t * rdispls )

Definition at line 627 of file yac_mpi.c.

Here is the caller graph for this function:

◆ yac_generate_alltoallv_args()

void yac_generate_alltoallv_args ( int count,
size_t const * sendcounts,
size_t * recvcounts,
size_t * sdispls,
size_t * rdispls,
MPI_Comm comm )

Definition at line 571 of file yac_mpi.c.

Here is the caller graph for this function:

◆ yac_get_bounding_circle_mpi_datatype()

MPI_Datatype yac_get_bounding_circle_mpi_datatype ( MPI_Comm comm)

Definition at line 530 of file yac_mpi.c.

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

◆ yac_get_comm_buffers()

void yac_get_comm_buffers ( int count,
size_t ** sendcounts,
size_t ** recvcounts,
size_t ** sdispls,
size_t ** rdispls,
MPI_Comm comm )

Definition at line 596 of file yac_mpi.c.

Here is the caller graph for this function:

◆ yac_group_comm_delete()

void yac_group_comm_delete ( struct yac_group_comm group_comm)
Examples
test_group_comm.c.

Definition at line 480 of file yac_mpi.c.

Here is the caller graph for this function:

◆ yac_group_comm_get_global_rank()

int yac_group_comm_get_global_rank ( struct yac_group_comm group_comm)
Examples
test_group_comm.c.

Definition at line 493 of file yac_mpi.c.

Here is the caller graph for this function:

◆ yac_group_comm_get_global_size()

int yac_group_comm_get_global_size ( struct yac_group_comm group_comm)
Examples
test_group_comm.c.

Definition at line 499 of file yac_mpi.c.

◆ yac_group_comm_get_rank()

int yac_group_comm_get_rank ( struct yac_group_comm group_comm)
Examples
test_group_comm.c.

Definition at line 485 of file yac_mpi.c.

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

◆ yac_group_comm_get_size()

int yac_group_comm_get_size ( struct yac_group_comm group_comm)
Examples
test_group_comm.c.

Definition at line 489 of file yac_mpi.c.

Here is the caller graph for this function:

◆ yac_group_comm_new()

struct yac_group_comm yac_group_comm_new ( MPI_Comm comm)
Examples
test_group_comm.c.

Definition at line 470 of file yac_mpi.c.

Here is the caller graph for this function:

◆ yac_group_comm_split()

void yac_group_comm_split ( struct yac_group_comm group_comm,
int split_rank,
struct yac_group_comm * local_group_comm,
struct yac_group_comm * remote_group_comm )
Examples
test_group_comm.c.

Definition at line 505 of file yac_mpi.c.

Here is the caller graph for this function:

◆ yac_mpi_cleanup()

void yac_mpi_cleanup ( )

Definition at line 95 of file yac_mpi.c.

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

◆ yac_mpi_error()

void yac_mpi_error ( int error_code,
MPI_Comm comm )

report error return of MPI call

Parameters
[in]error_codereturn code of an MPI call
[in]commcommunicator which was used for the respective MPI call
Examples
test_mpi_error.c.

Definition at line 117 of file yac_mpi.c.

◆ yac_mpi_finalize()

void yac_mpi_finalize ( )

Definition at line 108 of file yac_mpi.c.

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

◆ yac_mpi_init()

void yac_mpi_init ( )

Definition at line 77 of file yac_mpi.c.

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

◆ yac_mpi_is_initialised()

int yac_mpi_is_initialised ( )

Definition at line 32 of file yac_mpi.c.

Here is the caller graph for this function:

◆ yac_yaxt_cleanup()

static void yac_yaxt_cleanup ( )
static

Definition at line 65 of file yac_mpi.c.

Here is the caller graph for this function:

◆ yac_yaxt_init()

void yac_yaxt_init ( MPI_Comm comm)

Definition at line 40 of file yac_mpi.c.

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

◆ yac_yaxt_init_f2c()

void yac_yaxt_init_f2c ( MPI_Fint comm)

Definition at line 60 of file yac_mpi.c.

Here is the call graph for this function:

Variable Documentation

◆ comm_buffer

size_t* comm_buffer = NULL
static

Definition at line 28 of file yac_mpi.c.

◆ comm_buffer_array_size

size_t comm_buffer_array_size = 0
static

Definition at line 29 of file yac_mpi.c.

◆ comm_buffer_in_use

int comm_buffer_in_use = 0
static

Definition at line 30 of file yac_mpi.c.

◆ init_count

int init_count = 0
static

Definition at line 25 of file yac_mpi.c.

◆ mpi_initialised_by_yac

int mpi_initialised_by_yac = 0
static

Definition at line 23 of file yac_mpi.c.

◆ yaxt_init_count

int yaxt_init_count = 0
static

Definition at line 26 of file yac_mpi.c.

◆ yaxt_initialised_by_yac

int yaxt_initialised_by_yac = 0
static

Definition at line 24 of file yac_mpi.c.