Yet Another eXchange Tool 0.11.3
Loading...
Searching...
No Matches
xt_exchanger_simple_base.c File Reference
#include <assert.h>
#include <mpi.h>
#include <stdbool.h>
#include "core/core.h"
#include "core/ppm_xfuncs.h"
#include "xt/xt_mpi.h"
#include "xt_config_internal.h"
#include "xt_mpi_internal.h"
#include "xt_redist_internal.h"
#include "xt_exchanger.h"
#include "xt_exchanger_simple_base.h"
#include "xt_quicksort_base.h"
Include dependency graph for xt_exchanger_simple_base.c:

Go to the source code of this file.

Classes

struct  Xt_exchanger_simple_base_
 

Macros

#define XT_SORTFUNC_DECL   static
 
#define SORT_TYPE   struct Xt_redist_msg
 
#define SORT_TYPE_SUFFIX   redist_msg
 
#define SORT_TYPE_CMP_LT(u, v, i, j)
 
#define SORT_TYPE_CMP_LE(u, v, i, j)
 
#define SORT_TYPE_CMP_EQ(u, v, i, j)
 
#define XT_SORT_EXTRA_ARGS_DECL   , int comm_rank, int comm_size
 
#define XT_SORT_EXTRA_ARGS_PASS   , comm_rank, comm_size
 
#define XT_SORT_VECSWAP_EXTRA_ARGS_DECL
 
#define XT_SORT_VECSWAP_EXTRA_ARGS_PASS
 

Typedefs

typedef struct Xt_exchanger_simple_base_Xt_exchanger_simple_base
 

Functions

static Xt_exchanger xt_exchanger_simple_base_copy (Xt_exchanger exchanger, MPI_Comm newComm, int new_tag_offset)
 
static void xt_exchanger_simple_base_delete (Xt_exchanger exchanger)
 
static void xt_exchanger_simple_base_s_exchange (Xt_exchanger exchanger, const void *src_data, void *dst_data)
 
static void xt_exchanger_simple_base_a_exchange (Xt_exchanger exchanger, const void *src_data, void *dst_data, Xt_request *request)
 
static int xt_exchanger_simple_base_get_msg_ranks (Xt_exchanger exchanger, enum xt_msg_direction direction, int *restrict *ranks)
 
static MPI_Datatype xt_exchanger_simple_base_get_MPI_Datatype (Xt_exchanger exchanger, int rank, enum xt_msg_direction direction, bool do_dup)
 
static Xt_exchanger_omp_share xt_exchanger_simple_base_create_omp_share (Xt_exchanger exchanger)
 
static Xt_exchanger_simple_base xt_exchanger_simple_base_alloc (size_t nmsg)
 
static int adjusted_rank (int r, int comm_rank, int comm_size)
 
Xt_exchanger xt_exchanger_simple_base_new (int nsend, int nrecv, const struct Xt_redist_msg *send_msgs, const struct Xt_redist_msg *recv_msgs, MPI_Comm comm, int tag_offset, xt_simple_s_exchange_func s_func, xt_simple_a_exchange_func a_func, xt_simple_create_omp_share_func create_omp_share_func, Xt_config config)
 

Variables

static const char filename [] = "xt_exchanger_simple_base.c"
 
const struct xt_exchanger_vtable xt_exchanger_simple_base_vtable
 

Detailed Description

Macro Definition Documentation

◆ SORT_TYPE

#define SORT_TYPE   struct Xt_redist_msg

Definition at line 134 of file xt_exchanger_simple_base.c.

◆ SORT_TYPE_CMP_EQ

#define SORT_TYPE_CMP_EQ ( u,
v,
i,
j )
Value:
(((u).rank) == ((v).rank))

Definition at line 142 of file xt_exchanger_simple_base.c.

◆ SORT_TYPE_CMP_LE

#define SORT_TYPE_CMP_LE ( u,
v,
i,
j )
Value:
(adjusted_rank((u).rank, comm_rank, comm_size) \
<= adjusted_rank((v).rank, comm_rank, comm_size))
static int adjusted_rank(int r, int comm_rank, int comm_size)

Definition at line 139 of file xt_exchanger_simple_base.c.

◆ SORT_TYPE_CMP_LT

#define SORT_TYPE_CMP_LT ( u,
v,
i,
j )
Value:
(adjusted_rank((u).rank, comm_rank, comm_size) \
< adjusted_rank((v).rank, comm_rank, comm_size))

Definition at line 136 of file xt_exchanger_simple_base.c.

◆ SORT_TYPE_SUFFIX

#define SORT_TYPE_SUFFIX   redist_msg

Definition at line 135 of file xt_exchanger_simple_base.c.

◆ XT_SORT_EXTRA_ARGS_DECL

#define XT_SORT_EXTRA_ARGS_DECL   , int comm_rank, int comm_size

Definition at line 143 of file xt_exchanger_simple_base.c.

◆ XT_SORT_EXTRA_ARGS_PASS

#define XT_SORT_EXTRA_ARGS_PASS   , comm_rank, comm_size

Definition at line 144 of file xt_exchanger_simple_base.c.

◆ XT_SORT_VECSWAP_EXTRA_ARGS_DECL

#define XT_SORT_VECSWAP_EXTRA_ARGS_DECL

Definition at line 145 of file xt_exchanger_simple_base.c.

◆ XT_SORT_VECSWAP_EXTRA_ARGS_PASS

#define XT_SORT_VECSWAP_EXTRA_ARGS_PASS

Definition at line 146 of file xt_exchanger_simple_base.c.

◆ XT_SORTFUNC_DECL

#define XT_SORTFUNC_DECL   static

Definition at line 133 of file xt_exchanger_simple_base.c.

Typedef Documentation

◆ Xt_exchanger_simple_base

Function Documentation

◆ adjusted_rank()

static int adjusted_rank ( int r,
int comm_rank,
int comm_size )
inlinestatic

Definition at line 128 of file xt_exchanger_simple_base.c.

◆ xt_exchanger_simple_base_a_exchange()

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

Definition at line 271 of file xt_exchanger_simple_base.c.

◆ xt_exchanger_simple_base_alloc()

static Xt_exchanger_simple_base xt_exchanger_simple_base_alloc ( size_t nmsg)
static

Definition at line 117 of file xt_exchanger_simple_base.c.

Here is the caller graph for this function:

◆ xt_exchanger_simple_base_copy()

static Xt_exchanger xt_exchanger_simple_base_copy ( Xt_exchanger exchanger,
MPI_Comm newComm,
int new_tag_offset )
static

Definition at line 219 of file xt_exchanger_simple_base.c.

Here is the call graph for this function:

◆ xt_exchanger_simple_base_create_omp_share()

static Xt_exchanger_omp_share xt_exchanger_simple_base_create_omp_share ( Xt_exchanger exchanger)
static

Definition at line 334 of file xt_exchanger_simple_base.c.

◆ xt_exchanger_simple_base_delete()

static void xt_exchanger_simple_base_delete ( Xt_exchanger exchanger)
static

Definition at line 245 of file xt_exchanger_simple_base.c.

Here is the call graph for this function:

◆ xt_exchanger_simple_base_get_MPI_Datatype()

static MPI_Datatype xt_exchanger_simple_base_get_MPI_Datatype ( Xt_exchanger exchanger,
int rank,
enum xt_msg_direction direction,
bool do_dup )
static

Definition at line 292 of file xt_exchanger_simple_base.c.

Here is the call graph for this function:

◆ xt_exchanger_simple_base_get_msg_ranks()

static int xt_exchanger_simple_base_get_msg_ranks ( Xt_exchanger exchanger,
enum xt_msg_direction direction,
int *restrict * ranks )
static

Definition at line 317 of file xt_exchanger_simple_base.c.

◆ xt_exchanger_simple_base_new()

Xt_exchanger xt_exchanger_simple_base_new ( int nsend,
int nrecv,
const struct Xt_redist_msg * send_msgs,
const struct Xt_redist_msg * recv_msgs,
MPI_Comm comm,
int tag_offset,
xt_simple_s_exchange_func s_func,
xt_simple_a_exchange_func a_func,
xt_simple_create_omp_share_func create_omp_share_func,
Xt_config config )

constructor for an exchanger using asynchronous send and recv

Parameters
[in]nsendnumber of send messages
[in]nrecvnumber of receive messages
[in]send_msgsarray with send messages
[in]recv_msgsarray with receive messages
[in]commMPI communicator that is to be used for the communication
[in]tag_offsettag
[in]s_funcfunction pointer used for synchronous exchanges
[in]a_funcfunction pointer used for asynchronous exchanges
[in]create_omp_share_funcfunction pointer used to create shared state for multi-threaded calls
[in]configoptional customization parameters
Remarks
tag_offset + xt_mpi_tag_exchange_msg must not be used on comm by any other part of the program during the lifetime of the created exchanger object

note: tag_offset + xt_mpi_tag_exchange_msg must not be used on comm by any other part of the program during the lifetime of the created exchanger object

Definition at line 151 of file xt_exchanger_simple_base.c.

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

◆ xt_exchanger_simple_base_s_exchange()

static void xt_exchanger_simple_base_s_exchange ( Xt_exchanger exchanger,
const void * src_data,
void * dst_data )
static

Definition at line 257 of file xt_exchanger_simple_base.c.

Variable Documentation

◆ filename

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

Definition at line 63 of file xt_exchanger_simple_base.c.

◆ xt_exchanger_simple_base_vtable

const struct xt_exchanger_vtable xt_exchanger_simple_base_vtable
Initial value:
= {
}
static void xt_exchanger_simple_base_a_exchange(Xt_exchanger exchanger, const void *src_data, void *dst_data, Xt_request *request)
static int xt_exchanger_simple_base_get_msg_ranks(Xt_exchanger exchanger, enum xt_msg_direction direction, int *restrict *ranks)
static void xt_exchanger_simple_base_delete(Xt_exchanger exchanger)
static Xt_exchanger xt_exchanger_simple_base_copy(Xt_exchanger exchanger, MPI_Comm newComm, int new_tag_offset)
static void xt_exchanger_simple_base_s_exchange(Xt_exchanger exchanger, const void *src_data, void *dst_data)
static Xt_exchanger_omp_share xt_exchanger_simple_base_create_omp_share(Xt_exchanger exchanger)
static MPI_Datatype xt_exchanger_simple_base_get_MPI_Datatype(Xt_exchanger exchanger, int rank, enum xt_msg_direction direction, bool do_dup)

Definition at line 90 of file xt_exchanger_simple_base.c.