Yet Another eXchange Tool 0.11.3
Loading...
Searching...
No Matches
xt_xmap_dist_dir.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_idxlist_internal.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_mpi.h"
#include "xt_mpi_internal.h"
#include "core/core.h"
#include "core/ppm_xfuncs.h"
#include "xt/xt_xmap_intersection.h"
#include "xt_config_internal.h"
#include "instr.h"
#include "xt_xmap_dist_dir_common.h"
#include "xt/xt_sort.h"
#include "xt_xmap_dist_dir_bucket_gen_internal.h"
Include dependency graph for xt_xmap_dist_dir.c:

Go to the source code of this file.

Classes

struct  capbi_result
 
struct  dd_result
 

Enumerations

enum  {
  SEND_SIZE_SRC = 0 , SEND_SIZE_DST = 1 , SEND_NUM_SRC = 2 , SEND_NUM_DST = 3 ,
  SEND_SIZE_ASIZE
}
 

Functions

static void rank_no_send (size_t rank, int(*restrict send_size)[SEND_SIZE_ASIZE])
 
static struct capbi_result compute_and_pack_bucket_intersections (Xt_idxlist src_idxlist, Xt_idxlist dst_idxlist, int(*send_size)[SEND_SIZE_ASIZE], void **send_buffer_, MPI_Comm comm, int tag_offset, int comm_size, Xt_config config)
 
static void recv_and_unpack_intersection (struct dist_dir *dist_dir, int recv_size, int recv_count, void *recv_buffer, int tag, MPI_Comm comm)
 
static void send_intersections (void *send_buffer, const int(*send_size)[SEND_SIZE_ASIZE], MPI_Request *dir_init_send_requests, int tag_offset, MPI_Comm comm, int comm_size)
 
static struct dist_dir_pair recv_and_unpack_intersections (int recv_size[SEND_SIZE_ASIZE], int tag_offset, MPI_Comm comm)
 
static size_t buf_size_from_intersections (size_t num_intersections, const struct isect *restrict src_dst_intersections, MPI_Comm comm, int comm_size, int(*restrict send_size)[SEND_SIZE_ASIZE])
 
static int pack_src_dst_dist_dirs (size_t num_intersections, struct isect *restrict src_dst_intersections, int(*send_size)[SEND_SIZE_ASIZE], void **send_buffer_, MPI_Comm comm, int comm_size)
 
static void xt_xmap_dist_dir_reduce_scatter_sizes (int num_sizes, int recv_size[num_sizes], int(*send_size)[num_sizes], MPI_Comm comm)
 wrapper for MPI_Reduce_scatter_block if available or MPI_Reduce_scatter if not
 
static struct dd_result generate_distributed_directories (Xt_idxlist src_idxlist, Xt_idxlist dst_idxlist, int tag_offset, MPI_Comm comm, int comm_size, Xt_config config)
 
static void recv_and_unpack_dist_dir_result (struct dist_dir *dist_dir, int recv_size, void *restrict recv_buffer, int tag, MPI_Comm comm)
 
static struct dist_dir_pair recv_and_unpack_dist_dir_results (int recv_size[SEND_SIZE_ASIZE], int *num_send_indices_requests, MPI_Request *send_indices_requests, int tag_offset, MPI_Comm comm)
 
static struct dd_result exchange_idxlists (Xt_idxlist src_idxlist, Xt_idxlist dst_idxlist, int tag_offset, MPI_Comm comm, Xt_config config)
 
Xt_xmap xt_xmap_dist_dir_intracomm_custom_new (Xt_idxlist src_idxlist, Xt_idxlist dst_idxlist, MPI_Comm comm, Xt_config config)
 
Xt_xmap xt_xmap_dist_dir_intracomm_new (Xt_idxlist src_idxlist, Xt_idxlist dst_idxlist, MPI_Comm comm)
 

Variables

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

Detailed Description

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
SEND_SIZE_SRC 
SEND_SIZE_DST 
SEND_NUM_SRC 
SEND_NUM_DST 
SEND_SIZE_ASIZE 

Definition at line 90 of file xt_xmap_dist_dir.c.

Function Documentation

◆ buf_size_from_intersections()

static size_t buf_size_from_intersections ( size_t num_intersections,
const struct isect *restrict src_dst_intersections,
MPI_Comm comm,
int comm_size,
int(*) send_size[SEND_SIZE_ASIZE] )
static

Definition at line 311 of file xt_xmap_dist_dir.c.

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

◆ compute_and_pack_bucket_intersections()

static struct capbi_result compute_and_pack_bucket_intersections ( Xt_idxlist src_idxlist,
Xt_idxlist dst_idxlist,
int(*) send_size[SEND_SIZE_ASIZE],
void ** send_buffer_,
MPI_Comm comm,
int tag_offset,
int comm_size,
Xt_config config )
static

Definition at line 113 of file xt_xmap_dist_dir.c.

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

◆ exchange_idxlists()

static struct dd_result exchange_idxlists ( Xt_idxlist src_idxlist,
Xt_idxlist dst_idxlist,
int tag_offset,
MPI_Comm comm,
Xt_config config )
static

Definition at line 571 of file xt_xmap_dist_dir.c.

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

◆ generate_distributed_directories()

static struct dd_result generate_distributed_directories ( Xt_idxlist src_idxlist,
Xt_idxlist dst_idxlist,
int tag_offset,
MPI_Comm comm,
int comm_size,
Xt_config config )
static

Definition at line 422 of file xt_xmap_dist_dir.c.

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

◆ pack_src_dst_dist_dirs()

static int pack_src_dst_dist_dirs ( size_t num_intersections,
struct isect *restrict src_dst_intersections,
int(*) send_size[SEND_SIZE_ASIZE],
void ** send_buffer_,
MPI_Comm comm,
int comm_size )
static

Definition at line 347 of file xt_xmap_dist_dir.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 99 of file xt_xmap_dist_dir.c.

Here is the caller graph for this function:

◆ recv_and_unpack_dist_dir_result()

static void recv_and_unpack_dist_dir_result ( struct dist_dir * dist_dir,
int recv_size,
void *restrict recv_buffer,
int tag,
MPI_Comm comm )
static

Definition at line 465 of file xt_xmap_dist_dir.c.

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

◆ recv_and_unpack_dist_dir_results()

static struct dist_dir_pair recv_and_unpack_dist_dir_results ( int recv_size[SEND_SIZE_ASIZE],
int * num_send_indices_requests,
MPI_Request * send_indices_requests,
int tag_offset,
MPI_Comm comm )
static

Definition at line 511 of file xt_xmap_dist_dir.c.

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

◆ recv_and_unpack_intersection()

static void recv_and_unpack_intersection ( struct dist_dir * dist_dir,
int recv_size,
int recv_count,
void * recv_buffer,
int tag,
MPI_Comm comm )
static

Definition at line 228 of file xt_xmap_dist_dir.c.

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

◆ recv_and_unpack_intersections()

static struct dist_dir_pair recv_and_unpack_intersections ( int recv_size[SEND_SIZE_ASIZE],
int tag_offset,
MPI_Comm comm )
static

Definition at line 281 of file xt_xmap_dist_dir.c.

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

◆ send_intersections()

static void send_intersections ( void * send_buffer,
const int(*) send_size[SEND_SIZE_ASIZE],
MPI_Request * dir_init_send_requests,
int tag_offset,
MPI_Comm comm,
int comm_size )
static

Definition at line 260 of file xt_xmap_dist_dir.c.

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

◆ xt_xmap_dist_dir_intracomm_custom_new()

Xt_xmap xt_xmap_dist_dir_intracomm_custom_new ( Xt_idxlist src_idxlist,
Xt_idxlist dst_idxlist,
MPI_Comm comm,
Xt_config config )

Construct an exchange map.
This operation is collective over all processes in comm.
It uses a distributed directory to reduce communication and computation during the initialisation at the cost of some extra latency because more network transfers than for xt_xmap_all2all_new are required.

Parameters
[in]src_idxlistsource index list
[in]dst_idxlistdestination index list
[in]commMPI communicator that contains all processes that take part in the exchange (xt_xmap_dist_dir_new will make its own copy of comm), must be an intracommunicator.
[in]configcustom configuration parameters

Definition at line 633 of file xt_xmap_dist_dir.c.

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

◆ xt_xmap_dist_dir_intracomm_new()

Xt_xmap xt_xmap_dist_dir_intracomm_new ( Xt_idxlist src_idxlist,
Xt_idxlist dst_idxlist,
MPI_Comm comm )

Construct an exchange map.
This operation is collective over all processes in comm.
It uses a distributed directory to reduce communication and computation during the initialisation at the cost of some extra latency because more network transfers than for xt_xmap_all2all_new are required.

Parameters
[in]src_idxlistsource index list
[in]dst_idxlistdestination index list
[in]commMPI communicator that contains all processes that take part in the exchange (xt_xmap_dist_dir_new will make its own copy of comm), must be an intracommunicator.

Definition at line 676 of file xt_xmap_dist_dir.c.

Here is the call graph for this function:

◆ xt_xmap_dist_dir_reduce_scatter_sizes()

static void xt_xmap_dist_dir_reduce_scatter_sizes ( int num_sizes,
int recv_size[num_sizes],
int(*) send_size[num_sizes],
MPI_Comm comm )
static

wrapper for MPI_Reduce_scatter_block if available or MPI_Reduce_scatter if not

Parameters
num_sizesnumber of size entries to reduce over and to be received via recv_size
recv_sizearray to hold result of reduction
send_sizesizes to sum over, array size must correspond to corresponding size of comm times num_sizes
commMPI communicator to use

Definition at line 393 of file xt_xmap_dist_dir.c.

Here is the caller graph for this function:

Variable Documentation

◆ filename

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

Definition at line 80 of file xt_xmap_dist_dir.c.