Yet Another eXchange Tool 0.11.3
Loading...
Searching...
No Matches
Macros | Functions
xt_redist_p2p.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <mpi.h>
#include "xt/xt_mpi.h"
#include "xt_mpi_internal.h"
#include "xt/xt_redist_p2p.h"
#include "xt_redist_internal.h"
#include "xt/xt_redist_single_array_base.h"
#include "xt/xt_xmap.h"
#include "xt/xt_idxlist.h"
#include "core/ppm_xfuncs.h"
#include "core/core.h"
#include "xt_config_internal.h"
#include "xt_arithmetic_util.h"
#include "xt_mpi_ddt_cache.h"
#include "xt_redist_p2p_ext.h"
Include dependency graph for xt_redist_p2p.c:

Go to the source code of this file.

Macros

#define XT_EXT_TYPE   struct Xt_offset_ext
 
#define XT_EXT_TAG   ext
 
#define XT_MPI_PARSE_STRIPE   xt_mpi_parse_stripe
 
#define XT_EXT_STRIDE_MASK   isign_mask_current_pos_ext_size
 
#define XT_EXT_STRIDE_MASK_PREP
 
#define XT_EXT_TYPE   struct Xt_aoffset_ext
 
#define XT_EXT_TAG   aext
 
#define XT_MPI_PARSE_STRIPE   xt_mpi_parse_astripe
 
#define XT_EXT_STRIDE_MASK   asign_mask_current_pos_ext_size
 
#define XT_EXT_STRIDE_MASK_PREP
 

Functions

static size_t xt_mdisp2ext_count (size_t disp_len, const int *disp, const int *pos)
 
static size_t xt_mdisp2ext (size_t disp_len, const int *disp, const int *pos, struct Xt_offset_ext *restrict v)
 
static MPI_Datatype generate_datatype (const int *transfer_pos, int num_transfer_pos, const int *offsets, size_t *vsize, struct Xt_offset_ext **v, struct Xt_mpi_strp_prs_params *params)
 
static void generate_msg_infos (int num_msgs, Xt_xmap_iter iter, const int *offsets, struct Xt_redist_msg *msgs, struct Xt_mpi_strp_prs_params *params)
 
Xt_redist xt_redist_p2p_off_new (Xt_xmap xmap, const int *src_offsets, const int *dst_offsets, MPI_Datatype datatype)
 
Xt_redist xt_redist_p2p_off_custom_new (Xt_xmap xmap, const int *src_offsets, const int *dst_offsets, MPI_Datatype datatype, Xt_config config)
 
static int pos2disp (int pos, int num_ext, const int psum_ext_size[])
 
static int pos2disp2 (int pos, int num_ext, const int psum_ext_size[], int start_ext)
 
static void aux_gen_simple_block_offsets (int block_offsets[], const int block_sizes[], size_t num_blocks)
 
static MPI_Datatype generate_block_datatype (const int *transfer_pos, int num_transfer_pos, const int *block_offsets, const int *block_sizes, struct Xt_mpi_strp_prs_params *params)
 
static void generate_block_msg_infos (int num_msgs, Xt_xmap_iter iter, const int *block_offsets, const int *block_sizes, int **aux_offsets, size_t num_blocks, struct Xt_mpi_strp_prs_params *params, struct Xt_redist_msg *msgs)
 
Xt_redist xt_redist_p2p_blocks_off_new (Xt_xmap xmap, const int *src_block_offsets, const int *src_block_sizes, int src_block_num, const int *dst_block_offsets, const int *dst_block_sizes, int dst_block_num, MPI_Datatype datatype)
 
Xt_redist xt_redist_p2p_blocks_off_custom_new (Xt_xmap xmap, const int *src_block_offsets, const int *src_block_sizes, int src_block_num, const int *dst_block_offsets, const int *dst_block_sizes, int dst_block_num, MPI_Datatype datatype, Xt_config config)
 
Xt_redist xt_redist_p2p_blocks_new (Xt_xmap xmap, const int *src_block_sizes, int src_block_num, const int *dst_block_sizes, int dst_block_num, MPI_Datatype datatype)
 
Xt_redist xt_redist_p2p_blocks_custom_new (Xt_xmap xmap, const int *src_block_sizes, int src_block_num, const int *dst_block_sizes, int dst_block_num, MPI_Datatype datatype, Xt_config config)
 
Xt_redist xt_redist_p2p_new (Xt_xmap xmap, MPI_Datatype datatype)
 
Xt_redist xt_redist_p2p_custom_new (Xt_xmap xmap, MPI_Datatype datatype, Xt_config config)
 

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_p2p.c.

Macro Definition Documentation

◆ XT_EXT_STRIDE_MASK [1/2]

#define XT_EXT_STRIDE_MASK   isign_mask_current_pos_ext_size

Definition at line 312 of file xt_redist_p2p.c.

◆ XT_EXT_STRIDE_MASK [2/2]

#define XT_EXT_STRIDE_MASK   asign_mask_current_pos_ext_size

Definition at line 312 of file xt_redist_p2p.c.

◆ XT_EXT_STRIDE_MASK_PREP [1/2]

#define XT_EXT_STRIDE_MASK_PREP

Definition at line 313 of file xt_redist_p2p.c.

◆ XT_EXT_STRIDE_MASK_PREP [2/2]

#define XT_EXT_STRIDE_MASK_PREP
Value:
MPI_Aint asign_mask_current_pos_ext_size \
= asign_mask(current_pos_ext.size)
static MPI_Aint asign_mask(MPI_Aint x)

Definition at line 313 of file xt_redist_p2p.c.

◆ XT_EXT_TAG [1/2]

#define XT_EXT_TAG   ext

Definition at line 310 of file xt_redist_p2p.c.

◆ XT_EXT_TAG [2/2]

#define XT_EXT_TAG   aext

Definition at line 310 of file xt_redist_p2p.c.

◆ XT_EXT_TYPE [1/2]

#define XT_EXT_TYPE   struct Xt_offset_ext

Definition at line 309 of file xt_redist_p2p.c.

◆ XT_EXT_TYPE [2/2]

#define XT_EXT_TYPE   struct Xt_aoffset_ext

Definition at line 309 of file xt_redist_p2p.c.

◆ XT_MPI_PARSE_STRIPE [1/2]

#define XT_MPI_PARSE_STRIPE   xt_mpi_parse_stripe

Definition at line 311 of file xt_redist_p2p.c.

◆ XT_MPI_PARSE_STRIPE [2/2]

#define XT_MPI_PARSE_STRIPE   xt_mpi_parse_astripe

Definition at line 311 of file xt_redist_p2p.c.

Function Documentation

◆ aux_gen_simple_block_offsets()

static void aux_gen_simple_block_offsets ( int block_offsets[],
const int block_sizes[],
size_t num_blocks )
inlinestatic

Definition at line 338 of file xt_redist_p2p.c.

Here is the caller graph for this function:

◆ generate_block_datatype()

static MPI_Datatype generate_block_datatype ( const int * transfer_pos,
int num_transfer_pos,
const int * block_offsets,
const int * block_sizes,
struct Xt_mpi_strp_prs_params * params )
static

Definition at line 351 of file xt_redist_p2p.c.

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

◆ generate_block_msg_infos()

static void generate_block_msg_infos ( int num_msgs,
Xt_xmap_iter iter,
const int * block_offsets,
const int * block_sizes,
int ** aux_offsets,
size_t num_blocks,
struct Xt_mpi_strp_prs_params * params,
struct Xt_redist_msg * msgs )
static

Definition at line 375 of file xt_redist_p2p.c.

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

◆ generate_datatype()

static MPI_Datatype generate_datatype ( const int * transfer_pos,
int num_transfer_pos,
const int * offsets,
size_t * vsize,
struct Xt_offset_ext ** v,
struct Xt_mpi_strp_prs_params * params )
static

Definition at line 178 of file xt_redist_p2p.c.

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

◆ generate_msg_infos()

static void generate_msg_infos ( int num_msgs,
Xt_xmap_iter iter,
const int * offsets,
struct Xt_redist_msg * msgs,
struct Xt_mpi_strp_prs_params * params )
static

Definition at line 206 of file xt_redist_p2p.c.

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

◆ pos2disp()

static int pos2disp ( int pos,
int num_ext,
const int psum_ext_size[] )
inlinestatic

Definition at line 280 of file xt_redist_p2p.c.

Here is the caller graph for this function:

◆ pos2disp2()

static int pos2disp2 ( int pos,
int num_ext,
const int psum_ext_size[],
int start_ext )
inlinestatic

Definition at line 291 of file xt_redist_p2p.c.

Here is the caller graph for this function:

◆ xt_mdisp2ext()

static size_t xt_mdisp2ext ( size_t disp_len,
const int * disp,
const int * pos,
struct Xt_offset_ext *restrict v )
static

Definition at line 115 of file xt_redist_p2p.c.

Here is the caller graph for this function:

◆ xt_mdisp2ext_count()

static size_t xt_mdisp2ext_count ( size_t disp_len,
const int * disp,
const int * pos )
static

Definition at line 74 of file xt_redist_p2p.c.

Here is the caller graph for this function:

◆ xt_redist_p2p_blocks_custom_new()

Xt_redist xt_redist_p2p_blocks_custom_new ( Xt_xmap xmap,
const int * src_block_sizes,
int src_block_num,
const int * dst_block_sizes,
int dst_block_num,
MPI_Datatype datatype,
Xt_config config )

constructor for a redistribution using point to point communication for the exchange, special case: blocks without explicit offsets

Parameters
[in]xmapexchange map
[in]src_block_sizessource block lengths in unit of elements
[in]src_block_numnumber of src blocks
[in]dst_block_sizesdestination block lengths in unit of elements
[in]dst_block_numnumber of dst blocks
[in]datatypeMPI datatype of a single element in data space, all elements have the same
[in]configconfiguration object for custom settings
Remarks
calls xt_redist_p2p_blocks_off_new with NULL offsets

Definition at line 506 of file xt_redist_p2p.c.

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

◆ xt_redist_p2p_blocks_new()

Xt_redist xt_redist_p2p_blocks_new ( Xt_xmap xmap,
const int * src_block_sizes,
int src_block_num,
const int * dst_block_sizes,
int dst_block_num,
MPI_Datatype datatype )

constructor for a redistribution using point to point communication for the exchange, special case: blocks without explicit offsets

Parameters
[in]xmapexchange map
[in]src_block_sizessource block lengths in unit of elements
[in]src_block_numnumber of src blocks
[in]dst_block_sizesdestination block lengths in unit of elements
[in]dst_block_numnumber of dst blocks
[in]datatypeMPI datatype of a single element in data space, all elements have the same
Remarks
calls xt_redist_p2p_blocks_off_new with NULL offsets

Definition at line 493 of file xt_redist_p2p.c.

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

◆ xt_redist_p2p_blocks_off_custom_new()

Xt_redist xt_redist_p2p_blocks_off_custom_new ( Xt_xmap xmap,
const int * src_block_offsets,
const int * src_block_sizes,
int src_block_num,
const int * dst_block_offsets,
const int * dst_block_sizes,
int dst_block_num,
MPI_Datatype datatype,
Xt_config config )

constructor for a redistribution using point to point communication for the exchange, special case: elements (which correspond to each idxlist element) are blocks of variable length with corresponding offsets, therefore src_block_num and dst_block_num must match the lengths of the src/dst index lists used for the construction of xmap. Uses custom settings.

Parameters
[in]xmapexchange map
[in]src_block_offsetsarray containing for all source index space positions of xmap the offsets for blocks in data space
[in]src_block_sizessource block lengths in unit of elements
[in]src_block_numnumber of src blocks
[in]dst_block_offsetsarray containing for all destination index space positions of xmap the offsets for blocks in data space
[in]dst_block_sizesdestination block lengths in unit of elements
[in]dst_block_numnumber of dst blocks
[in]datatypeMPI datatype of a single element in data space, all elements have the same
[in]configconfiguration object for custom settings
Remarks
NULL offsets arguments mean: use zero based prefix sum of block sizes as effective offsets

Definition at line 425 of file xt_redist_p2p.c.

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

◆ xt_redist_p2p_blocks_off_new()

Xt_redist xt_redist_p2p_blocks_off_new ( Xt_xmap xmap,
const int * src_block_offsets,
const int * src_block_sizes,
int src_block_num,
const int * dst_block_offsets,
const int * dst_block_sizes,
int dst_block_num,
MPI_Datatype datatype )

constructor for a redistribution using point to point communication for the exchange, special case: elements (which correspond to each idxlist element) are blocks of variable length with corresponding offsets, therefore src_block_num and dst_block_num must match the lengths of the src/dst index lists used for the construction of xmap

Parameters
[in]xmapexchange map
[in]src_block_offsetsarray containing for all source index space positions of xmap the offsets for blocks in data space
[in]src_block_sizessource block lengths in unit of elements
[in]src_block_numnumber of src blocks
[in]dst_block_offsetsarray containing for all destination index space positions of xmap the offsets for blocks in data space
[in]dst_block_sizesdestination block lengths in unit of elements
[in]dst_block_numnumber of dst blocks
[in]datatypeMPI datatype of a single element in data space, all elements have the same
Remarks
NULL offsets arguments mean: use zero based prefix sum of block sizes as effective offsets

Definition at line 409 of file xt_redist_p2p.c.

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

◆ xt_redist_p2p_custom_new()

Xt_redist xt_redist_p2p_custom_new ( Xt_xmap xmap,
MPI_Datatype datatype,
Xt_config config )

constructor for a redistribution using point to point communication for the exchange. Uses custom settings.

Parameters
[in]xmapexchange map
[in]datatypeMPI datatype of single element in the data to be exchanged
[in]configconfiguration object for custom settings

Definition at line 525 of file xt_redist_p2p.c.

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

◆ xt_redist_p2p_new()

Xt_redist xt_redist_p2p_new ( Xt_xmap xmap,
MPI_Datatype datatype )

constructor for a redistribution using point to point communication for the exchange. Uses default settings.

Parameters
[in]xmapexchange map
[in]datatypeMPI datatype of single element in the data to be exchanged

Definition at line 518 of file xt_redist_p2p.c.

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

◆ xt_redist_p2p_off_custom_new()

Xt_redist xt_redist_p2p_off_custom_new ( Xt_xmap xmap,
const int * src_offsets,
const int * dst_offsets,
MPI_Datatype datatype,
Xt_config config )

constructor for a redistribution using point to point communication for the exchange. Uses custom settings.

Parameters
[in]xmapexchange map
[in]src_offsetsarray containing for all elements in the source index list passed to the exchange map the position of the respective element in the input array passed to the exchange routine
[in]dst_offsetsarray containing for all elements in the destination index list passed to the exchange map the position of the respective element in the output array passed to the exchange routine
[in]datatypeMPI datatype of single element in the data to be exchanged
[in]configconfiguration object for custom settings

Definition at line 239 of file xt_redist_p2p.c.

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

◆ xt_redist_p2p_off_new()

Xt_redist xt_redist_p2p_off_new ( Xt_xmap xmap,
const int * src_offsets,
const int * dst_offsets,
MPI_Datatype datatype )

constructor for a redistribution using point to point communication for the exchange. Uses default settings.

Parameters
[in]xmapexchange map
[in]src_offsetsarray containing for all elements in the source index list passed to the exchange map the position of the respective element in the input array passed to the exchange routine
[in]dst_offsetsarray containing for all elements in the destination index list passed to the exchange map the position of the respective element in the output array passed to the exchange routine
[in]datatypeMPI datatype of single element in the data to be exchanged

Definition at line 231 of file xt_redist_p2p.c.

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