Yet Another eXchange Tool 0.11.0
Loading...
Searching...
No Matches
Functions | Variables
xt_redist.c File Reference
#include <limits.h>
#include <stdbool.h>
#include <stdlib.h>
#include "core/core.h"
#include "xt/xt_core.h"
#include "xt/xt_redist.h"
#include "xt/xt_mpi.h"
#include "xt/xt_request.h"
#include "core/ppm_xfuncs.h"
#include "xt_redist_internal.h"
#include "xt_mpi_ddt_cache.h"
#include "xt_config_internal.h"
Include dependency graph for xt_redist.c:

Go to the source code of this file.

Functions

Xt_redist xt_redist_copy (Xt_redist redist)
 
void xt_redist_delete (Xt_redist redist)
 
void xt_redist_s_exchange (Xt_redist redist, int num_arrays, const void **src_data, void **dst_data)
 
void xt_redist_a_exchange (Xt_redist redist, int num_arrays, const void **src_data, void **dst_data, Xt_request *request)
 
void xt_redist_s_exchange1 (Xt_redist redist, const void *src_data, void *dst_data)
 
void xt_redist_a_exchange1 (Xt_redist redist, const void *src_data, void *dst_data, Xt_request *request)
 
int xt_redist_get_num_send_msg (Xt_redist redist)
 
int xt_redist_get_num_recv_msg (Xt_redist redist)
 
MPI_Datatype xt_redist_get_send_MPI_Datatype (Xt_redist redist, int rank)
 
MPI_Datatype xt_redist_get_recv_MPI_Datatype (Xt_redist redist, int rank)
 
MPI_Datatype xt_redist_get_MPI_Datatype (Xt_redist redist, int rank, enum xt_msg_direction direction, bool do_dup)
 
MPI_Comm xt_redist_get_MPI_Comm (Xt_redist redist)
 
int xt_redist_get_msg_ranks (Xt_redist redist, enum xt_msg_direction direction, int *restrict *ranks)
 
void xt_redist_check_comms (Xt_redist *redists, int num_redists, MPI_Comm comm)
 
static size_t xt_ranks_uniq_count (size_t num_rank_sets, const size_t *restrict num_ranks, const int *const ranks[num_rank_sets])
 
unsigned xt_redist_agg_msg_count (size_t num_redists, enum xt_msg_direction direction, const Xt_redist redists[num_redists], size_t num_ranks[num_redists], int *restrict ranks[num_redists], Xt_config config)
 
MPI_Datatype xt_create_compound_datatype (size_t count, const MPI_Aint displacements[count], const MPI_Datatype datatypes[count], const int block_lengths[count], struct Xt_mpiddt_list *ddt_list, MPI_Comm comm)
 

Variables

static const char filename [] = "xt_redist.c"
 

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

Function Documentation

◆ xt_create_compound_datatype()

MPI_Datatype xt_create_compound_datatype ( size_t  count,
const MPI_Aint  displacements[count],
const MPI_Datatype  datatypes[count],
const int  block_lengths[count],
struct Xt_mpiddt_list ddt_list,
MPI_Comm  comm 
)

Generates a new MPI derived datatype from a number of MPI derived datatypes.

Parameters
[in]countnumber of datatypes
[in]displacementsbyte displacement of each block
[in]datatypestype of elements in each block
[in]block_lengthsnumber of elements in each block
[in,out]ddt_listpointer to optional cache of datatypes to re-use
[in]commcommunicator
Returns
new MPI derived datatype

Definition at line 229 of file xt_redist.c.

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

◆ xt_ranks_uniq_count()

static size_t xt_ranks_uniq_count ( size_t  num_rank_sets,
const size_t *restrict  num_ranks,
const int *const  ranks[num_rank_sets] 
)
static

Definition at line 161 of file xt_redist.c.

Here is the caller graph for this function:

◆ xt_redist_a_exchange()

void xt_redist_a_exchange ( Xt_redist  redist,
int  num_arrays,
const void **  src_data,
void **  dst_data,
Xt_request request 
)

asynchronous redistribution of data

Parameters
[in]redistredistribution structure
[in]num_arraysnumber of base addresses in src_data and dst_data
[in]src_dataarray containing the addresses of the first elements of the input data
[in,out]dst_dataarray containing the addresses of the first elements of the output data
[out]requestpointer to a request object that can be used to complete an asynchronous exchange
Remarks
The above implies that NULL or any other invalid pointer must not be used in either src_data or dst_data.
See Also
Correct use of addresses

Definition at line 84 of file xt_redist.c.

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

◆ xt_redist_a_exchange1()

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

asynchronous redistribution of data - single array case

Parameters
[in]redistredistribution structure
[in]src_dataaddress of the first element of the input data
[in,out]dst_dataaddress of the first element of the output data
[out]requestpointer to a request object that can be used to complete an asynchronous exchange
Remarks
The above implies that NULL or any other invalid pointer must not be used in either src_data or dst_data.

Definition at line 96 of file xt_redist.c.

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

◆ xt_redist_agg_msg_count()

unsigned xt_redist_agg_msg_count ( size_t  num_redists,
enum xt_msg_direction  direction,
const Xt_redist  redists[num_redists],
size_t  num_ranks[num_redists],
int *restrict  ranks[num_redists],
Xt_config  config 
)

Determines number of processes that receive data from/send data to the local processes by any redists provided to this routine.

Parameters
[in]num_redistsnumber of redistribution objects
[in]directionspecifices whether the of outgoing or incoming message is to be determined
[in]redistsredistribution objects
[out]num_ranksnumber of incoming/outgoing messages per redist
[out]ranksranks of communicator partners for each redist
Returns
Number of processes that receive data from/send data to the local process.
Remarks
the user needs to ensure that rank arrays are big enough to hold all ranks

Definition at line 190 of file xt_redist.c.

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

◆ xt_redist_check_comms()

void xt_redist_check_comms ( Xt_redist redists,
int  num_redists,
MPI_Comm  comm 
)

Checks whether a number of redists are based on the same communicator. This is a requirement in case these redists are to be combined into a redist collection.

Parameters
[in]redistsredistribution objects to be checked
[in]num_redistsnumber of redistribution objects is redists
[in]commreference communicator
Remarks
In case this check fails, it will abort the program.

Definition at line 142 of file xt_redist.c.

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

◆ xt_redist_copy()

Xt_redist xt_redist_copy ( Xt_redist  redist)

redist copy constructor

Parameters
[in,out]redistredistribution structure

Definition at line 68 of file xt_redist.c.

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

◆ xt_redist_delete()

void xt_redist_delete ( Xt_redist  redist)

destructor

Parameters
[in,out]redistredistribution structure

Definition at line 73 of file xt_redist.c.

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

◆ xt_redist_get_MPI_Comm()

MPI_Comm xt_redist_get_MPI_Comm ( Xt_redist  redist)

returns a MPI communicator, which the redistribution is based on

Parameters
[in]redistredistribution structure
Returns
MPI communicator, which the redistribution is based on

Definition at line 129 of file xt_redist.c.

Here is the caller graph for this function:

◆ xt_redist_get_MPI_Datatype()

MPI_Datatype xt_redist_get_MPI_Datatype ( Xt_redist  redist,
int  rank,
enum xt_msg_direction  direction,
bool  do_dup 
)

Gets a MPI derived datatype that encodes all data sent/received in a specified message.

Parameters
[in]redistredistribution object
[in]rankMPI rank of the communicator partner
[in]directionspecifices whether the datatype for an outgoing or incoming message is requested
[in]do_dupif true only return MPI_Datatype_dup of internally stored datatype
Returns
Datatype for the specified message. The return value is MPI_DATATYPE_NULL, if no data for the specified message.

Definition at line 122 of file xt_redist.c.

Here is the caller graph for this function:

◆ xt_redist_get_msg_ranks()

int xt_redist_get_msg_ranks ( Xt_redist  redist,
enum xt_msg_direction  direction,
int *restrict *  ranks 
)

Gets the ranks of all processes that receive data from/send data to the local process in the exchanges defined by the redist.

Parameters
[in]redistredistribution object
[in]directionspecifices whether ranks for the outgoing or incoming messages are requested
[in,out]ranksranks for all outgoing/incoming messages
Returns
number of outgoing/incoming message
Remarks
the user needs to ensure that array ranks is big enough to hold all ranks, each element of ranks must be either a pointer to a valid output array or NULL, in which case it will be allocated

Definition at line 134 of file xt_redist.c.

Here is the caller graph for this function:

◆ xt_redist_get_num_recv_msg()

int xt_redist_get_num_recv_msg ( Xt_redist  redist)

gets the number of messages received by the local process in an exchange operation

Parameters
[in]redistredistribution structure
Returns
number of messages received in the exchange operation

Definition at line 107 of file xt_redist.c.

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

◆ xt_redist_get_num_send_msg()

int xt_redist_get_num_send_msg ( Xt_redist  redist)

gets the number of messages send from the local process in an exchange operation

Parameters
[in]redistredistribution structure
Returns
number of messages sent in the exchange operation

Definition at line 102 of file xt_redist.c.

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

◆ xt_redist_get_recv_MPI_Datatype()

MPI_Datatype xt_redist_get_recv_MPI_Datatype ( Xt_redist  redist,
int  rank 
)

gets a copy of the MPI_Datatype used for the data of the recv operation with the given rank

Parameters
[in]redistredistribution structure
[in]rankMPI rank
Returns
MPI_Datatype for the data of the recv operation with the given rank
Remarks
returns MPI_DATATYPE_NULL if there is no recv operation with the given rank

Definition at line 117 of file xt_redist.c.

Here is the caller graph for this function:

◆ xt_redist_get_send_MPI_Datatype()

MPI_Datatype xt_redist_get_send_MPI_Datatype ( Xt_redist  redist,
int  rank 
)

gets a copy of the MPI_Datatype used for the data of the send operation with the given rank

Parameters
[in]redistredistribution structure
[in]rankMPI rank
Returns
MPI_Datatype for the data of the send operation with the given rank
Remarks
returns MPI_DATATYPE_NULL if there is no send operation with the given rank

Definition at line 112 of file xt_redist.c.

Here is the caller graph for this function:

◆ xt_redist_s_exchange()

void xt_redist_s_exchange ( Xt_redist  redist,
int  num_arrays,
const void **  src_data,
void **  dst_data 
)

synchronous redistribution of data

Parameters
[in]redistredistribution structure
[in]num_arraysnumber of base addresses in src_data and dst_data
[in]src_dataarray containing the addresses of the first elements of the input data
[in,out]dst_dataarray containing the addresses of the first elements of the output data
Remarks
The above implies that NULL or any other invalid pointer must not be used in either src_data or dst_data.
See Also
Correct use of addresses

Definition at line 78 of file xt_redist.c.

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

◆ xt_redist_s_exchange1()

void xt_redist_s_exchange1 ( Xt_redist  redist,
const void *  src_data,
void *  dst_data 
)

synchronous redistribution of data - single array case

Parameters
[in]redistredistribution structure
[in]src_dataaddress of the first element of the input data
[in,out]dst_dataaddress of the first element of the output data
Remarks
The above implies that NULL or any other invalid pointer must not be used in either src_data or dst_data.

Definition at line 91 of file xt_redist.c.

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

Variable Documentation

◆ filename

const char filename[] = "xt_redist.c"
static

Definition at line 66 of file xt_redist.c.