Yet Another eXchange Tool  0.9.0
Functions
xt_exchanger.c File Reference
#include <string.h>
#include <stdlib.h>
#include "xt/xt_mpi.h"
#include "xt_exchanger.h"
#include "xt_exchanger_irecv_isend.h"
#include "xt_exchanger_mix_isend_irecv.h"
#include "xt_exchanger_irecv_isend_packed.h"
#include "xt_exchanger_neigh_alltoall.h"
Include dependency graph for xt_exchanger.c:

Go to the source code of this file.

Functions

Xt_exchanger xt_exchanger_copy (Xt_exchanger exchanger, MPI_Comm new_comm, int new_tag_offset)
 
void xt_exchanger_delete (Xt_exchanger exchanger)
 
void xt_exchanger_s_exchange (Xt_exchanger exchanger, const void *src_data, void *dst_data)
 
void xt_exchanger_a_exchange (Xt_exchanger exchanger, const void *src_data, void *dst_data, Xt_request *request)
 
static int compare_exchange_messages (const void *msg_a, const void *msg_b)
 
void xt_exchanger_internal_optimize (size_t n, void *msgs, size_t msg_type_size, MPI_Comm comm)
 
int xt_exchanger_get_msg_ranks (Xt_exchanger exchanger, enum xt_msg_direction direction, int *restrict *ranks)
 
MPI_Datatype xt_exchanger_get_MPI_Datatype (Xt_exchanger exchanger, int rank, enum xt_msg_direction direction)
 

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

Function Documentation

◆ compare_exchange_messages()

static int compare_exchange_messages ( const void *  msg_a,
const void *  msg_b 
)
static

Definition at line 83 of file xt_exchanger.c.

Here is the caller graph for this function:

◆ xt_exchanger_a_exchange()

void xt_exchanger_a_exchange ( Xt_exchanger  exchanger,
const void *  src_data,
void *  dst_data,
Xt_request request 
)

Executes a asynchronous data exchange.

Parameters
[in]exchangerexchanger object
[in]src_datasource data
[out]dat_datadestination data
Examples
test_exchanger_parallel.c.

Definition at line 76 of file xt_exchanger.c.

Here is the caller graph for this function:

◆ xt_exchanger_copy()

Xt_exchanger xt_exchanger_copy ( Xt_exchanger  orig,
MPI_Comm  new_comm,
int  new_tag_offset 
)

Copies an exchange object.

Parameters
[in]origexchanger object to be copied
[in]new_commcommunicator to be used by the new exchanger
[in]new_tag_offsetnew tag_offset

Definition at line 61 of file xt_exchanger.c.

Here is the caller graph for this function:

◆ xt_exchanger_delete()

void xt_exchanger_delete ( Xt_exchanger  exchanger)

Destructor for an exchanger.

Examples
test_exchanger_parallel.c.

Definition at line 66 of file xt_exchanger.c.

Here is the caller graph for this function:

◆ xt_exchanger_get_MPI_Datatype()

MPI_Datatype xt_exchanger_get_MPI_Datatype ( Xt_exchanger  exchanger,
int  rank,
enum xt_msg_direction  direction 
)

gets a copy of the MPI_Datatype used for a specificed message

Parameters
[in]exchangerexchanger object
[in]rankMPI rank
[in]directionspecific whether the datatype of an incoming or outgoing message is requested
Returns
MPI_Datatype for the specificed message
Remarks
returns MPI_DATATYPE_NULL if there is no message matching the specificed configuration

Definition at line 134 of file xt_exchanger.c.

Here is the caller graph for this function:

◆ xt_exchanger_get_msg_ranks()

int xt_exchanger_get_msg_ranks ( Xt_exchanger  exchanger,
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 specificed message.

Parameters
[in]exchangerexchanger object
[in]directionspecifices whether ranks for the outgoing or incoming messages are requested
[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

Definition at line 126 of file xt_exchanger.c.

Here is the caller graph for this function:

◆ xt_exchanger_internal_optimize()

void xt_exchanger_internal_optimize ( size_t  n,
void *  msgs,
size_t  msg_type_size,
MPI_Comm  comm 
)

Support routine, that reorders a number of provided messages, such that network congestion is potentially reduced.

Parameters
[in]nnumber of messages
[in,out]msgsmessages to be reordered
[in]msg_type_sizesize of the elements in msgs
[in]commcommunicator associated to the messages
Remarks
The first data element in the messages needs to be an integer containing the rank.

Definition at line 90 of file xt_exchanger.c.

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

◆ xt_exchanger_s_exchange()

void xt_exchanger_s_exchange ( Xt_exchanger  exchanger,
const void *  src_data,
void *  dst_data 
)

Executes a synchronous data exchange.

Parameters
[in]exchangerexchanger object
[in]src_datasource data
[out]dat_datadestination data
Examples
test_exchanger_parallel.c.

Definition at line 71 of file xt_exchanger.c.

Here is the caller graph for this function: