Yet Another eXchange Tool 0.11.4
Loading...
Searching...
No Matches
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_idxlist_internal.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_xmap_intersection_common.h"
#include "ensure_array_size.h"
#include "xt_arithmetic_util.h"
#include "xt_config_internal.h"
Include dependency graph for xt_xmap_intersection.c:

Go to the source code of this file.

Classes

struct  Xt_xmap_iter_intersection_
 
struct  exchange_data
 
struct  Xt_xmap_intersection_
 
struct  tpd_result
 
struct  pos_count_max
 
struct  a2abuf
 
struct  spread_state
 

Typedefs

typedef struct Xt_xmap_iter_intersection_Xt_xmap_iter_intersection
 
typedef struct Xt_xmap_intersection_Xt_xmap_intersection
 
typedef int(* Xt_pos_copy) (size_t num_pos, int *pos, const int *orig_pos, const void *state)
 

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 xmap_intersection_reorder (Xt_xmap xmap, enum xt_reorder_type type, Xt_config config)
 
static Xt_xmap xmap_intersection_update_positions (Xt_xmap xmap, const int *src_positions, const int *dst_positions)
 
static Xt_xmap xmap_intersection_spread (Xt_xmap xmap, int num_repetitions, const int src_displacements[num_repetitions], const int dst_displacements[num_repetitions])
 
static Xt_xmap_iter_intersection xmii (void *iter)
 
static Xt_xmap_intersection xmi (void *xmap)
 
static struct tpd_result generate_dir_transfer_pos_dst (int num_intersections, const struct Xt_com_list intersections[num_intersections], Xt_idxlist mypart_idxlist, struct exchange_data *restrict resSets, int *restrict num_indices_to_remove_per_intersection)
 
static struct pos_count_max generate_dir_transfer_pos_src (int num_intersections, const struct Xt_com_list intersections[num_intersections], Xt_idxlist mypart_idxlist, struct exchange_data *restrict resSets, const Xt_int *indices_to_remove, const int *num_indices_to_remove_per_intersection)
 
static Xt_intexchange_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], int *restrict num_src_indices_to_remove_per_intersection, Xt_int *dst_indices_to_remove, const 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)
 
Xt_xmap xt_xmap_intersection_custom_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, Xt_config XT_UNUSED(config))
 
static int pos_copy_verbatim (size_t num_pos, int *pos, const int *orig_pos, const void *state)
 
static void xmap_intersection_msg_copy (size_t nmsg, const struct exchange_data *restrict msg, int *nmsg_copy, struct exchange_data *restrict msg_copy, int *max_pos_, int num_repetitions, Xt_pos_copy pos_copy, const void *pos_copy_state)
 
static Xt_xmap xmap_intersection_copy_ (Xt_xmap xmap, int num_repetitions, Xt_pos_copy pos_copy_in, const void *pci_state, Xt_pos_copy pos_copy_out, const void *pco_state)
 
static void xmap_intersection_msg_delete (int nmsg, struct exchange_data *msg)
 
static struct a2abuf setup_buffer (int comm_size, int n, const struct exchange_data *msgs)
 
static void reorder_transfer_pos (int n_out, int n_in, struct exchange_data *out_msg, struct exchange_data *in_msg, MPI_Comm comm, Xt_config config)
 
static int subst_positions (size_t num_pos, int *restrict pos, const int *restrict orig_pos, const void *new_pos_)
 
static int pos_copy_spread (size_t num_pos, int *restrict pos, const int *restrict orig_pos, const void *state)
 
static struct pos_run copy_get_pos_run_len (size_t num_pos, const int *restrict pos, int *restrict pos_copy)
 
static struct pos_count_max max_count_pos_ext_and_copy (int max_pos, size_t num_pos, const int *restrict pos, int *restrict pos_copy)
 
static void init_exchange_data_from_com_pos (int count, struct exchange_data *restrict msgs, const struct Xt_com_pos *restrict com, int *max_pos)
 
Xt_xmap xt_xmap_intersection_pos_new (int num_src_msg, const struct Xt_com_pos src_com[num_src_msg], int num_dst_msg, const struct Xt_com_pos dst_com[num_dst_msg], MPI_Comm comm)
 

Variables

static const char filename [] = "xt_xmap_intersection.c"
 
static const struct Xt_xmap_iter_vtable xmap_iterator_intersection_vtable
 
static const struct Xt_xmap_vtable xmap_intersection_vtable
 

Detailed Description

Typedef Documentation

◆ Xt_pos_copy

typedef int(* Xt_pos_copy) (size_t num_pos, int *pos, const int *orig_pos, const void *state)

Definition at line 681 of file xt_xmap_intersection.c.

◆ Xt_xmap_intersection

Definition at line 190 of file xt_xmap_intersection.c.

◆ Xt_xmap_iter_intersection

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
bitsPerCoverageElement 

Definition at line 238 of file xt_xmap_intersection.c.

Function Documentation

◆ copy_get_pos_run_len()

static struct pos_run copy_get_pos_run_len ( size_t num_pos,
const int *restrict pos,
int *restrict pos_copy )
inlinestatic

Definition at line 1015 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 Xt_int * 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],
int *restrict num_src_indices_to_remove_per_intersection,
Xt_int * dst_indices_to_remove,
const int *restrict num_dst_indices_to_remove_per_intersection,
int tag_offset,
MPI_Comm comm )
static

Definition at line 445 of file xt_xmap_intersection.c.

Here is the caller graph for this function:

◆ generate_dir_transfer_pos_dst()

static struct tpd_result generate_dir_transfer_pos_dst ( int num_intersections,
const struct Xt_com_list intersections[num_intersections],
Xt_idxlist mypart_idxlist,
struct exchange_data *restrict resSets,
int *restrict num_indices_to_remove_per_intersection )
static

Definition at line 250 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 struct pos_count_max generate_dir_transfer_pos_src ( int num_intersections,
const struct Xt_com_list intersections[num_intersections],
Xt_idxlist mypart_idxlist,
struct exchange_data *restrict resSets,
const Xt_int * indices_to_remove,
const int * num_indices_to_remove_per_intersection )
static

Definition at line 362 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 547 of file xt_xmap_intersection.c.

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

◆ init_exchange_data_from_com_pos()

static void init_exchange_data_from_com_pos ( int count,
struct exchange_data *restrict msgs,
const struct Xt_com_pos *restrict com,
int * max_pos )
static

Definition at line 1052 of file xt_xmap_intersection.c.

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

◆ max_count_pos_ext_and_copy()

static struct pos_count_max max_count_pos_ext_and_copy ( int max_pos,
size_t num_pos,
const int *restrict pos,
int *restrict pos_copy )
static

Definition at line 1038 of file xt_xmap_intersection.c.

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

◆ pos_copy_spread()

static int pos_copy_spread ( size_t num_pos,
int *restrict pos,
const int *restrict orig_pos,
const void * state )
static

Definition at line 976 of file xt_xmap_intersection.c.

Here is the caller graph for this function:

◆ pos_copy_verbatim()

static int pos_copy_verbatim ( size_t num_pos,
int * pos,
const int * orig_pos,
const void * state )
static

Definition at line 686 of file xt_xmap_intersection.c.

Here is the caller graph for this function:

◆ reorder_transfer_pos()

static void reorder_transfer_pos ( int n_out,
int n_in,
struct exchange_data * out_msg,
struct exchange_data * in_msg,
MPI_Comm comm,
Xt_config config )
static

Definition at line 852 of file xt_xmap_intersection.c.

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

◆ setup_buffer()

static struct a2abuf setup_buffer ( int comm_size,
int n,
const struct exchange_data * msgs )
inlinestatic

Definition at line 829 of file xt_xmap_intersection.c.

Here is the caller graph for this function:

◆ subst_positions()

static int subst_positions ( size_t num_pos,
int *restrict pos,
const int *restrict orig_pos,
const void * new_pos_ )
static

Definition at line 944 of file xt_xmap_intersection.c.

Here is the caller graph for this function:

◆ xmap_intersection_copy()

static Xt_xmap xmap_intersection_copy ( Xt_xmap xmap)
static

Definition at line 765 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,
int num_repetitions,
Xt_pos_copy pos_copy_in,
const void * pci_state,
Xt_pos_copy pos_copy_out,
const void * pco_state )
static

Definition at line 729 of file xt_xmap_intersection.c.

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

◆ xmap_intersection_delete()

static void xmap_intersection_delete ( Xt_xmap xmap)
static

Definition at line 780 of file xt_xmap_intersection.c.

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

◆ xmap_intersection_get_communicator()

static MPI_Comm xmap_intersection_get_communicator ( Xt_xmap xmap)
static

Definition at line 198 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 221 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 791 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 676 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 672 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 205 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 213 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 807 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 230 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 1154 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 1148 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 1142 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 1112 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 1119 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 1126 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 1099 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,
const struct exchange_data *restrict msg,
int * nmsg_copy,
struct exchange_data *restrict msg_copy,
int * max_pos_,
int num_repetitions,
Xt_pos_copy pos_copy,
const void * pos_copy_state )
static

Definition at line 695 of file xt_xmap_intersection.c.

Here is the call graph for this function:
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 773 of file xt_xmap_intersection.c.

Here is the caller graph for this function:

◆ xmap_intersection_reorder()

static Xt_xmap xmap_intersection_reorder ( Xt_xmap xmap,
enum xt_reorder_type type,
Xt_config config )
static

Definition at line 914 of file xt_xmap_intersection.c.

Here is the call graph for this function:

◆ xmap_intersection_spread()

static Xt_xmap xmap_intersection_spread ( Xt_xmap xmap,
int num_repetitions,
const int src_displacements[num_repetitions],
const int dst_displacements[num_repetitions] )
static

Definition at line 998 of file xt_xmap_intersection.c.

Here is the call graph for this function:

◆ xmap_intersection_update_positions()

static Xt_xmap xmap_intersection_update_positions ( Xt_xmap xmap,
const int * src_positions,
const int * dst_positions )
static

Definition at line 960 of file xt_xmap_intersection.c.

Here is the call graph for this function:

◆ xmi()

static Xt_xmap_intersection xmi ( void * xmap)
inlinestatic

Definition at line 193 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 144 of file xt_xmap_intersection.c.

Here is the caller graph for this function:

◆ xt_xmap_intersection_custom_new()

Xt_xmap xt_xmap_intersection_custom_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,
Xt_config XT_UNUSEDconfig )

Definition at line 611 of file xt_xmap_intersection.c.

Here is the call graph for this function:
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:

◆ xt_xmap_intersection_pos_new()

Xt_xmap xt_xmap_intersection_pos_new ( int num_src_msg,
const struct Xt_com_pos src_com[num_src_msg],
int num_dst_msg,
const struct Xt_com_pos dst_com[num_dst_msg],
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_msgnumber of source messages
[in]src_comarray containing relative positions for all source messages and the destination rank
[in]num_dst_msgnumber of destination messages
[in]dst_comarray containing relative positions for all destination messages and the source rank
[in]commMPI communicator that contains all processes that part in the exchange

Definition at line 1075 of file xt_xmap_intersection.c.

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

Variable Documentation

◆ filename

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

Definition at line 75 of file xt_xmap_intersection.c.

◆ 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 Xt_xmap xmap_intersection_update_positions(Xt_xmap xmap, const int *src_positions, const int *dst_positions)
static Xt_xmap_iter xmap_intersection_get_in_iterator(Xt_xmap xmap)
static Xt_xmap xmap_intersection_spread(Xt_xmap xmap, int num_repetitions, const int src_displacements[num_repetitions], const int dst_displacements[num_repetitions])
static void xmap_intersection_get_source_ranks(Xt_xmap xmap, int *ranks)
static int xmap_intersection_get_max_dst_pos(Xt_xmap xmap)
static void xmap_intersection_get_destination_ranks(Xt_xmap xmap, int *ranks)
static int xmap_intersection_get_num_sources(Xt_xmap xmap)
static Xt_xmap xmap_intersection_copy(Xt_xmap xmap)
static MPI_Comm xmap_intersection_get_communicator(Xt_xmap xmap)
static void xmap_intersection_delete(Xt_xmap xmap)
static Xt_xmap_iter xmap_intersection_get_out_iterator(Xt_xmap xmap)
static int xmap_intersection_get_num_destinations(Xt_xmap xmap)
static int xmap_intersection_get_max_src_pos(Xt_xmap xmap)
static Xt_xmap xmap_intersection_reorder(Xt_xmap xmap, enum xt_reorder_type type, Xt_config config)

Definition at line 150 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_get_rank(Xt_xmap_iter iter)
static void xmap_intersection_iterator_delete(Xt_xmap_iter iter)
static int xmap_intersection_iterator_next(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_ext(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(Xt_xmap_iter iter)

Definition at line 123 of file xt_xmap_intersection.c.