Yet Another eXchange Tool  0.9.0
Typedefs | Enumerations | Functions
xt_xmap_dist_dir_intercomm.c File Reference
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <limits.h>
#include <mpi.h>
#include "xt/xt_idxlist.h"
#include "xt/xt_idxlist_collection.h"
#include "xt/xt_idxvec.h"
#include "xt/xt_idxstripes.h"
#include "xt/xt_idxempty.h"
#include "xt/xt_xmap.h"
#include "xt/xt_xmap_dist_dir.h"
#include "xt/xt_xmap_dist_dir_intercomm.h"
#include "xt/xt_mpi.h"
#include "xt_arithmetic_util.h"
#include "xt_idxstripes_internal.h"
#include "xt_mpi_internal.h"
#include "core/core.h"
#include "core/ppm_xfuncs.h"
#include "ensure_array_size.h"
#include "xt/xt_xmap_intersection.h"
#include "xt_idxlist_internal.h"
#include "xt_xmap_dist_dir_common.h"
#include "instr.h"
Include dependency graph for xt_xmap_dist_dir_intercomm.c:

Go to the source code of this file.

Typedefs

typedef int(* tx_fp) (void *, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request *)
 

Enumerations

enum  { SEND_SIZE = 0 , SEND_NUM = 1 , SEND_SIZE_ASIZE }
 

Functions

static void get_dist_dir_global_interval_size (Xt_idxlist src, Xt_idxlist dst, bool *stripify, Xt_int interval_size[2], MPI_Comm intra_comm, MPI_Comm inter_comm, int comm_size, int remote_size, int comm_rank, int tag_offset_inter)
 
static void rank_no_send (size_t rank, int(*restrict send_size)[SEND_SIZE_ASIZE])
 
static size_t compute_and_pack_bucket_intersections (struct bucket_params *bucket_params, Xt_idxlist idxlist, int(*send_size)[SEND_SIZE_ASIZE], void **send_buffer_, MPI_Comm comm, int comm_size)
 
static Xt_int get_min_idxlist_index (Xt_idxlist l)
 
static Xt_int get_max_idxlist_index (Xt_idxlist l)
 
static struct bucket_params get_bucket_params (Xt_idxlist idxlist, Xt_int global_interval, int comm_size)
 
static void compress_sizes (int(*restrict sizes)[SEND_SIZE_ASIZE], int comm_size, struct Xt_xmdd_txstat *tx_stat, int *counts)
 
static void create_intersections (struct Xt_xmdd_txstat tx_stat[2], int recv_size[][SEND_SIZE_ASIZE], void **send_buffer, int send_size[][SEND_SIZE_ASIZE], Xt_idxlist idxlist, Xt_int interval_size, MPI_Comm comm, int comm_size)
 
static void tx_intersections (size_t num_msg, const int(*sizes)[SEND_SIZE_ASIZE], unsigned char *buffer, MPI_Request *requests, int tag, MPI_Comm comm, tx_fp tx_op)
 
static void irecv_intersections (size_t num_msg, const int(*recv_size)[SEND_SIZE_ASIZE], void *recv_buffer, MPI_Request *requests, int tag, MPI_Comm comm)
 
static void isend_intersections (size_t num_msg, const int(*send_size)[SEND_SIZE_ASIZE], void *send_buffer, MPI_Request *requests, int tag, MPI_Comm comm)
 
static void unpack_dist_dir (struct Xt_xmdd_txstat tx_stat, const int(*sizes)[SEND_SIZE_ASIZE], void *buffer, struct dist_dir **dist_dir, MPI_Comm comm)
 
static void generate_distributed_directories (struct dist_dir **src_dist_dir, struct dist_dir **dst_dist_dir, bool *stripify, Xt_idxlist src_idxlist, Xt_idxlist dst_idxlist, int tag_offset_inter, int tag_offset_intra, MPI_Comm inter_comm, MPI_Comm intra_comm, int remote_size, int comm_size, int comm_rank)
 
static size_t send_size_from_intersections (size_t num_intersections, const struct isect *restrict src_dst_intersections, enum xt_xmdd_direction target, MPI_Comm comm, int comm_size, int(*restrict send_size_target)[SEND_SIZE_ASIZE])
 
static size_t pack_dist_dirs (size_t num_intersections, struct isect *restrict src_dst_intersections, int(*send_size)[SEND_SIZE_ASIZE], void **send_buffer_, enum xt_xmdd_direction target, bool isect_idxlist_delete, MPI_Comm comm, int comm_size)
 
static void unpack_dist_dir_results (struct Xt_xmdd_txstat tx_stat, struct dist_dir **dist_dir, void *restrict recv_buffer, int *restrict entry_counts, MPI_Comm comm)
 
static void exchange_idxlists (struct dist_dir **src_intersections, struct dist_dir **dst_intersections, bool *stripify, Xt_idxlist src_idxlist, Xt_idxlist dst_idxlist, int tag_offset_inter, int tag_offset_intra, MPI_Comm inter_comm, MPI_Comm intra_comm)
 
Xt_xmap xt_xmap_dist_dir_intercomm_new (Xt_idxlist src_idxlist, Xt_idxlist dst_idxlist, MPI_Comm inter_comm_, MPI_Comm intra_comm_)
 

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

Typedef Documentation

◆ tx_fp

typedef int(* tx_fp) (void *, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request *)

Definition at line 291 of file xt_xmap_dist_dir_intercomm.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
SEND_SIZE 
SEND_NUM 
SEND_SIZE_ASIZE 

Definition at line 121 of file xt_xmap_dist_dir_intercomm.c.

Function Documentation

◆ compress_sizes()

static void compress_sizes ( int(*)  sizes[SEND_SIZE_ASIZE],
int  comm_size,
struct Xt_xmdd_txstat tx_stat,
int *  counts 
)
static

Definition at line 253 of file xt_xmap_dist_dir_intercomm.c.

Here is the caller graph for this function:

◆ compute_and_pack_bucket_intersections()

static size_t compute_and_pack_bucket_intersections ( struct bucket_params bucket_params,
Xt_idxlist  idxlist,
int(*)  send_size[SEND_SIZE_ASIZE],
void **  send_buffer_,
MPI_Comm  comm,
int  comm_size 
)
static

Definition at line 135 of file xt_xmap_dist_dir_intercomm.c.

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

◆ create_intersections()

static void create_intersections ( struct Xt_xmdd_txstat  tx_stat[2],
int  recv_size[][SEND_SIZE_ASIZE],
void **  send_buffer,
int  send_size[][SEND_SIZE_ASIZE],
Xt_idxlist  idxlist,
Xt_int  interval_size,
MPI_Comm  comm,
int  comm_size 
)
static

Definition at line 270 of file xt_xmap_dist_dir_intercomm.c.

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

◆ exchange_idxlists()

static void exchange_idxlists ( struct dist_dir **  src_intersections,
struct dist_dir **  dst_intersections,
bool *  stripify,
Xt_idxlist  src_idxlist,
Xt_idxlist  dst_idxlist,
int  tag_offset_inter,
int  tag_offset_intra,
MPI_Comm  inter_comm,
MPI_Comm  intra_comm 
)
static

Definition at line 525 of file xt_xmap_dist_dir_intercomm.c.

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

◆ generate_distributed_directories()

static void generate_distributed_directories ( struct dist_dir **  src_dist_dir,
struct dist_dir **  dst_dist_dir,
bool *  stripify,
Xt_idxlist  src_idxlist,
Xt_idxlist  dst_idxlist,
int  tag_offset_inter,
int  tag_offset_intra,
MPI_Comm  inter_comm,
MPI_Comm  intra_comm,
int  remote_size,
int  comm_size,
int  comm_rank 
)
static

Definition at line 353 of file xt_xmap_dist_dir_intercomm.c.

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

◆ get_bucket_params()

static struct bucket_params get_bucket_params ( Xt_idxlist  idxlist,
Xt_int  global_interval,
int  comm_size 
)
static

Definition at line 229 of file xt_xmap_dist_dir_intercomm.c.

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

◆ get_dist_dir_global_interval_size()

static void get_dist_dir_global_interval_size ( Xt_idxlist  src,
Xt_idxlist  dst,
bool *  stripify,
Xt_int  interval_size[2],
MPI_Comm  intra_comm,
MPI_Comm  inter_comm,
int  comm_size,
int  remote_size,
int  comm_rank,
int  tag_offset_inter 
)
inlinestatic

Definition at line 80 of file xt_xmap_dist_dir_intercomm.c.

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

◆ get_max_idxlist_index()

static Xt_int get_max_idxlist_index ( Xt_idxlist  l)
inlinestatic

Definition at line 229 of file xt_xmap_dist_dir_intercomm.c.

◆ get_min_idxlist_index()

static Xt_int get_min_idxlist_index ( Xt_idxlist  l)
inlinestatic

Definition at line 221 of file xt_xmap_dist_dir_intercomm.c.

Here is the call graph for this function:

◆ irecv_intersections()

static void irecv_intersections ( size_t  num_msg,
const int(*)  recv_size[SEND_SIZE_ASIZE],
void *  recv_buffer,
MPI_Request *  requests,
int  tag,
MPI_Comm  comm 
)
static

Definition at line 310 of file xt_xmap_dist_dir_intercomm.c.

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

◆ isend_intersections()

static void isend_intersections ( size_t  num_msg,
const int(*)  send_size[SEND_SIZE_ASIZE],
void *  send_buffer,
MPI_Request *  requests,
int  tag,
MPI_Comm  comm 
)
static

Definition at line 320 of file xt_xmap_dist_dir_intercomm.c.

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

◆ pack_dist_dirs()

static size_t pack_dist_dirs ( size_t  num_intersections,
struct isect *restrict  src_dst_intersections,
int(*)  send_size[SEND_SIZE_ASIZE],
void **  send_buffer_,
enum xt_xmdd_direction  target,
bool  isect_idxlist_delete,
MPI_Comm  comm,
int  comm_size 
)
static

Definition at line 461 of file xt_xmap_dist_dir_intercomm.c.

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

◆ rank_no_send()

static void rank_no_send ( size_t  rank,
int(*)  send_size[SEND_SIZE_ASIZE] 
)
inlinestatic

Definition at line 128 of file xt_xmap_dist_dir_intercomm.c.

Here is the caller graph for this function:

◆ send_size_from_intersections()

static size_t send_size_from_intersections ( size_t  num_intersections,
const struct isect *restrict  src_dst_intersections,
enum xt_xmdd_direction  target,
MPI_Comm  comm,
int  comm_size,
int(*)  send_size_target[SEND_SIZE_ASIZE] 
)
static

Definition at line 432 of file xt_xmap_dist_dir_intercomm.c.

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

◆ tx_intersections()

static void tx_intersections ( size_t  num_msg,
const int(*)  sizes[SEND_SIZE_ASIZE],
unsigned char *  buffer,
MPI_Request *  requests,
int  tag,
MPI_Comm  comm,
tx_fp  tx_op 
)
static

Definition at line 294 of file xt_xmap_dist_dir_intercomm.c.

Here is the caller graph for this function:

◆ unpack_dist_dir()

static void unpack_dist_dir ( struct Xt_xmdd_txstat  tx_stat,
const int(*)  sizes[SEND_SIZE_ASIZE],
void *  buffer,
struct dist_dir **  dist_dir,
MPI_Comm  comm 
)
static

Definition at line 331 of file xt_xmap_dist_dir_intercomm.c.

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

◆ unpack_dist_dir_results()

static void unpack_dist_dir_results ( struct Xt_xmdd_txstat  tx_stat,
struct dist_dir **  dist_dir,
void *restrict  recv_buffer,
int *restrict  entry_counts,
MPI_Comm  comm 
)
static

Definition at line 490 of file xt_xmap_dist_dir_intercomm.c.

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

◆ xt_xmap_dist_dir_intercomm_new()

Xt_xmap xt_xmap_dist_dir_intercomm_new ( Xt_idxlist  src_idxlist,
Xt_idxlist  dst_idxlist,
MPI_Comm  inter_comm,
MPI_Comm  intra_comm 
)

Construct an exchange map over an intercommunicator
This operation is collective over all processes in comm.
It uses a distributed directory for the initialisation

Parameters
[in]src_idxlistsource index list
[in]dst_idxlistdestination index list
[in]inter_commMPI intercommunicator that contains all processes that part in the exchange (xt_xmap_dist_dir_icomm_new will make its own copy of comm)
[in]intra_commMPI intracommunicator corresponding to the group of inter_comm that the calling rank belongs to

Definition at line 640 of file xt_xmap_dist_dir_intercomm.c.

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