Yet Another eXchange Tool  0.9.0
Classes | 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_mpi_internal.h"
#include "xt/xt_redist_collection.h"
#include "ensure_array_size.h"
#include "xt/xt_redist.h"
#include "xt/xt_request.h"
#include "xt_redist_internal.h"
#include "xt_exchanger.h"
#include "xt_config_internal.h"
Include dependency graph for xt_redist_collection.c:

Go to the source code of this file.

Classes

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_a_exchange (Xt_redist redist, int num_src_arrays, const void **src_data, void **dst_data, Xt_request *request)
 
static void redist_collection_s_exchange1 (Xt_redist redist, const void *src_data, void *dst_data)
 
static void redist_collection_a_exchange1 (Xt_redist redist, const void *src_data, void *dst_data, Xt_request *request)
 
static int redist_collection_get_num_msg (Xt_redist redist, enum xt_msg_direction direction)
 
static MPI_Datatype redist_collection_get_MPI_Datatype (Xt_redist redist, int rank, enum xt_msg_direction direction)
 
static int redist_collection_get_msg_ranks (Xt_redist redist, enum xt_msg_direction direction, int *restrict *ranks)
 
static MPI_Comm redist_collection_get_MPI_Comm (Xt_redist redist)
 
static void align_component_dt (unsigned num_redists, unsigned nmsgs, const Xt_redist *redists, int *restrict in_ranks[num_redists], size_t num_ranks[num_redists], int *out_ranks, MPI_Datatype *component_dt, enum xt_msg_direction direction)
 
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)
 
Xt_redist xt_redist_collection_custom_new (Xt_redist *redists, int num_redists, int cache_size, MPI_Comm comm, Xt_config config)
 
static void create_all_dt_for_dir (unsigned num_messages, unsigned num_redists, const int ranks[num_messages], const MPI_Datatype *component_dt, 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])
 
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 (struct Xt_redist_collection_ *redist_coll, const void *const *src_data, void *const *dst_data, unsigned num_redists)
 
static Xt_redist_collection xrc (void *redist)
 
static void copy_component_dt (size_t num_component_dt, const MPI_Datatype *component_dt_orig, MPI_Datatype *component_dt_copy, MPI_Comm comm)
 
static void free_component_dt (size_t num_dt, MPI_Datatype *all_component_dt, MPI_Comm comm)
 
static MPI_Datatype redist_collection_get_MPI_Datatype (Xt_redist redist, int XT_UNUSED(rank), enum xt_msg_direction XT_UNUSED(direction))
 

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 132 of file xt_redist_collection.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
DEFFAULT_DATATYPE_CACHE_SIZE 

Definition at line 70 of file xt_redist_collection.c.

Function Documentation

◆ align_component_dt()

static void align_component_dt ( unsigned  num_redists,
unsigned  nmsgs,
const Xt_redist redists,
int *restrict  in_ranks[num_redists],
size_t  num_ranks[num_redists],
int *  out_ranks,
MPI_Datatype *  component_dt,
enum xt_msg_direction  direction 
)
static

Definition at line 154 of file xt_redist_collection.c.

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

◆ compute_displ()

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

Definition at line 303 of file xt_redist_collection.c.

Here is the caller graph for this function:

◆ copy_component_dt()

static void copy_component_dt ( size_t  num_component_dt,
const MPI_Datatype *  component_dt_orig,
MPI_Datatype *  component_dt_copy,
MPI_Comm  comm 
)
static

Definition at line 470 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 ( unsigned  num_messages,
unsigned  num_redists,
const int  ranks[num_messages],
const MPI_Datatype *  component_dt,
const MPI_Aint  displacements[num_redists],
struct Xt_redist_msg  redist_msgs[num_messages],
MPI_Comm  comm 
)
static

Definition at line 279 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 208 of file xt_redist_collection.c.

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

◆ free_component_dt()

static void free_component_dt ( size_t  num_dt,
MPI_Datatype *  all_component_dt,
MPI_Comm  comm 
)
static

Definition at line 521 of file xt_redist_collection.c.

Here is the caller graph for this function:

◆ get_exchanger()

static Xt_exchanger get_exchanger ( struct Xt_redist_collection_ redist_coll,
const void *const *  src_data,
void *const *  dst_data,
unsigned  num_redists 
)
static

Definition at line 338 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 192 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 318 of file xt_redist_collection.c.

Here is the caller graph for this function:

◆ redist_collection_a_exchange()

static void redist_collection_a_exchange ( Xt_redist  redist,
int  num_src_arrays,
const void **  src_data,
void **  dst_data,
Xt_request request 
)
static

Definition at line 447 of file xt_redist_collection.c.

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

◆ redist_collection_a_exchange1()

static void redist_collection_a_exchange1 ( Xt_redist  redist,
const void *  src_data,
void *  dst_data,
Xt_request request 
)
static

Definition at line 579 of file xt_redist_collection.c.

Here is the call graph for this function:

◆ redist_collection_copy()

static Xt_redist redist_collection_copy ( Xt_redist  redist)
static

Definition at line 486 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 529 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 611 of file xt_redist_collection.c.

Here is the call graph for this function:

◆ redist_collection_get_MPI_Datatype() [1/2]

static MPI_Datatype redist_collection_get_MPI_Datatype ( Xt_redist  redist,
int  rank,
enum xt_msg_direction  direction 
)
static

◆ redist_collection_get_MPI_Datatype() [2/2]

static MPI_Datatype redist_collection_get_MPI_Datatype ( Xt_redist  redist,
int   XT_UNUSEDrank,
enum xt_msg_direction   XT_UNUSEDdirection 
)
static

Definition at line 553 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 *restrict *  ranks 
)
static

Definition at line 593 of file xt_redist_collection.c.

Here is the call graph for this function:

◆ redist_collection_get_num_msg()

static int redist_collection_get_num_msg ( Xt_redist  redist,
enum xt_msg_direction  direction 
)
static

Definition at line 546 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 426 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 566 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 420 of file xt_redist_collection.c.

Here is the caller graph for this function:

◆ xt_redist_collection_custom_new()

Xt_redist xt_redist_collection_custom_new ( Xt_redist redists,
int  num_redists,
int  cache_size,
MPI_Comm  comm,
Xt_config  config 
)

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

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
[in]configcustom configuration object
Remarks
all redistributions need to be based on the same MPI communicator
See Also
correct_addresses

Definition at line 227 of file xt_redist_collection.c.

Here is the call graph for this function:
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 with default settings

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
See Also
correct_addresses

Definition at line 220 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_msg_MPI_Datatype = redist_collection_get_MPI_Datatype,
}
static void redist_collection_a_exchange(Xt_redist redist, int num_src_arrays, const void **src_data, void **dst_data, Xt_request *request)
static MPI_Comm redist_collection_get_MPI_Comm(Xt_redist redist)
static void redist_collection_a_exchange1(Xt_redist redist, const void *src_data, void *dst_data, Xt_request *request)
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 void redist_collection_delete(Xt_redist redist)
static int redist_collection_get_msg_ranks(Xt_redist redist, enum xt_msg_direction direction, int *restrict *ranks)
static MPI_Datatype redist_collection_get_MPI_Datatype(Xt_redist redist, int rank, enum xt_msg_direction direction)
static int redist_collection_get_num_msg(Xt_redist redist, enum xt_msg_direction direction)

Definition at line 109 of file xt_redist_collection.c.