Yet Another eXchange Tool
0.9.0
|
#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_xmap_intersection_common.h"
#include "xt_arithmetic_util.h"
#include "ensure_array_size.h"
#include "xt_cover.h"
#include "xt/quicksort.h"
Go to the source code of this file.
Classes | |
struct | exchange_ext |
struct | Xt_xmap_intersection_ext_ |
struct | ted_result |
struct | tes_result |
struct | Xt_pos_ext_overlap |
struct | up_state |
struct | spread_state |
struct | Xt_xmap_iter_intersection_ext_ |
Typedefs | |
typedef struct Xt_xmap_intersection_ext_ * | Xt_xmap_intersection_ext |
typedef int(* | Xt_pos_ext_copy) (size_t num_orig_pos_ext, size_t *num_pos_ext, struct Xt_pos_ext **pos_ext, const struct Xt_pos_ext *orig_pos_ext, size_t num_orig_pos, const int *orig_pos, void *state) |
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 | xmap_intersection_ext_reorder (Xt_xmap xmap, enum xt_reorder_type type) |
static Xt_xmap | xmap_intersection_ext_update_positions (Xt_xmap xmap, const int *src_positions, const int *dst_positions) |
static Xt_xmap | xmap_intersection_ext_spread (Xt_xmap xmap, int num_repetitions, const int src_displacements[num_repetitions], const int dst_displacements[num_repetitions]) |
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 int | pos_ext_copy_verbatim (size_t num_orig_pos_ext, size_t *num_pos_ext, struct Xt_pos_ext **pos_ext, const struct Xt_pos_ext *orig_pos_ext, size_t num_orig_pos, const int *orig_pos, void *state) |
static void | xmap_intersection_ext_msg_copy (size_t nmsg, const struct exchange_ext *restrict msg, int *nmsg_copy, struct exchange_ext *restrict msg_copy, int *max_pos_, int num_repetitions, Xt_pos_ext_copy pos_ext_copy, void *pec_state) |
static Xt_xmap | xmap_intersection_ext_copy_ (Xt_xmap xmap, int num_repetitions, Xt_pos_ext_copy pe_cpy_in, void *peci_state, Xt_pos_ext_copy pe_cpy_out, void *peco_state) |
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 ted_result | generate_dir_transfer_pos_ext_dst (int num_intersections, const struct Xt_com_list intersections[num_intersections], Xt_idxlist mypart_idxlist, struct exchange_ext *resSets, int(*restrict dst_removals_per_intersection)[2]) |
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(*restrict src_removals_per_intersection)[2], const 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], const int(*removals_per_intersection)[2]) |
static struct tes_result | generate_dir_transfer_pos_ext_src (int num_intersections, const struct Xt_com_list intersections[num_intersections], Xt_idxlist mypart_idxlist, struct exchange_ext *resSets, const int(*restrict removals_per_intersection)[2], const 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, struct Xt_pos_ext_vec *pos_exts) |
static struct Xt_pos_ext * | get_pos_exts_of_index_stripes (Xt_idxlist idxlist, int num_stripes, const struct Xt_stripe stripes[num_stripes], int *num_ext, int single_match_only) |
static struct ted_result | generate_dir_transfer_pos_ext_dst (int num_intersections, const struct Xt_com_list intersections[num_intersections], Xt_idxlist mypart_idxlist, struct exchange_ext *restrict resSets, int(*restrict dst_removals_per_intersection)[2]) |
static void | remap_intersection (Xt_idxlist mypart_idxlist, Xt_idxlist intersection, size_t num_pos_updates, const struct Xt_pos_ext pos_updates[num_pos_updates], struct exchange_ext *resSet, int single_match_only) |
static int | pos_ext_find_max_pos (int num_pos_ext, const struct Xt_pos_ext *restrict pos_ext) |
static struct Xt_stripe * | refine_stripes (int *num_stripes_, struct Xt_stripe *restrict intersection_idxstripes, size_t num_pos_updates, const struct Xt_pos_ext *restrict pos_updates) |
static struct Xt_pos_ext * | exchange_transfer_pos_ext (int n_out, const struct exchange_ext *restrict out_msg, int n_in, const struct exchange_ext *restrict in_msg, struct exchange_ext *restrict remote_out_msg, int tag_offset, MPI_Comm comm) |
static void | sort_transfer_pos_ext (int n, struct exchange_ext *msg) |
static void | sort_transfer_pos_ext_permutation (int n, struct exchange_ext *msg, struct exchange_ext *permutation_msg) |
static void | reorder_transfer_pos_ext (int n_out, int n_in, struct exchange_ext *out_msg, struct exchange_ext *in_msg, int tag_offset, MPI_Comm comm) |
static int | update_positions (size_t num_orig_pos_ext, size_t *num_pos_ext, struct Xt_pos_ext **pos_ext, const struct Xt_pos_ext *orig_pos_ext, size_t num_orig_pos, const int *orig_pos, void *state_) |
static int | pos_ext_copy_spread (size_t num_orig_pos_ext, size_t *num_pos_ext, struct Xt_pos_ext **pos_ext, const struct Xt_pos_ext *orig_pos_ext, size_t num_orig_pos, const int *orig_pos, void *state) |
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_ext * | xmap_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 |
Definition in file xt_xmap_intersection_ext.c.
typedef int(* Xt_pos_ext_copy) (size_t num_orig_pos_ext, size_t *num_pos_ext, struct Xt_pos_ext **pos_ext, const struct Xt_pos_ext *orig_pos_ext, size_t num_orig_pos, const int *orig_pos, void *state) |
Definition at line 195 of file xt_xmap_intersection_ext.c.
typedef struct Xt_xmap_intersection_ext_* Xt_xmap_intersection_ext |
Definition at line 139 of file xt_xmap_intersection_ext.c.
typedef struct Xt_xmap_iter_intersection_ext_* Xt_xmap_iter_intersection_ext |
Definition at line 1414 of file xt_xmap_intersection_ext.c.
|
static |
Definition at line 681 of file xt_xmap_intersection_ext.c.
|
static |
Definition at line 726 of file xt_xmap_intersection_ext.c.
|
static |
Definition at line 1015 of file xt_xmap_intersection_ext.c.
|
static |
|
static |
Definition at line 515 of file xt_xmap_intersection_ext.c.
|
static |
Definition at line 863 of file xt_xmap_intersection_ext.c.
|
static |
Definition at line 406 of file xt_xmap_intersection_ext.c.
|
static |
Definition at line 515 of file xt_xmap_intersection_ext.c.
|
static |
Definition at line 1338 of file xt_xmap_intersection_ext.c.
|
static |
Definition at line 203 of file xt_xmap_intersection_ext.c.
|
inlinestatic |
Definition at line 863 of file xt_xmap_intersection_ext.c.
|
static |
Definition at line 928 of file xt_xmap_intersection_ext.c.
|
static |
Definition at line 832 of file xt_xmap_intersection_ext.c.
|
static |
Definition at line 985 of file xt_xmap_intersection_ext.c.
|
static |
Definition at line 1201 of file xt_xmap_intersection_ext.c.
|
static |
Definition at line 1094 of file xt_xmap_intersection_ext.c.
|
static |
Definition at line 1143 of file xt_xmap_intersection_ext.c.
|
static |
Definition at line 1270 of file xt_xmap_intersection_ext.c.
Definition at line 281 of file xt_xmap_intersection_ext.c.
|
static |
Definition at line 247 of file xt_xmap_intersection_ext.c.
|
static |
Definition at line 298 of file xt_xmap_intersection_ext.c.
Definition at line 146 of file xt_xmap_intersection_ext.c.
|
static |
|
static |
Definition at line 167 of file xt_xmap_intersection_ext.c.
|
static |
Definition at line 1424 of file xt_xmap_intersection_ext.c.
|
static |
Definition at line 191 of file xt_xmap_intersection_ext.c.
|
static |
Definition at line 187 of file xt_xmap_intersection_ext.c.
|
static |
Definition at line 152 of file xt_xmap_intersection_ext.c.
|
static |
Definition at line 159 of file xt_xmap_intersection_ext.c.
|
static |
Definition at line 1440 of file xt_xmap_intersection_ext.c.
|
static |
|
static |
Definition at line 178 of file xt_xmap_intersection_ext.c.
|
static |
Definition at line 1515 of file xt_xmap_intersection_ext.c.
|
static |
Definition at line 1498 of file xt_xmap_intersection_ext.c.
|
static |
Definition at line 1510 of file xt_xmap_intersection_ext.c.
|
static |
Definition at line 1475 of file xt_xmap_intersection_ext.c.
|
static |
Definition at line 1482 of file xt_xmap_intersection_ext.c.
|
static |
Definition at line 1504 of file xt_xmap_intersection_ext.c.
|
static |
Definition at line 1462 of file xt_xmap_intersection_ext.c.
|
static |
Definition at line 219 of file xt_xmap_intersection_ext.c.
|
static |
Definition at line 1234 of file xt_xmap_intersection_ext.c.
|
static |
Definition at line 1372 of file xt_xmap_intersection_ext.c.
|
static |
Definition at line 1306 of file xt_xmap_intersection_ext.c.
|
inlinestatic |
Definition at line 141 of file xt_xmap_intersection_ext.c.
|
inlinestatic |
Definition at line 1457 of file xt_xmap_intersection_ext.c.
|
static |
Definition at line 290 of file xt_xmap_intersection_ext.c.
|
static |
Definition at line 406 of file xt_xmap_intersection_ext.c.
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..
[in] | num_src_intersections | number of source intersections |
[in] | src_com | array containing the source intersections with the other processes and their rank |
[in] | num_dst_intersections | number of destination intersections |
[in] | dst_com | array containing the destination intersections with the other processes and their rank |
[in] | src_idxlist | source index list |
[in] | dst_idxlist | destination index list |
[in] | comm | MPI communicator that contains all processes that part in the exchange |
Definition at line 320 of file xt_xmap_intersection_ext.c.
|
static |
Definition at line 94 of file xt_xmap_intersection_ext.c.
|
static |
Definition at line 1401 of file xt_xmap_intersection_ext.c.