YetAnotherCoupler 3.5.2
Loading...
Searching...
No Matches
dist_merge.c File Reference
#include <string.h>
#include "dist_merge.h"
#include "utils_common.h"
Include dependency graph for dist_merge.c:

Go to the source code of this file.

Functions

static size_t get_pack_size (size_t count, unsigned char *array, size_t element_size, MPI_Comm comm, size_t(*element_get_pack_size)(void *element, MPI_Comm comm))
 
static void pack (size_t count, unsigned char *array, size_t element_size, void *buffer, int buffer_size, int *position, MPI_Comm comm, void(*element_pack)(void *element, void *buffer, int buffer_size, int *position, MPI_Comm))
 
static void unpack (void *buffer, int buffer_size, int *position, size_t *count, unsigned char **array, size_t element_size, MPI_Comm comm, void(*element_unpack)(void *buffer, int buffer_size, int *position, void *element, MPI_Comm comm))
 
void yac_dist_merge (size_t *count, void **array, size_t element_size, MPI_Comm comm, struct yac_dist_merge_vtable *vtable, size_t **idx_old_to_new)
 

Function Documentation

◆ get_pack_size()

static size_t get_pack_size ( size_t count,
unsigned char * array,
size_t element_size,
MPI_Comm comm,
size_t(* element_get_pack_size )(void *element, MPI_Comm comm) )
static

Definition at line 10 of file dist_merge.c.

Here is the caller graph for this function:

◆ pack()

static void pack ( size_t count,
unsigned char * array,
size_t element_size,
void * buffer,
int buffer_size,
int * position,
MPI_Comm comm,
void(* element_pack )(void *element, void *buffer, int buffer_size, int *position, MPI_Comm) )
static

Definition at line 27 of file dist_merge.c.

Here is the caller graph for this function:

◆ unpack()

static void unpack ( void * buffer,
int buffer_size,
int * position,
size_t * count,
unsigned char ** array,
size_t element_size,
MPI_Comm comm,
void(* element_unpack )(void *buffer, int buffer_size, int *position, void *element, MPI_Comm comm) )
static

Definition at line 44 of file dist_merge.c.

Here is the caller graph for this function:

◆ yac_dist_merge()

void yac_dist_merge ( size_t * count,
void ** array,
size_t element_size,
MPI_Comm comm,
struct yac_dist_merge_vtable * vtable,
size_t ** idx_old_to_new )

Distributes and merges an array across all processes in comm. After the call, the array will be the same on all processes.

Parameters
[in,out]countnumber of elements in the array
[in,out]arrayarray of elements to by synchronised
[in]element_sizesize of a single element
[in]commcommunicator
[in]vtablevirtual method table that is to be used for the synchronisation
[out]idx_old_to_newif idx_old_to_new != NULL this routine will allocate an array that has the original size of the input array. After the call the i'th element of the input array will be at position idx_old_to_new[i] in the new array.
Remarks
This routine can be applied recursively: The merge function may itself call yac_dist_merge to synchronise some of the additional information.

Definition at line 64 of file dist_merge.c.

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