Yet Another eXchange Tool  DO_NOT_EDIT_HERE
Data Structures | Typedefs | Enumerations | Functions | Variables
xt_xmap_intersection.c File Reference
#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_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 "ensure_array_size.h"
#include "xt_arithmetic_util.h"
Include dependency graph for xt_xmap_intersection.c:

Go to the source code of this file.

Data Structures

struct  Xt_xmap_iter_intersection_
 
struct  exchange_data
 
struct  Xt_xmap_intersection_
 
struct  pos_run
 

Typedefs

typedef struct Xt_xmap_iter_intersection_Xt_xmap_iter_intersection
 
typedef struct Xt_xmap_intersection_Xt_xmap_intersection
 

Enumerations

enum  { bitsPerCoverageElement = sizeof (unsigned long) * CHAR_BIT }
 

Functions

static MPI_Comm xmap_intersection_get_communicator (Xt_xmap xmap)
 
static int xmap_intersection_get_num_destinations (Xt_xmap xmap)
 
static int xmap_intersection_get_num_sources (Xt_xmap xmap)
 
static void xmap_intersection_get_destination_ranks (Xt_xmap xmap, int *ranks)
 
static void xmap_intersection_get_source_ranks (Xt_xmap xmap, int *ranks)
 
static Xt_xmap_iter xmap_intersection_get_in_iterator (Xt_xmap xmap)
 
static Xt_xmap_iter xmap_intersection_get_out_iterator (Xt_xmap xmap)
 
static Xt_xmap xmap_intersection_copy (Xt_xmap xmap)
 
static void xmap_intersection_delete (Xt_xmap xmap)
 
static int xmap_intersection_iterator_next (Xt_xmap_iter iter)
 
static int xmap_intersection_iterator_get_rank (Xt_xmap_iter iter)
 
static int const * xmap_intersection_iterator_get_transfer_pos (Xt_xmap_iter iter)
 
static int xmap_intersection_iterator_get_num_transfer_pos (Xt_xmap_iter iter)
 
static const struct Xt_pos_extxmap_intersection_iterator_get_transfer_pos_ext (Xt_xmap_iter iter)
 
static int xmap_intersection_iterator_get_num_transfer_pos_ext (Xt_xmap_iter iter)
 
static void xmap_intersection_iterator_delete (Xt_xmap_iter iter)
 
static int xmap_intersection_get_max_src_pos (Xt_xmap xmap)
 
static int xmap_intersection_get_max_dst_pos (Xt_xmap xmap)
 
static Xt_xmap_iter_intersection xmii (void *iter)
 
static Xt_xmap_intersection xmi (void *xmap)
 
static struct pos_run get_pos_run_len (size_t num_pos, const int *restrict pos)
 
static size_t count_transfer_pos_ext (size_t intersection_size, const int *restrict intersection_pos)
 
static int generate_dir_transfer_pos_dst (int num_intersections, const struct Xt_com_list intersections[num_intersections], Xt_idxlist mypart_idxlist, int *resCount, struct exchange_data **resSets, Xt_int **indices_to_remove, int *num_indices_to_remove_per_intersection)
 
static void generate_dir_transfer_pos_src (int num_intersections, const struct Xt_com_list intersections[num_intersections], Xt_idxlist mypart_idxlist, int *resCount, struct exchange_data **resSets, Xt_int *indices_to_remove, int *num_indices_to_remove_per_intersection)
 
static void exchange_points_to_remove (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_int **src_indices_to_remove, int *restrict num_src_indices_to_remove_per_intersection, Xt_int *dst_indices_to_remove, int *restrict num_dst_indices_to_remove_per_intersection, int tag_offset, MPI_Comm comm)
 
static int generate_transfer_pos (struct Xt_xmap_intersection_ *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_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 void xmap_intersection_msg_copy (size_t nmsg, struct exchange_data *restrict msg, int *nmsg_copy, struct exchange_data **msg_copy)
 
static void xmap_intersection_msg_delete (int nmsg, struct exchange_data *msg)
 

Variables

static const struct Xt_xmap_iter_vtable xmap_iterator_intersection_vtable
 
static const struct Xt_xmap_vtable xmap_intersection_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.c.

Typedef Documentation

◆ Xt_xmap_intersection

Definition at line 161 of file xt_xmap_intersection.c.

◆ Xt_xmap_iter_intersection

Definition at line 107 of file xt_xmap_intersection.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
bitsPerCoverageElement 

Definition at line 208 of file xt_xmap_intersection.c.

Function Documentation

◆ count_transfer_pos_ext()

static size_t count_transfer_pos_ext ( size_t  intersection_size,
const int *restrict  intersection_pos 
)
static

Definition at line 239 of file xt_xmap_intersection.c.

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

◆ exchange_points_to_remove()

static void exchange_points_to_remove ( 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_int **  src_indices_to_remove,
int *restrict  num_src_indices_to_remove_per_intersection,
Xt_int dst_indices_to_remove,
int *restrict  num_dst_indices_to_remove_per_intersection,
int  tag_offset,
MPI_Comm  comm 
)
static

Definition at line 449 of file xt_xmap_intersection.c.

Here is the caller graph for this function:

◆ generate_dir_transfer_pos_dst()

static int generate_dir_transfer_pos_dst ( int  num_intersections,
const struct Xt_com_list  intersections[num_intersections],
Xt_idxlist  mypart_idxlist,
int *  resCount,
struct exchange_data **  resSets,
Xt_int **  indices_to_remove,
int *  num_indices_to_remove_per_intersection 
)
static

Definition at line 252 of file xt_xmap_intersection.c.

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

◆ generate_dir_transfer_pos_src()

static void generate_dir_transfer_pos_src ( int  num_intersections,
const struct Xt_com_list  intersections[num_intersections],
Xt_idxlist  mypart_idxlist,
int *  resCount,
struct exchange_data **  resSets,
Xt_int indices_to_remove,
int *  num_indices_to_remove_per_intersection 
)
static

Definition at line 363 of file xt_xmap_intersection.c.

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

◆ generate_transfer_pos()

static int generate_transfer_pos ( struct Xt_xmap_intersection_ 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 552 of file xt_xmap_intersection.c.

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

◆ get_pos_run_len()

static struct pos_run get_pos_run_len ( size_t  num_pos,
const int *restrict  pos 
)
static

Definition at line 220 of file xt_xmap_intersection.c.

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

◆ xmap_intersection_copy()

static Xt_xmap xmap_intersection_copy ( Xt_xmap  xmap)
static

Definition at line 682 of file xt_xmap_intersection.c.

Here is the call graph for this function:

◆ xmap_intersection_delete()

static void xmap_intersection_delete ( Xt_xmap  xmap)
static

Definition at line 714 of file xt_xmap_intersection.c.

Here is the call graph for this function:

◆ xmap_intersection_get_communicator()

static MPI_Comm xmap_intersection_get_communicator ( Xt_xmap  xmap)
static

Definition at line 169 of file xt_xmap_intersection.c.

Here is the call graph for this function:

◆ xmap_intersection_get_destination_ranks()

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

Definition at line 192 of file xt_xmap_intersection.c.

Here is the call graph for this function:

◆ xmap_intersection_get_in_iterator()

static Xt_xmap_iter xmap_intersection_get_in_iterator ( Xt_xmap  xmap)
static

Definition at line 727 of file xt_xmap_intersection.c.

Here is the call graph for this function:

◆ xmap_intersection_get_max_dst_pos()

static int xmap_intersection_get_max_dst_pos ( Xt_xmap  xmap)
static

Definition at line 657 of file xt_xmap_intersection.c.

Here is the call graph for this function:

◆ xmap_intersection_get_max_src_pos()

static int xmap_intersection_get_max_src_pos ( Xt_xmap  xmap)
static

Definition at line 653 of file xt_xmap_intersection.c.

Here is the call graph for this function:

◆ xmap_intersection_get_num_destinations()

static int xmap_intersection_get_num_destinations ( Xt_xmap  xmap)
static

Definition at line 176 of file xt_xmap_intersection.c.

Here is the call graph for this function:

◆ xmap_intersection_get_num_sources()

static int xmap_intersection_get_num_sources ( Xt_xmap  xmap)
static

Definition at line 184 of file xt_xmap_intersection.c.

Here is the call graph for this function:

◆ xmap_intersection_get_out_iterator()

static Xt_xmap_iter xmap_intersection_get_out_iterator ( Xt_xmap  xmap)
static

Definition at line 743 of file xt_xmap_intersection.c.

Here is the call graph for this function:

◆ xmap_intersection_get_source_ranks()

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

Definition at line 200 of file xt_xmap_intersection.c.

Here is the call graph for this function:

◆ xmap_intersection_iterator_delete()

static void xmap_intersection_iterator_delete ( Xt_xmap_iter  iter)
static

Definition at line 825 of file xt_xmap_intersection.c.

◆ xmap_intersection_iterator_get_num_transfer_pos()

static int xmap_intersection_iterator_get_num_transfer_pos ( Xt_xmap_iter  iter)
static

Definition at line 819 of file xt_xmap_intersection.c.

Here is the call graph for this function:

◆ xmap_intersection_iterator_get_num_transfer_pos_ext()

static int xmap_intersection_iterator_get_num_transfer_pos_ext ( Xt_xmap_iter  iter)
static

Definition at line 813 of file xt_xmap_intersection.c.

Here is the call graph for this function:

◆ xmap_intersection_iterator_get_rank()

static int xmap_intersection_iterator_get_rank ( Xt_xmap_iter  iter)
static

Definition at line 772 of file xt_xmap_intersection.c.

Here is the call graph for this function:

◆ xmap_intersection_iterator_get_transfer_pos()

static int const * xmap_intersection_iterator_get_transfer_pos ( Xt_xmap_iter  iter)
static

Definition at line 779 of file xt_xmap_intersection.c.

Here is the call graph for this function:

◆ xmap_intersection_iterator_get_transfer_pos_ext()

static const struct Xt_pos_ext * xmap_intersection_iterator_get_transfer_pos_ext ( Xt_xmap_iter  iter)
static

Definition at line 786 of file xt_xmap_intersection.c.

Here is the call graph for this function:

◆ xmap_intersection_iterator_next()

static int xmap_intersection_iterator_next ( Xt_xmap_iter  iter)
static

Definition at line 759 of file xt_xmap_intersection.c.

Here is the call graph for this function:

◆ xmap_intersection_msg_copy()

static void xmap_intersection_msg_copy ( size_t  nmsg,
struct exchange_data *restrict  msg,
int *  nmsg_copy,
struct exchange_data **  msg_copy 
)
static

Definition at line 663 of file xt_xmap_intersection.c.

Here is the caller graph for this function:

◆ xmap_intersection_msg_delete()

static void xmap_intersection_msg_delete ( int  nmsg,
struct exchange_data msg 
)
static

Definition at line 705 of file xt_xmap_intersection.c.

Here is the caller graph for this function:

◆ xmi()

static Xt_xmap_intersection xmi ( void *  xmap)
inlinestatic

Definition at line 164 of file xt_xmap_intersection.c.

Here is the caller graph for this function:

◆ xmii()

static Xt_xmap_iter_intersection xmii ( void *  iter)
inlinestatic

Definition at line 118 of file xt_xmap_intersection.c.

Here is the caller graph for this function:

◆ xt_xmap_intersection_new()

Xt_xmap xt_xmap_intersection_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

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 595 of file xt_xmap_intersection.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:
= {
.get_num_destinations = xmap_intersection_get_num_destinations,
.get_destination_ranks = xmap_intersection_get_destination_ranks,
static int xmap_intersection_get_max_src_pos(Xt_xmap xmap)
static void xmap_intersection_get_destination_ranks(Xt_xmap xmap, int *ranks)
static void xmap_intersection_get_source_ranks(Xt_xmap xmap, int *ranks)
static Xt_xmap xmap_intersection_copy(Xt_xmap xmap)
static Xt_xmap_iter xmap_intersection_get_in_iterator(Xt_xmap xmap)
static int xmap_intersection_get_num_destinations(Xt_xmap xmap)
static int xmap_intersection_get_max_dst_pos(Xt_xmap xmap)
static void xmap_intersection_delete(Xt_xmap xmap)
static Xt_xmap_iter xmap_intersection_get_out_iterator(Xt_xmap xmap)
static MPI_Comm xmap_intersection_get_communicator(Xt_xmap xmap)
static int xmap_intersection_get_num_sources(Xt_xmap xmap)

Definition at line 124 of file xt_xmap_intersection.c.

◆ xmap_iterator_intersection_vtable

const struct Xt_xmap_iter_vtable xmap_iterator_intersection_vtable
static
Initial value:
= {
.get_num_transfer_pos_ext
static int xmap_intersection_iterator_next(Xt_xmap_iter iter)
static void xmap_intersection_iterator_delete(Xt_xmap_iter iter)
static int const * xmap_intersection_iterator_get_transfer_pos(Xt_xmap_iter iter)
static const struct Xt_pos_ext * xmap_intersection_iterator_get_transfer_pos_ext(Xt_xmap_iter iter)
static int xmap_intersection_iterator_get_num_transfer_pos_ext(Xt_xmap_iter iter)
static int xmap_intersection_iterator_get_num_transfer_pos(Xt_xmap_iter iter)
static int xmap_intersection_iterator_get_rank(Xt_xmap_iter iter)

Definition at line 97 of file xt_xmap_intersection.c.