Yet Another eXchange Tool  DO_NOT_EDIT_HERE
Data Structures | Typedefs | Functions | Variables
xt_xmap_intersection_ext.c File Reference
#include <assert.h>
#include <limits.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <mpi.h>
#include "xt/xt_idxlist.h"
#include "xt/xt_idxvec.h"
#include "xt/xt_xmap.h"
#include "xt_xmap_internal.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_arithmetic_util.h"
#include "ensure_array_size.h"
#include "xt_cover.h"
Include dependency graph for xt_xmap_intersection_ext.c:

Go to the source code of this file.

Data Structures

struct  exchange_ext
 
struct  Xt_xmap_intersection_ext_
 
struct  Xt_pos_ext_overlap
 
struct  Xt_xmap_iter_intersection_ext_
 

Typedefs

typedef struct Xt_xmap_intersection_ext_Xt_xmap_intersection_ext
 
typedef struct Xt_xmap_iter_intersection_ext_Xt_xmap_iter_intersection_ext
 

Functions

static MPI_Comm xmap_intersection_ext_get_communicator (Xt_xmap xmap)
 
static int xmap_intersection_ext_get_num_destinations (Xt_xmap xmap)
 
static int xmap_intersection_ext_get_num_sources (Xt_xmap xmap)
 
static void xmap_intersection_ext_get_destination_ranks (Xt_xmap xmap, int *ranks)
 
static void xmap_intersection_ext_get_source_ranks (Xt_xmap xmap, int *ranks)
 
static Xt_xmap_iter xmap_intersection_ext_get_in_iterator (Xt_xmap xmap)
 
static Xt_xmap_iter xmap_intersection_ext_get_out_iterator (Xt_xmap xmap)
 
static Xt_xmap xmap_intersection_ext_copy (Xt_xmap xmap)
 
static void xmap_intersection_ext_delete (Xt_xmap xmap)
 
static int xmap_intersection_ext_get_max_src_pos (Xt_xmap xmap)
 
static int xmap_intersection_ext_get_max_dst_pos (Xt_xmap xmap)
 
static Xt_xmap_intersection_ext xmie (void *xmap)
 
static void xmap_intersection_ext_get_destination_ranks (Xt_xmap xmap, int *restrict ranks)
 
static void xmap_intersection_ext_get_source_ranks (Xt_xmap xmap, int *restrict ranks)
 
static void xmap_intersection_ext_msg_copy (size_t nmsg, struct exchange_ext *restrict msg, int *nmsg_copy, struct exchange_ext **msg_copy)
 
static void xt_free_exchange_ext (size_t num_msg, struct exchange_ext *restrict msg)
 
static void generate_transfer_ext (struct Xt_xmap_intersection_ext_ *xmap, int num_src_intersections, const struct Xt_com_list src_com[num_src_intersections], int num_dst_intersections, const struct Xt_com_list dst_com[num_dst_intersections], Xt_idxlist src_idxlist_local, Xt_idxlist dst_idxlist_local, MPI_Comm comm)
 
Xt_xmap xt_xmap_intersection_ext_new (int num_src_intersections, const struct Xt_com_list src_com[num_src_intersections], int num_dst_intersections, const struct Xt_com_list dst_com[num_dst_intersections], Xt_idxlist src_idxlist, Xt_idxlist dst_idxlist, MPI_Comm comm)
 
static struct Xt_pos_ext_vec generate_dir_transfer_ext_dst (int num_intersections, const struct Xt_com_list intersections[num_intersections], Xt_idxlist mypart_idxlist, int *resCount, struct exchange_ext **resSets, int(*restrict dst_removals_per_intersection)[2])
 
static struct Xt_pos_extexchange_pos_ext_modifications (int num_src_intersections, const struct Xt_com_list src_com[num_src_intersections], int num_dst_intersections, const struct Xt_com_list dst_com[num_dst_intersections], struct exchange_ext dst_ext[num_dst_intersections], int(*restrict src_removals_per_intersection)[2], int(*restrict dst_removals_per_intersection)[2], int tag_offset, MPI_Comm comm)
 
static void remap_dst_intersections (int num_dst_intersections, const struct Xt_com_list dst_com[num_dst_intersections], Xt_idxlist mypart_idxlist, int resCount, struct exchange_ext resSets[resCount], int(*removals_per_intersection)[2])
 
static void generate_dir_transfer_pos_ext_src (int num_intersections, const struct Xt_com_list intersections[num_intersections], Xt_idxlist mypart_idxlist, int *resCount, struct exchange_ext **resSets, int(*restrict removals_per_intersection)[2], struct Xt_pos_ext *pos_updates)
 
static struct Xt_pos_ext_overlap Xt_get_pos_ext_overlap (struct Xt_pos_ext a, struct Xt_pos_ext b)
 
static void cut_pos_ext_from_pos_exts (struct Xt_pos_ext pos_ext, size_t *num_pos_exts, size_t *size_pos_exts, struct Xt_pos_ext **pos_exts)
 
static void remap_intersection (Xt_idxlist mypart_idxlist, Xt_idxlist intersection, size_t num_pos_updates, struct Xt_pos_ext pos_updates[num_pos_updates], struct exchange_ext *resSet, int single_match_only)
 
static struct Xt_striperefine_stripes (int *num_stripes_, struct Xt_stripe *restrict intersection_idxstripes, size_t num_pos_updates, struct Xt_pos_ext *restrict pos_updates)
 
static int xmap_intersection_ext_iterator_next (Xt_xmap_iter iter)
 
static int xmap_intersection_ext_iterator_get_rank (Xt_xmap_iter iter)
 
static int const * xmap_intersection_ext_iterator_get_transfer_pos (Xt_xmap_iter iter)
 
static int xmap_intersection_ext_iterator_get_num_transfer_pos (Xt_xmap_iter iter)
 
static const struct Xt_pos_extxmap_intersection_ext_iterator_get_transfer_pos_ext (Xt_xmap_iter iter)
 
static int xmap_intersection_ext_iterator_get_num_transfer_pos_ext (Xt_xmap_iter iter)
 
static void xmap_intersection_ext_iterator_delete (Xt_xmap_iter iter)
 
static Xt_xmap_iter_intersection_ext xmiei (void *iter)
 

Variables

static const struct Xt_xmap_vtable xmap_intersection_vtable
 
static const struct Xt_xmap_iter_vtable xmap_iterator_intersection_ext_vtable
 

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

Typedef Documentation

◆ Xt_xmap_intersection_ext

Definition at line 124 of file xt_xmap_intersection_ext.c.

◆ Xt_xmap_iter_intersection_ext

Definition at line 943 of file xt_xmap_intersection_ext.c.

Function Documentation

◆ cut_pos_ext_from_pos_exts()

static void cut_pos_ext_from_pos_exts ( struct Xt_pos_ext  pos_ext,
size_t *  num_pos_exts,
size_t *  size_pos_exts,
struct Xt_pos_ext **  pos_exts 
)
static

Definition at line 596 of file xt_xmap_intersection_ext.c.

Here is the caller graph for this function:

◆ exchange_pos_ext_modifications()

static struct Xt_pos_ext * exchange_pos_ext_modifications ( int  num_src_intersections,
const struct Xt_com_list  src_com[num_src_intersections],
int  num_dst_intersections,
const struct Xt_com_list  dst_com[num_dst_intersections],
struct exchange_ext  dst_ext[num_dst_intersections],
int(*)  src_removals_per_intersection[2],
int(*)  dst_removals_per_intersection[2],
int  tag_offset,
MPI_Comm  comm 
)
static

Definition at line 642 of file xt_xmap_intersection_ext.c.

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

◆ generate_dir_transfer_ext_dst()

static struct Xt_pos_ext_vec generate_dir_transfer_ext_dst ( int  num_intersections,
const struct Xt_com_list  intersections[num_intersections],
Xt_idxlist  mypart_idxlist,
int *  resCount,
struct exchange_ext **  resSets,
int(*)  dst_removals_per_intersection[2] 
)
static

Definition at line 447 of file xt_xmap_intersection_ext.c.

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

◆ generate_dir_transfer_pos_ext_src()

static void generate_dir_transfer_pos_ext_src ( int  num_intersections,
const struct Xt_com_list  intersections[num_intersections],
Xt_idxlist  mypart_idxlist,
int *  resCount,
struct exchange_ext **  resSets,
int(*)  removals_per_intersection[2],
struct Xt_pos_ext pos_updates 
)
static

Definition at line 784 of file xt_xmap_intersection_ext.c.

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

◆ generate_transfer_ext()

static void generate_transfer_ext ( struct Xt_xmap_intersection_ext_ xmap,
int  num_src_intersections,
const struct Xt_com_list  src_com[num_src_intersections],
int  num_dst_intersections,
const struct Xt_com_list  dst_com[num_dst_intersections],
Xt_idxlist  src_idxlist_local,
Xt_idxlist  dst_idxlist_local,
MPI_Comm  comm 
)
static

Definition at line 330 of file xt_xmap_intersection_ext.c.

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

◆ refine_stripes()

static struct Xt_stripe* refine_stripes ( int *  num_stripes_,
struct Xt_stripe *restrict  intersection_idxstripes,
size_t  num_pos_updates,
struct Xt_pos_ext *restrict  pos_updates 
)
static

Definition at line 833 of file xt_xmap_intersection_ext.c.

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

◆ remap_dst_intersections()

static void remap_dst_intersections ( int  num_dst_intersections,
const struct Xt_com_list  dst_com[num_dst_intersections],
Xt_idxlist  mypart_idxlist,
int  resCount,
struct exchange_ext  resSets[resCount],
int(*)  removals_per_intersection[2] 
)
static

Definition at line 751 of file xt_xmap_intersection_ext.c.

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

◆ remap_intersection()

static void remap_intersection ( Xt_idxlist  mypart_idxlist,
Xt_idxlist  intersection,
size_t  num_pos_updates,
struct Xt_pos_ext  pos_updates[num_pos_updates],
struct exchange_ext resSet,
int  single_match_only 
)
static

Definition at line 890 of file xt_xmap_intersection_ext.c.

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

◆ xmap_intersection_ext_copy()

static Xt_xmap xmap_intersection_ext_copy ( Xt_xmap  xmap)
static

Definition at line 202 of file xt_xmap_intersection_ext.c.

Here is the call graph for this function:

◆ xmap_intersection_ext_delete()

static void xmap_intersection_ext_delete ( Xt_xmap  xmap)
static

Definition at line 234 of file xt_xmap_intersection_ext.c.

Here is the call graph for this function:

◆ xmap_intersection_ext_get_communicator()

static MPI_Comm xmap_intersection_ext_get_communicator ( Xt_xmap  xmap)
static

Definition at line 131 of file xt_xmap_intersection_ext.c.

Here is the call graph for this function:

◆ xmap_intersection_ext_get_destination_ranks() [1/2]

static void xmap_intersection_ext_get_destination_ranks ( Xt_xmap  xmap,
int *  ranks 
)
static

◆ xmap_intersection_ext_get_destination_ranks() [2/2]

static void xmap_intersection_ext_get_destination_ranks ( Xt_xmap  xmap,
int *restrict  ranks 
)
static

Definition at line 152 of file xt_xmap_intersection_ext.c.

Here is the call graph for this function:

◆ xmap_intersection_ext_get_in_iterator()

static Xt_xmap_iter xmap_intersection_ext_get_in_iterator ( Xt_xmap  xmap)
static

Definition at line 953 of file xt_xmap_intersection_ext.c.

Here is the call graph for this function:

◆ xmap_intersection_ext_get_max_dst_pos()

static int xmap_intersection_ext_get_max_dst_pos ( Xt_xmap  xmap)
static

Definition at line 175 of file xt_xmap_intersection_ext.c.

Here is the call graph for this function:

◆ xmap_intersection_ext_get_max_src_pos()

static int xmap_intersection_ext_get_max_src_pos ( Xt_xmap  xmap)
static

Definition at line 171 of file xt_xmap_intersection_ext.c.

Here is the call graph for this function:

◆ xmap_intersection_ext_get_num_destinations()

static int xmap_intersection_ext_get_num_destinations ( Xt_xmap  xmap)
static

Definition at line 137 of file xt_xmap_intersection_ext.c.

Here is the call graph for this function:

◆ xmap_intersection_ext_get_num_sources()

static int xmap_intersection_ext_get_num_sources ( Xt_xmap  xmap)
static

Definition at line 144 of file xt_xmap_intersection_ext.c.

Here is the call graph for this function:

◆ xmap_intersection_ext_get_out_iterator()

static Xt_xmap_iter xmap_intersection_ext_get_out_iterator ( Xt_xmap  xmap)
static

Definition at line 969 of file xt_xmap_intersection_ext.c.

Here is the call graph for this function:

◆ xmap_intersection_ext_get_source_ranks() [1/2]

static void xmap_intersection_ext_get_source_ranks ( Xt_xmap  xmap,
int *  ranks 
)
static

◆ xmap_intersection_ext_get_source_ranks() [2/2]

static void xmap_intersection_ext_get_source_ranks ( Xt_xmap  xmap,
int *restrict  ranks 
)
static

Definition at line 162 of file xt_xmap_intersection_ext.c.

Here is the call graph for this function:

◆ xmap_intersection_ext_iterator_delete()

static void xmap_intersection_ext_iterator_delete ( Xt_xmap_iter  iter)
static

Definition at line 1052 of file xt_xmap_intersection_ext.c.

Here is the caller graph for this function:

◆ xmap_intersection_ext_iterator_get_num_transfer_pos()

static int xmap_intersection_ext_iterator_get_num_transfer_pos ( Xt_xmap_iter  iter)
static

Definition at line 1035 of file xt_xmap_intersection_ext.c.

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

◆ xmap_intersection_ext_iterator_get_num_transfer_pos_ext()

static int xmap_intersection_ext_iterator_get_num_transfer_pos_ext ( Xt_xmap_iter  iter)
static

Definition at line 1047 of file xt_xmap_intersection_ext.c.

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

◆ xmap_intersection_ext_iterator_get_rank()

static int xmap_intersection_ext_iterator_get_rank ( Xt_xmap_iter  iter)
static

Definition at line 1004 of file xt_xmap_intersection_ext.c.

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

◆ xmap_intersection_ext_iterator_get_transfer_pos()

static int const * xmap_intersection_ext_iterator_get_transfer_pos ( Xt_xmap_iter  iter)
static

Definition at line 1011 of file xt_xmap_intersection_ext.c.

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

◆ xmap_intersection_ext_iterator_get_transfer_pos_ext()

static const struct Xt_pos_ext * xmap_intersection_ext_iterator_get_transfer_pos_ext ( Xt_xmap_iter  iter)
static

Definition at line 1041 of file xt_xmap_intersection_ext.c.

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

◆ xmap_intersection_ext_iterator_next()

static int xmap_intersection_ext_iterator_next ( Xt_xmap_iter  iter)
static

Definition at line 991 of file xt_xmap_intersection_ext.c.

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

◆ xmap_intersection_ext_msg_copy()

static void xmap_intersection_ext_msg_copy ( size_t  nmsg,
struct exchange_ext *restrict  msg,
int *  nmsg_copy,
struct exchange_ext **  msg_copy 
)
static

Definition at line 180 of file xt_xmap_intersection_ext.c.

Here is the caller graph for this function:

◆ xmie()

static Xt_xmap_intersection_ext xmie ( void *  xmap)
inlinestatic

Definition at line 126 of file xt_xmap_intersection_ext.c.

Here is the caller graph for this function:

◆ xmiei()

static Xt_xmap_iter_intersection_ext xmiei ( void *  iter)
inlinestatic

Definition at line 986 of file xt_xmap_intersection_ext.c.

Here is the caller graph for this function:

◆ xt_free_exchange_ext()

static void xt_free_exchange_ext ( size_t  num_msg,
struct exchange_ext *restrict  msg 
)
static

Definition at line 225 of file xt_xmap_intersection_ext.c.

Here is the caller graph for this function:

◆ Xt_get_pos_ext_overlap()

static struct Xt_pos_ext_overlap Xt_get_pos_ext_overlap ( struct Xt_pos_ext  a,
struct Xt_pos_ext  b 
)
static

Definition at line 406 of file xt_xmap_intersection_ext.c.

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

◆ xt_xmap_intersection_ext_new()

Xt_xmap xt_xmap_intersection_ext_new ( int  num_src_intersections,
const struct Xt_com_list  src_com[num_src_intersections],
int  num_dst_intersections,
const struct Xt_com_list  dst_com[num_dst_intersections],
Xt_idxlist  src_idxlist,
Xt_idxlist  dst_idxlist,
MPI_Comm  comm 
)

constructor for an exchange map
This operation is collective over all processes in comm
it uses the provided intersection information to generate the exchange map. Internally this function uses ranges to represent index list positions and is therefore conserving space for somewhat contiguous index lists. Depending on the size and shape of intersections this can impact performance drastically..

Parameters
[in]num_src_intersectionsnumber of source intersections
[in]src_comarray containing the source intersections with the other processes and their rank
[in]num_dst_intersectionsnumber of destination intersections
[in]dst_comarray containing the destination intersections with the other processes and their rank
[in]src_idxlistsource index list
[in]dst_idxlistdestination index list
[in]commMPI communicator that contains all processes that part in the exchange

Definition at line 260 of file xt_xmap_intersection_ext.c.

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

Variable Documentation

◆ xmap_intersection_vtable

const struct Xt_xmap_vtable xmap_intersection_vtable
static
Initial value:
= {
static int xmap_intersection_ext_get_max_src_pos(Xt_xmap xmap)
static Xt_xmap_iter xmap_intersection_ext_get_in_iterator(Xt_xmap xmap)
static int xmap_intersection_ext_get_max_dst_pos(Xt_xmap xmap)
static Xt_xmap_iter xmap_intersection_ext_get_out_iterator(Xt_xmap xmap)
static Xt_xmap xmap_intersection_ext_copy(Xt_xmap xmap)
static void xmap_intersection_ext_delete(Xt_xmap xmap)
static MPI_Comm xmap_intersection_ext_get_communicator(Xt_xmap xmap)
static void xmap_intersection_ext_get_destination_ranks(Xt_xmap xmap, int *ranks)
static void xmap_intersection_ext_get_source_ranks(Xt_xmap xmap, int *ranks)
static int xmap_intersection_ext_get_num_sources(Xt_xmap xmap)
static int xmap_intersection_ext_get_num_destinations(Xt_xmap xmap)

Definition at line 87 of file xt_xmap_intersection_ext.c.

◆ xmap_iterator_intersection_ext_vtable

const struct Xt_xmap_iter_vtable xmap_iterator_intersection_ext_vtable
static
Initial value:
= {
.get_num_transfer_pos_ext
static int xmap_intersection_ext_iterator_get_num_transfer_pos_ext(Xt_xmap_iter iter)
static int xmap_intersection_ext_iterator_get_rank(Xt_xmap_iter iter)
static int xmap_intersection_ext_iterator_get_num_transfer_pos(Xt_xmap_iter iter)
static void xmap_intersection_ext_iterator_delete(Xt_xmap_iter iter)
static int xmap_intersection_ext_iterator_next(Xt_xmap_iter iter)
static const struct Xt_pos_ext * xmap_intersection_ext_iterator_get_transfer_pos_ext(Xt_xmap_iter iter)
static int const * xmap_intersection_ext_iterator_get_transfer_pos(Xt_xmap_iter iter)

Definition at line 933 of file xt_xmap_intersection_ext.c.