Yet Another eXchange Tool
0.9.0
|
#include <assert.h>
#include <limits.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "xt/xt_core.h"
#include "xt_arithmetic_util.h"
#include "xt_arithmetic_long.h"
#include "xt/xt_idxlist.h"
#include "xt_idxlist_internal.h"
#include "xt/xt_idxempty.h"
#include "xt/xt_idxvec.h"
#include "xt/xt_idxstripes.h"
#include "xt_idxstripes_internal.h"
#include "xt_stripe_util.h"
#include "xt/xt_mpi.h"
#include "xt/xt_sort.h"
#include "xt_idxlist_unpack.h"
#include "xt_cover.h"
#include "core/core.h"
#include "core/ppm_xfuncs.h"
#include "ensure_array_size.h"
#include "instr.h"
Go to the source code of this file.
Classes | |
struct | Xt_stripes_sort |
struct | Xt_idxstripes_ |
struct | extended_gcd |
struct | Xt_stripes_lookup |
struct | int_vec |
struct | unmatched_tail |
Macros | |
#define | MIN(a, b) (((a)<(b))?(a):(b)) |
#define | MAX(a, b) (((a)>(b))?(a):(b)) |
Typedefs | |
typedef struct Xt_idxstripes_ * | Xt_idxstripes |
Enumerations | |
enum | { stripes_do_overlap_bit = 0 , stripes_some_have_zero_stride_bit , stripes_do_overlap_mask = 1 << stripes_do_overlap_bit , stripes_some_have_zero_stride_mask = 1 << stripes_some_have_zero_stride_bit } |
Functions | |
static void | idxstripes_delete (Xt_idxlist data) |
static size_t | idxstripes_get_pack_size (Xt_idxlist data, MPI_Comm comm) |
static void | idxstripes_pack (Xt_idxlist data, void *buffer, int buffer_size, int *position, MPI_Comm comm) |
static Xt_idxlist | idxstripes_copy (Xt_idxlist idxlist) |
static void | idxstripes_get_indices (Xt_idxlist idxlist, Xt_int *indices) |
static const Xt_int * | idxstripes_get_indices_const (Xt_idxlist idxlist) |
static void | idxstripes_get_index_stripes (Xt_idxlist idxlist, struct Xt_stripe **stripes, int *num_stripes) |
static int | idxstripes_get_index_at_position (Xt_idxlist idxlist, int position, Xt_int *index) |
static int | idxstripes_get_indices_at_positions (Xt_idxlist idxlist, const int *positions, int num, Xt_int *index, Xt_int undef_idx) |
static int | idxstripes_get_pos_exts_of_index_stripes (Xt_idxlist idxlist, int num_stripes, const struct Xt_stripe *stripes, int *num_ext, struct Xt_pos_ext **pos_ext, int single_match_only) |
static int | idxstripes_get_position_of_index (Xt_idxlist idxlist, Xt_int index, int *position) |
static int | idxstripes_get_position_of_index_off (Xt_idxlist idxlist, Xt_int index, int *position, int offset) |
static Xt_int | idxstripes_get_min_index (Xt_idxlist idxlist) |
static Xt_int | idxstripes_get_max_index (Xt_idxlist idxlist) |
void | xt_idxstripes_initialize (void) |
void | xt_idxstripes_finalize (void) |
static int | compare_xtstripes (const void *a_, const void *b_) |
static Xt_idxlist | idxstripes_aggregate (Xt_idxstripes idxstripes, const char *caller) |
Xt_idxlist | xt_idxstripes_new (struct Xt_stripe const *stripes, int num_stripes) |
Xt_idxlist | xt_idxstripes_from_idxlist_new (Xt_idxlist idxlist_src) |
Xt_idxlist | xt_idxstripes_prealloc_new (const struct Xt_stripe *stripes, int num_stripes) |
Xt_idxlist | xt_idxstripes_unpack (void *buffer, int buffer_size, int *position, MPI_Comm comm) |
static Xt_idxlist | compute_intersection_fallback (Xt_idxstripes idxstripes_src, Xt_idxstripes idxstripes_dst) |
static struct extended_gcd | extended_gcd (Xt_int a, Xt_int b) |
static struct Xt_stripe | get_stripe_intersection (struct Xt_stripe stripe_a, struct Xt_stripe stripe_b) |
static Xt_idxlist | idxstripes_compute_intersection (Xt_idxstripes idxstripes_src, Xt_idxstripes idxstripes_dst) |
Xt_idxlist | xt_idxstripes_get_intersection (Xt_idxlist idxlist_src, Xt_idxlist idxlist_dst) |
static void | append_ext (struct Xt_pos_ext pos_ext, struct Xt_pos_ext_vec *restrict result) |
static void | create_stripes_lookup (struct Xt_stripes_lookup *restrict db, Xt_idxstripes idxstripes) |
static void | destroy_stripes_lookup (struct Xt_stripes_lookup *restrict db) |
static size_t | bsearch_stripes_sort (size_t n, const struct Xt_stripes_sort a[n], Xt_int min_key) |
static void | find_candidates (struct Xt_stripe query, const struct Xt_stripes_lookup *restrict db, struct int_vec *candidates) |
static struct Xt_idxstripes_ * | expand_zero_stripes (size_t num_stripes, const struct Xt_stripe *restrict stripes) |
static size_t | idxstripes_get_pos_exts_of_index_stripe (struct Xt_stripe query, const struct Xt_stripes_lookup *restrict db, struct Xt_pos_ext_vec *restrict result, struct Xt_pos_ext_vec *restrict cover, bool single_match_only, size_t num_candidates, int *restrict candidates) |
int | idxstripes_get_pos_exts_of_index_stripes (Xt_idxlist idxlist, int num_stripes, const struct Xt_stripe stripes[num_stripes], int *num_ext, struct Xt_pos_ext **pos_exts, int single_match_only) |
static size_t | conditional_pos_ext_insert (struct Xt_stripe query, struct Xt_pos_ext pos_ext2add, const struct Xt_stripes_lookup *restrict db, struct Xt_pos_ext_vec *restrict result, struct Xt_pos_ext_vec *restrict cover, size_t num_candidates, int *restrict candidates) |
static struct unmatched_tail | idxstripes_complex_get_pos_exts_of_index_stripe (struct Xt_stripe query, const struct Xt_stripes_lookup *restrict stripes_lookup, struct Xt_pos_ext_vec *restrict result, struct Xt_pos_ext_vec *restrict cover, bool single_match_only, size_t num_candidates, int *restrict candidates) |
static size_t | pos_ext_insert (struct Xt_stripe query, struct Xt_pos_ext pos_ext2add, const struct Xt_stripes_lookup *stripes_lookup, struct Xt_pos_ext_vec *restrict result, struct Xt_pos_ext_vec *restrict cover, bool single_match_only, size_t num_candidates, int *restrict candidates) |
Variables | |
static const struct xt_idxlist_vtable | idxstripes_vtable |
static MPI_Datatype | stripe_dt |
Definition in file xt_idxstripes.c.
#define MAX | ( | a, | |
b | |||
) | (((a)>(b))?(a):(b)) |
Definition at line 77 of file xt_idxstripes.c.
#define MIN | ( | a, | |
b | |||
) | (((a)<(b))?(a):(b)) |
Definition at line 76 of file xt_idxstripes.c.
typedef struct Xt_idxstripes_* Xt_idxstripes |
Definition at line 192 of file xt_idxstripes.c.
anonymous enum |
Enumerator | |
---|---|
stripes_do_overlap_bit | |
stripes_some_have_zero_stride_bit | |
stripes_do_overlap_mask | |
stripes_some_have_zero_stride_mask |
Definition at line 203 of file xt_idxstripes.c.
|
inlinestatic |
Definition at line 1099 of file xt_idxstripes.c.
|
inlinestatic |
|
static |
|
static |
Definition at line 465 of file xt_idxstripes.c.
|
static |
Definition at line 1506 of file xt_idxstripes.c.
|
inlinestatic |
|
inlinestatic |
|
static |
Definition at line 1262 of file xt_idxstripes.c.
|
inlinestatic |
Definition at line 465 of file xt_idxstripes.c.
|
static |
Definition at line 1190 of file xt_idxstripes.c.
|
static |
Definition at line 232 of file xt_idxstripes.c.
|
static |
|
static |
Definition at line 769 of file xt_idxstripes.c.
|
static |
|
static |
Definition at line 383 of file xt_idxstripes.c.
|
static |
Definition at line 961 of file xt_idxstripes.c.
|
static |
Definition at line 926 of file xt_idxstripes.c.
|
static |
Definition at line 891 of file xt_idxstripes.c.
|
static |
Definition at line 990 of file xt_idxstripes.c.
|
static |
|
static |
Definition at line 1614 of file xt_idxstripes.c.
|
static |
Definition at line 1608 of file xt_idxstripes.c.
|
static |
Definition at line 394 of file xt_idxstripes.c.
|
static |
Definition at line 1410 of file xt_idxstripes.c.
|
static |
int idxstripes_get_pos_exts_of_index_stripes | ( | Xt_idxlist | idxlist, |
int | num_stripes, | ||
const struct Xt_stripe | stripes[num_stripes], | ||
int * | num_ext, | ||
struct Xt_pos_ext ** | pos_exts, | ||
int | single_match_only | ||
) |
|
static |
|
static |
|
static |
Definition at line 409 of file xt_idxstripes.c.
|
static |
Definition at line 1388 of file xt_idxstripes.c.
void xt_idxstripes_finalize | ( | void | ) |
Xt_idxlist xt_idxstripes_from_idxlist_new | ( | Xt_idxlist | idxlist_src | ) |
Creates an index list that is built up of stripes of indices by converting another index list into stripes.
[in] | idxlist_src | list to convert into stripes |
Definition at line 328 of file xt_idxstripes.c.
Xt_idxlist xt_idxstripes_get_intersection | ( | Xt_idxlist | idxlist_src, |
Xt_idxlist | idxlist_dst | ||
) |
Definition at line 869 of file xt_idxstripes.c.
void xt_idxstripes_initialize | ( | void | ) |
Xt_idxlist xt_idxstripes_new | ( | struct Xt_stripe const * | stripes, |
int | num_stripes | ||
) |
Generates an index list that is built up of stripes of indices.
[in] | stripes | array defining the stripes |
[in] | num_stripes | number of stripes |
Definition at line 293 of file xt_idxstripes.c.
Xt_idxlist xt_idxstripes_prealloc_new | ( | struct Xt_stripe const * | stripes, |
int | num_stripes | ||
) |
Generates an index list that is built up of stripes of indices. Does not copy the stripes.
[in] | stripes | array defining the stripes |
[in] | num_stripes | number of stripes |
Definition at line 360 of file xt_idxstripes.c.
Xt_idxlist xt_idxstripes_unpack | ( | void * | buffer, |
int | buffer_size, | ||
int * | position, | ||
MPI_Comm | comm | ||
) |
|
static |
Definition at line 130 of file xt_idxstripes.c.
|
static |
Definition at line 153 of file xt_idxstripes.c.