YAC 3.13.0
Yet Another Coupler
Loading...
Searching...
No Matches
yac_mpi_internal.h File Reference
#include <stdint.h>
#include <mpi.h>
#include "utils_core.h"
#include "yac_mpi_common.h"
#include "yac_mpi.h"
Include dependency graph for yac_mpi_internal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  yac_group_comm
 

Macros

#define YAC_MPI_SIZE_T   MPI_UINT8_T
 
#define YAC_MPI_SIZE_T_TYPE   uint8_t
 
#define YAC_ALLTOALLV_P2P_DEC(N, T)
 

Functions

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, char const *caller, int line)
 
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)
 
void yac_allreduce_sum_dble (double *buffer, int count, struct yac_group_comm group_comm)
 
void yac_allgather_size_t (const size_t *sendbuf, size_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)
 
size_t yac_string_get_pack_size (char const *caller, char const *string, MPI_Comm comm, int allow_null)
 Compute number of bytes required to pack a string for MPI transport.
 
void yac_string_pack (char const *caller, char const *string, void *buffer, int buffer_size, int *position, MPI_Comm comm, int allow_null)
 Pack a C string into a provided buffer using MPI_Pack semantics.
 
char * yac_string_unpack (void const *buffer, int buffer_size, int *position, MPI_Comm comm)
 Unpack a C string from a buffer packed with yac_string_pack.
 

Macro Definition Documentation

◆ YAC_ALLTOALLV_P2P_DEC

#define YAC_ALLTOALLV_P2P_DEC ( N,
T )
Value:
void yac_alltoallv_ ## N ## _p2p( \
T const * send_buffer, size_t const * sendcounts, size_t const * sdispls, \
T * recv_buffer, size_t const * recvcounts, size_t const * rdispls, \
MPI_Comm comm, char const * caller, int line); \
#define N
double * send_buffer
double * recv_buffer

Definition at line 36 of file yac_mpi_internal.h.

◆ YAC_MPI_SIZE_T

#define YAC_MPI_SIZE_T   MPI_UINT8_T

Definition at line 15 of file yac_mpi_internal.h.

◆ YAC_MPI_SIZE_T_TYPE

#define YAC_MPI_SIZE_T_TYPE   uint8_t

Definition at line 16 of file yac_mpi_internal.h.

Function Documentation

◆ yac_allgather_size_t()

void yac_allgather_size_t ( const size_t * sendbuf,
size_t * recvbuf,
int count,
struct yac_group_comm group_comm )

Definition at line 368 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 )

Definition at line 296 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,
char const * caller,
int line )

Definition at line 132 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 243 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 )

Definition at line 412 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 557 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 634 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 578 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 537 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 603 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)

Definition at line 487 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)

Definition at line 500 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)

Definition at line 506 of file yac_mpi.c.

◆ yac_group_comm_get_rank()

int yac_group_comm_get_rank ( struct yac_group_comm group_comm)

Definition at line 492 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)

Definition at line 496 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)

Definition at line 477 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 )

Definition at line 512 of file yac_mpi.c.

Here is the caller graph for this function:

◆ yac_string_get_pack_size()

size_t yac_string_get_pack_size ( char const * caller,
char const * string,
MPI_Comm comm,
int allow_null )

Compute number of bytes required to pack a string for MPI transport.

This function returns the number of bytes that will be required to pack the given C string using MPI_Pack semantics on the provided communicator. If allow_null is non-zero, a NULL string is permitted and the returned size accounts for the representation of a NULL string.

Parameters
[in]callerName of the calling function (used for diagnostics).
[in]stringNULL-terminated C string to measure, or NULL if allowed.
[in]commMPI communicator whose datatype sizing semantics are used.
[in]allow_nullNon-zero if NULL strings are permitted.
Returns
Number of bytes required to pack string (may be zero).

Definition at line 646 of file yac_mpi.c.

Here is the caller graph for this function:

◆ yac_string_pack()

void yac_string_pack ( char const * caller,
char const * string,
void * buffer,
int buffer_size,
int * position,
MPI_Comm comm,
int allow_null )

Pack a C string into a provided buffer using MPI_Pack semantics.

Packs the given NULL-terminated string (or the representation of NULL if allow_null is non-zero) into buffer starting at *position. The position is updated to point immediately after the packed data.

The function will use buffer_size to ensure no overflow is performed; if there is insufficient space, behavior depends on the MPI implementation (typically MPI_Pack will return an error).

Parameters
[in]callerName of the calling function (used for diagnostics).
[in]stringNULL-terminated C string to pack, or NULL if allowed.
[out]bufferDestination buffer for packed data.
[in]buffer_sizeSize of buffer in bytes.
[in,out]positionPointer to current pack position; updated on return.
[in]commMPI communicator used for packing.
[in]allow_nullNon-zero if NULL strings are permitted.

Definition at line 667 of file yac_mpi.c.

Here is the caller graph for this function:

◆ yac_string_unpack()

char * yac_string_unpack ( void const * buffer,
int buffer_size,
int * position,
MPI_Comm comm )

Unpack a C string from a buffer packed with yac_string_pack.

Unpacks a string from buffer at *position using MPI_Unpack semantics. The returned pointer is a newly allocated NULL-terminated C string which the caller is responsible for freeing with free(). If a NULL-string sentinel was packed (when allow_null was used during packing), this function returns NULL.

Parameters
[in]bufferSource buffer containing packed data.
[in]buffer_sizeSize of buffer in bytes.
[in,out]positionPointer to current unpack position; updated on return.
[in]commMPI communicator used for unpacking.
Returns
Pointer to freshly allocated NUL-terminated string, or NULL if a NULL sentinel was unpacked. Caller must free the returned pointer.

Definition at line 697 of file yac_mpi.c.

Here is the caller graph for this function: