Yet Another eXchange Tool  DO_NOT_EDIT_HERE
Data Structures | Typedefs | Enumerations | Functions | Variables
xt_redist_collection.c File Reference
#include <assert.h>
#include <limits.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <mpi.h>
#include "core/core.h"
#include "core/ppm_xfuncs.h"
#include "xt/xt_mpi.h"
#include "xt/xt_sort.h"
#include "xt_mpi_internal.h"
#include "xt/xt_redist_collection.h"
#include "ensure_array_size.h"
#include "xt/xt_redist.h"
#include "xt_redist_internal.h"
#include "xt_exchanger.h"
Include dependency graph for xt_redist_collection.c:

Go to the source code of this file.

Data Structures

struct  redist_collection_msg
 
struct  exchanger_cache
 
struct  Xt_redist_collection_
 

Typedefs

typedef struct Xt_redist_collection_Xt_redist_collection
 

Enumerations

enum  { DEFFAULT_DATATYPE_CACHE_SIZE =16 }
 

Functions

static void redist_collection_delete (Xt_redist redist)
 
static Xt_redist redist_collection_copy (Xt_redist redist)
 
static void redist_collection_s_exchange (Xt_redist redist, int num_src_arrays, const void **src_data, void **dst_data)
 
static void redist_collection_s_exchange1 (Xt_redist redist, const void *src_data, void *dst_data)
 
static MPI_Datatype redist_collection_get_send_MPI_Datatype (Xt_redist redist, int rank)
 
static MPI_Datatype redist_collection_get_recv_MPI_Datatype (Xt_redist redist, int rank)
 
static int redist_collection_get_msg_ranks (Xt_redist redist, enum xt_msg_direction direction, int **ranks)
 
static MPI_Comm redist_collection_get_MPI_Comm (Xt_redist redist)
 
static void copy_component_dt (struct redist_collection_msg **msgs, unsigned *nmsgs, Xt_redist *redists, unsigned num_redists, enum xt_msg_direction direction, MPI_Datatype(*get_MPI_datatype)(Xt_redist, int))
 
static void init_cache (struct exchanger_cache *cache, size_t cache_size, size_t ntx, unsigned num_redists)
 
static void destruct_cache (struct exchanger_cache *cache, size_t cache_size, size_t ntx, MPI_Comm comm)
 
Xt_redist xt_redist_collection_new (Xt_redist *redists, int num_redists, int cache_size, MPI_Comm comm)
 
static void create_all_dt_for_dir (struct redist_collection_msg *msgs, unsigned num_messages, unsigned num_redists, const MPI_Aint displacements[num_redists], struct Xt_redist_msg redist_msgs[num_messages], MPI_Comm comm)
 
static void compute_displ (const void *const *data, unsigned num_redists, MPI_Aint displacements[num_redists], MPI_Comm comm)
 
static size_t lookup_cache_index (unsigned num_redists, const MPI_Aint src_displacements[num_redists], const MPI_Aint dst_displacements[num_redists], const MPI_Aint(*cached_src_displacements)[num_redists], const MPI_Aint(*cached_dst_displacements)[num_redists], size_t cache_size)
 
static Xt_exchanger get_exchanger (const void *const *src_data, void *const *dst_data, struct redist_collection_msg *send_msgs, unsigned num_send_messages, struct redist_collection_msg *recv_msgs, unsigned num_recv_messages, unsigned num_redists, struct exchanger_cache *cache, size_t cache_size, MPI_Comm comm, int tag_offset)
 
static Xt_redist_collection xrc (void *redist)
 
static void copy_msgs (size_t num_redists, unsigned nmsgs, const struct redist_collection_msg *restrict msgs_orig, struct redist_collection_msg **p_msgs_copy, MPI_Comm comm)
 
static void free_redist_collection_msgs (struct redist_collection_msg *msgs, unsigned nmsgs, unsigned num_redists, MPI_Comm comm)
 
static MPI_Datatype redist_collection_get_send_MPI_Datatype (Xt_redist redist, int XT_UNUSED(rank))
 
static MPI_Datatype redist_collection_get_recv_MPI_Datatype (Xt_redist redist, int XT_UNUSED(rank))
 

Variables

static const struct xt_redist_vtable redist_collection_vtable
 

Detailed Description

Author
Jörg Behrens behre.nosp@m.ns@d.nosp@m.krz.d.nosp@m.e Moritz Hanke hanke.nosp@m.@dkr.nosp@m.z.de Thomas Jahns jahns.nosp@m.@dkr.nosp@m.z.de

Definition in file xt_redist_collection.c.

Typedef Documentation

◆ Xt_redist_collection

Definition at line 124 of file xt_redist_collection.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
DEFFAULT_DATATYPE_CACHE_SIZE 

Definition at line 69 of file xt_redist_collection.c.

Function Documentation

◆ compute_displ()

static void compute_displ ( const void *const *  data,
unsigned  num_redists,
MPI_Aint  displacements[num_redists],
MPI_Comm  comm 
)
static

Definition at line 286 of file xt_redist_collection.c.

Here is the caller graph for this function:

◆ copy_component_dt()

static void copy_component_dt ( struct redist_collection_msg **  msgs,
unsigned *  nmsgs,
Xt_redist redists,
unsigned  num_redists,
enum xt_msg_direction  direction,
MPI_Datatype(*)(Xt_redist, int)  get_MPI_datatype 
)
static

Definition at line 144 of file xt_redist_collection.c.

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

◆ copy_msgs()

static void copy_msgs ( size_t  num_redists,
unsigned  nmsgs,
const struct redist_collection_msg *restrict  msgs_orig,
struct redist_collection_msg **  p_msgs_copy,
MPI_Comm  comm 
)
static

Definition at line 430 of file xt_redist_collection.c.

Here is the caller graph for this function:

◆ create_all_dt_for_dir()

static void create_all_dt_for_dir ( struct redist_collection_msg msgs,
unsigned  num_messages,
unsigned  num_redists,
const MPI_Aint  displacements[num_redists],
struct Xt_redist_msg  redist_msgs[num_messages],
MPI_Comm  comm 
)
static

Definition at line 265 of file xt_redist_collection.c.

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

◆ destruct_cache()

static void destruct_cache ( struct exchanger_cache cache,
size_t  cache_size,
size_t  ntx,
MPI_Comm  comm 
)
inlinestatic

Definition at line 217 of file xt_redist_collection.c.

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

◆ free_redist_collection_msgs()

static void free_redist_collection_msgs ( struct redist_collection_msg msgs,
unsigned  nmsgs,
unsigned  num_redists,
MPI_Comm  comm 
)
static

Definition at line 480 of file xt_redist_collection.c.

Here is the caller graph for this function:

◆ get_exchanger()

static Xt_exchanger get_exchanger ( const void *const *  src_data,
void *const *  dst_data,
struct redist_collection_msg send_msgs,
unsigned  num_send_messages,
struct redist_collection_msg recv_msgs,
unsigned  num_recv_messages,
unsigned  num_redists,
struct exchanger_cache cache,
size_t  cache_size,
MPI_Comm  comm,
int  tag_offset 
)
static

Definition at line 322 of file xt_redist_collection.c.

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

◆ init_cache()

static void init_cache ( struct exchanger_cache cache,
size_t  cache_size,
size_t  ntx,
unsigned  num_redists 
)
inlinestatic

Definition at line 201 of file xt_redist_collection.c.

Here is the caller graph for this function:

◆ lookup_cache_index()

static size_t lookup_cache_index ( unsigned  num_redists,
const MPI_Aint  src_displacements[num_redists],
const MPI_Aint  dst_displacements[num_redists],
const MPI_Aint(*)  cached_src_displacements[num_redists],
const MPI_Aint(*)  cached_dst_displacements[num_redists],
size_t  cache_size 
)
static

Definition at line 302 of file xt_redist_collection.c.

Here is the caller graph for this function:

◆ redist_collection_copy()

static Xt_redist redist_collection_copy ( Xt_redist  redist)
static

Definition at line 454 of file xt_redist_collection.c.

Here is the call graph for this function:

◆ redist_collection_delete()

static void redist_collection_delete ( Xt_redist  redist)
static

Definition at line 496 of file xt_redist_collection.c.

Here is the call graph for this function:

◆ redist_collection_get_MPI_Comm()

static MPI_Comm redist_collection_get_MPI_Comm ( Xt_redist  redist)
static

Definition at line 577 of file xt_redist_collection.c.

Here is the call graph for this function:

◆ redist_collection_get_msg_ranks()

static int redist_collection_get_msg_ranks ( Xt_redist  redist,
enum xt_msg_direction  direction,
int **  ranks 
)
static

Definition at line 555 of file xt_redist_collection.c.

Here is the call graph for this function:

◆ redist_collection_get_recv_MPI_Datatype() [1/2]

static MPI_Datatype redist_collection_get_recv_MPI_Datatype ( Xt_redist  redist,
int  rank 
)
static

◆ redist_collection_get_recv_MPI_Datatype() [2/2]

static MPI_Datatype redist_collection_get_recv_MPI_Datatype ( Xt_redist  redist,
int   XT_UNUSEDrank 
)
static

Definition at line 530 of file xt_redist_collection.c.

Here is the call graph for this function:

◆ redist_collection_get_send_MPI_Datatype() [1/2]

static MPI_Datatype redist_collection_get_send_MPI_Datatype ( Xt_redist  redist,
int  rank 
)
static

◆ redist_collection_get_send_MPI_Datatype() [2/2]

static MPI_Datatype redist_collection_get_send_MPI_Datatype ( Xt_redist  redist,
int   XT_UNUSEDrank 
)
static

Definition at line 518 of file xt_redist_collection.c.

Here is the call graph for this function:

◆ redist_collection_s_exchange()

static void redist_collection_s_exchange ( Xt_redist  redist,
int  num_src_arrays,
const void **  src_data,
void **  dst_data 
)
static

Definition at line 402 of file xt_redist_collection.c.

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

◆ redist_collection_s_exchange1()

static void redist_collection_s_exchange1 ( Xt_redist  redist,
const void *  src_data,
void *  dst_data 
)
static

Definition at line 542 of file xt_redist_collection.c.

Here is the call graph for this function:

◆ xrc()

static Xt_redist_collection xrc ( void *  redist)
inlinestatic

Definition at line 396 of file xt_redist_collection.c.

Here is the caller graph for this function:

◆ xt_redist_collection_new()

Xt_redist xt_redist_collection_new ( Xt_redist redists,
int  num_redists,
int  cache_size,
MPI_Comm  comm 
)

constructor for a redistribution collection that is comprised of multiple other redistributions

Parameters
[in]redistsredistributions
[in]num_redistsnumber of redistributions
[in]cache_sizenumber of cached datatypes required for different input array displacements
n = -1 => default cache size
n = 0 => no cache
n > 0 => cache size = n
[in]commMPI communicator
Remarks
all redistributions need to be based on the same MPI communicator

Definition at line 230 of file xt_redist_collection.c.

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

Variable Documentation

◆ redist_collection_vtable

const struct xt_redist_vtable redist_collection_vtable
static
Initial value:
= {
.get_send_MPI_Datatype = redist_collection_get_send_MPI_Datatype,
.get_recv_MPI_Datatype = redist_collection_get_recv_MPI_Datatype,
}
static void redist_collection_s_exchange1(Xt_redist redist, const void *src_data, void *dst_data)
static Xt_redist redist_collection_copy(Xt_redist redist)
static MPI_Datatype redist_collection_get_send_MPI_Datatype(Xt_redist redist, int rank)
static MPI_Datatype redist_collection_get_recv_MPI_Datatype(Xt_redist redist, int rank)
static void redist_collection_delete(Xt_redist redist)
static void redist_collection_s_exchange(Xt_redist redist, int num_src_arrays, const void **src_data, void **dst_data)
static MPI_Comm redist_collection_get_MPI_Comm(Xt_redist redist)
static int redist_collection_get_msg_ranks(Xt_redist redist, enum xt_msg_direction direction, int **ranks)

Definition at line 99 of file xt_redist_collection.c.