Yet Another eXchange Tool 0.11.2
Loading...
Searching...
No Matches
xt_idxsection.c File Reference
#include <assert.h>
#include <limits.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.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_idxsection.h"
#include "xt_idxsection_internal.h"
#include "xt/xt_mpi.h"
#include "xt/xt_sort.h"
#include "xt_idxlist_unpack.h"
#include "core/ppm_xfuncs.h"
#include "core/core.h"
#include "instr.h"
#include "xt_config_internal.h"
#include "xt_stripe_util.h"
#include "xt_idxvec_internal.h"
#include "xt_idxstripes_internal.h"
#include "xt_idxsection_stripe_intersection.h"
Include dependency graph for xt_idxsection.c:

Go to the source code of this file.

Classes

struct  dim_desc
 
struct  Xt_idxsection_
 
struct  section_aggregate
 

Macros

#define NUM_DIMENSIONS   1
 
#define NUM_DIMENSIONS   2
 
#define NUM_DIMENSIONS   3
 
#define NUM_DIMENSIONS   4
 
#define XT_IDXSECTION_STRIPES_ISECT_SINGLE_MATCH_ONLY
 
#define NUM_DIMENSIONS   1
 
#define NUM_DIMENSIONS   2
 
#define NUM_DIMENSIONS   3
 
#define NUM_DIMENSIONS   4
 

Typedefs

typedef struct Xt_idxsection_Xt_idxsection
 

Functions

static void idxsection_delete (Xt_idxlist data)
 
static size_t idxsection_get_pack_size (Xt_idxlist data, MPI_Comm comm)
 
static void idxsection_pack (Xt_idxlist data, void *buffer, int buffer_size, int *position, MPI_Comm comm)
 
static Xt_idxlist idxsection_copy (Xt_idxlist idxlist)
 
static Xt_idxlist idxsection_sorted_copy (Xt_idxlist idxlist, Xt_config config)
 
static void idxsection_get_indices (Xt_idxlist idxlist, Xt_int *indices)
 
static const Xt_intidxsection_get_indices_const (Xt_idxlist idxlist)
 
static int idxsection_get_num_index_stripes (Xt_idxlist idxlist)
 
static void idxsection_get_index_stripes (Xt_idxlist idxlist, struct Xt_stripe *restrict stripes, size_t num_stripes_alloc)
 
static int idxsection_get_index_at_position (Xt_idxlist idxlist, int position, Xt_int *index)
 
static int idxsection_get_position_of_index (Xt_idxlist idxlist, Xt_int index, int *position)
 
static int idxsection_get_position_of_index_off (Xt_idxlist idxlist, Xt_int index, int *position, int offset)
 
static size_t idxsection_get_positions_of_indices (Xt_idxlist body_idxlist, Xt_int const *selection_idx, size_t num_selection, int *positions, int single_match_only)
 
static Xt_int idxsection_get_min_index (Xt_idxlist idxlist)
 
static Xt_int idxsection_get_max_index (Xt_idxlist idxlist)
 
static int idxsection_get_sorting (Xt_idxlist idxlist)
 
static int idxsection_get_num_indices (Xt_idxsection section)
 
void xt_idxsection_initialize (void)
 
void xt_idxsection_finalize (void)
 
static struct Xt_minmax get_section_minmax (size_t num_dimensions, Xt_int local_start_index, const struct dim_desc dims[num_dimensions])
 
static struct section_aggregate setup_dims (Xt_int start, size_t num_dimensions, struct dim_desc dims[num_dimensions])
 
static int get_num_indices_from_local_sizes (size_t num_dimensions, const int local_size[num_dimensions])
 
Xt_idxlist xt_idxsection_new (Xt_int start, int num_dimensions, const Xt_int global_size[num_dimensions], const int local_size[num_dimensions], const Xt_int local_start[num_dimensions])
 
Xt_idxlist xt_idxsection_unpack (void *buffer, int buffer_size, int *position, MPI_Comm comm)
 
Xt_idxlist xt_idxsection_get_intersection_with_other_idxlist (Xt_idxlist src_idxsection, Xt_idxlist dst_idxlist, Xt_config config)
 
static void idxsection_init_sorted_copy (Xt_idxsection orig, Xt_idxsection copy)
 
Xt_idxlist xt_idxsection_get_idxstripes_intersection (Xt_idxlist src_idxlist, Xt_idxlist dst_idxlist, Xt_config config)
 
Xt_idxlist xt_idxsection_get_idxstripes_r_intersection (Xt_idxlist src_idxlist, Xt_idxlist dst_idxlist, Xt_config config)
 
Xt_idxlist xt_idxsection_get_intersection (Xt_idxlist idxlist_src, Xt_idxlist idxlist_dst, Xt_config config)
 
static int idxsection_get_indices_any (Xt_int start_index, Xt_int *indices, size_t num_dimensions, struct dim_desc dims[num_dimensions])
 
static void idxsection_create_index_array_cache (Xt_idxsection section)
 
static size_t idxsection_get_num_index_stripes_ (Xt_idxsection section)
 
static size_t idxsection_get_positions_of_indices_v1 (Xt_idxlist body_idxlist, const Xt_int selection_idx[], size_t num_selection, int positions[], int single_match_only)
 
static size_t idxsection_get_positions_of_indices_v2 (Xt_idxlist body_idxlist, const Xt_int selection_idx[], size_t num_selection, int positions[], int single_match_only)
 
static size_t idxsection_get_positions_of_indices_recursive (Xt_int index_offset, int position_offset, const Xt_int indices[], size_t num_indices, int positions[], int ndim, struct dim_desc dims[ndim])
 
static size_t idxsection_get_positions_of_indices_v3 (Xt_idxlist body_idxlist, const Xt_int *restrict selection_idx, size_t num_selection, int *restrict positions, int single_match_only)
 

Variables

static const struct xt_idxlist_vtable idxsection_vtable
 
static MPI_Datatype dim_desc_dt
 

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

Macro Definition Documentation

◆ NUM_DIMENSIONS [1/8]

#define NUM_DIMENSIONS   1

Definition at line 518 of file xt_idxsection.c.

◆ NUM_DIMENSIONS [2/8]

#define NUM_DIMENSIONS   2

Definition at line 518 of file xt_idxsection.c.

◆ NUM_DIMENSIONS [3/8]

#define NUM_DIMENSIONS   3

Definition at line 518 of file xt_idxsection.c.

◆ NUM_DIMENSIONS [4/8]

#define NUM_DIMENSIONS   4

Definition at line 518 of file xt_idxsection.c.

◆ NUM_DIMENSIONS [5/8]

#define NUM_DIMENSIONS   1

Definition at line 518 of file xt_idxsection.c.

◆ NUM_DIMENSIONS [6/8]

#define NUM_DIMENSIONS   2

Definition at line 518 of file xt_idxsection.c.

◆ NUM_DIMENSIONS [7/8]

#define NUM_DIMENSIONS   3

Definition at line 518 of file xt_idxsection.c.

◆ NUM_DIMENSIONS [8/8]

#define NUM_DIMENSIONS   4

Definition at line 518 of file xt_idxsection.c.

◆ XT_IDXSECTION_STRIPES_ISECT_SINGLE_MATCH_ONLY

#define XT_IDXSECTION_STRIPES_ISECT_SINGLE_MATCH_ONLY

Definition at line 575 of file xt_idxsection.c.

Typedef Documentation

◆ Xt_idxsection

typedef struct Xt_idxsection_* Xt_idxsection

Definition at line 168 of file xt_idxsection.c.

Function Documentation

◆ get_num_indices_from_local_sizes()

static int get_num_indices_from_local_sizes ( size_t num_dimensions,
const int local_size[num_dimensions] )
static

Definition at line 322 of file xt_idxsection.c.

Here is the caller graph for this function:

◆ get_section_minmax()

static struct Xt_minmax get_section_minmax ( size_t num_dimensions,
Xt_int local_start_index,
const struct dim_desc dims[num_dimensions] )
static

Definition at line 235 of file xt_idxsection.c.

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

◆ idxsection_copy()

static Xt_idxlist idxsection_copy ( Xt_idxlist idxlist)
static

Definition at line 736 of file xt_idxsection.c.

◆ idxsection_create_index_array_cache()

static void idxsection_create_index_array_cache ( Xt_idxsection section)
static

Definition at line 847 of file xt_idxsection.c.

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

◆ idxsection_delete()

static void idxsection_delete ( Xt_idxlist data)
static

Definition at line 379 of file xt_idxsection.c.

◆ idxsection_get_index_at_position()

static int idxsection_get_index_at_position ( Xt_idxlist idxlist,
int position,
Xt_int * index )
static

Definition at line 969 of file xt_idxsection.c.

◆ idxsection_get_index_stripes()

static void idxsection_get_index_stripes ( Xt_idxlist idxlist,
struct Xt_stripe *restrict stripes,
size_t num_stripes_alloc )
static

Definition at line 907 of file xt_idxsection.c.

Here is the call graph for this function:

◆ idxsection_get_indices()

static void idxsection_get_indices ( Xt_idxlist idxlist,
Xt_int * indices )
static

Definition at line 858 of file xt_idxsection.c.

Here is the call graph for this function:

◆ idxsection_get_indices_any()

static int idxsection_get_indices_any ( Xt_int start_index,
Xt_int * indices,
size_t num_dimensions,
struct dim_desc dims[num_dimensions] )
static

Definition at line 809 of file xt_idxsection.c.

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

◆ idxsection_get_indices_const()

static Xt_int const * idxsection_get_indices_const ( Xt_idxlist idxlist)
static

Definition at line 876 of file xt_idxsection.c.

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

◆ idxsection_get_max_index()

static Xt_int idxsection_get_max_index ( Xt_idxlist idxlist)
static

Definition at line 1548 of file xt_idxsection.c.

◆ idxsection_get_min_index()

static Xt_int idxsection_get_min_index ( Xt_idxlist idxlist)
static

Definition at line 1541 of file xt_idxsection.c.

◆ idxsection_get_num_index_stripes()

static int idxsection_get_num_index_stripes ( Xt_idxlist idxlist)
static

Definition at line 899 of file xt_idxsection.c.

Here is the call graph for this function:

◆ idxsection_get_num_index_stripes_()

static size_t idxsection_get_num_index_stripes_ ( Xt_idxsection section)
static

Definition at line 885 of file xt_idxsection.c.

Here is the caller graph for this function:

◆ idxsection_get_num_indices()

static int idxsection_get_num_indices ( Xt_idxsection section)
static

Definition at line 796 of file xt_idxsection.c.

Here is the caller graph for this function:

◆ idxsection_get_pack_size()

static size_t idxsection_get_pack_size ( Xt_idxlist data,
MPI_Comm comm )
static

Definition at line 390 of file xt_idxsection.c.

◆ idxsection_get_position_of_index()

static int idxsection_get_position_of_index ( Xt_idxlist idxlist,
Xt_int index,
int * position )
static

Definition at line 1001 of file xt_idxsection.c.

Here is the caller graph for this function:

◆ idxsection_get_position_of_index_off()

static int idxsection_get_position_of_index_off ( Xt_idxlist idxlist,
Xt_int index,
int * position,
int offset )
static

Definition at line 1528 of file xt_idxsection.c.

Here is the call graph for this function:

◆ idxsection_get_positions_of_indices()

static size_t idxsection_get_positions_of_indices ( Xt_idxlist body_idxlist,
Xt_int const * selection_idx,
size_t num_selection,
int * positions,
int single_match_only )
static

Definition at line 1486 of file xt_idxsection.c.

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

◆ idxsection_get_positions_of_indices_recursive()

static size_t idxsection_get_positions_of_indices_recursive ( Xt_int index_offset,
int position_offset,
const Xt_int indices[],
size_t num_indices,
int positions[],
int ndim,
struct dim_desc dims[ndim] )
static

Definition at line 1285 of file xt_idxsection.c.

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

◆ idxsection_get_positions_of_indices_v1()

static size_t idxsection_get_positions_of_indices_v1 ( Xt_idxlist body_idxlist,
const Xt_int selection_idx[],
size_t num_selection,
int positions[],
int single_match_only )
static

Definition at line 1063 of file xt_idxsection.c.

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

◆ idxsection_get_positions_of_indices_v2()

static size_t idxsection_get_positions_of_indices_v2 ( Xt_idxlist body_idxlist,
const Xt_int selection_idx[],
size_t num_selection,
int positions[],
int single_match_only )
static

Definition at line 1152 of file xt_idxsection.c.

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

◆ idxsection_get_positions_of_indices_v3()

static size_t idxsection_get_positions_of_indices_v3 ( Xt_idxlist body_idxlist,
const Xt_int *restrict selection_idx,
size_t num_selection,
int *restrict positions,
int single_match_only )
static

Definition at line 1390 of file xt_idxsection.c.

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

◆ idxsection_get_sorting()

static int idxsection_get_sorting ( Xt_idxlist idxlist)
static

Definition at line 1555 of file xt_idxsection.c.

◆ idxsection_init_sorted_copy()

static void idxsection_init_sorted_copy ( Xt_idxsection orig,
Xt_idxsection copy )
static

Definition at line 753 of file xt_idxsection.c.

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

◆ idxsection_pack()

static void idxsection_pack ( Xt_idxlist data,
void * buffer,
int buffer_size,
int * position,
MPI_Comm comm )
static

Definition at line 406 of file xt_idxsection.c.

◆ idxsection_sorted_copy()

static Xt_idxlist idxsection_sorted_copy ( Xt_idxlist idxlist,
Xt_config config )
static

Definition at line 784 of file xt_idxsection.c.

Here is the call graph for this function:

◆ setup_dims()

static struct section_aggregate setup_dims ( Xt_int start,
size_t num_dimensions,
struct dim_desc dims[num_dimensions] )
static
Returns
local start index, minimum and maximum index

Definition at line 264 of file xt_idxsection.c.

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

◆ xt_idxsection_finalize()

void xt_idxsection_finalize ( void )

Definition at line 229 of file xt_idxsection.c.

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

◆ xt_idxsection_get_idxstripes_intersection()

Xt_idxlist xt_idxsection_get_idxstripes_intersection ( Xt_idxlist src_idxlist,
Xt_idxlist dst_idxlist,
Xt_config config )

Definition at line 535 of file xt_idxsection.c.

◆ xt_idxsection_get_idxstripes_r_intersection()

Xt_idxlist xt_idxsection_get_idxstripes_r_intersection ( Xt_idxlist src_idxlist,
Xt_idxlist dst_idxlist,
Xt_config config )

Definition at line 592 of file xt_idxsection.c.

◆ xt_idxsection_get_intersection()

Xt_idxlist xt_idxsection_get_intersection ( Xt_idxlist idxlist_src,
Xt_idxlist idxlist_dst,
Xt_config config )

Definition at line 633 of file xt_idxsection.c.

Here is the call graph for this function:

◆ xt_idxsection_get_intersection_with_other_idxlist()

Xt_idxlist xt_idxsection_get_intersection_with_other_idxlist ( Xt_idxlist src_idxsection,
Xt_idxlist dst_idxlist,
Xt_config config )

Definition at line 458 of file xt_idxsection.c.

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

◆ xt_idxsection_initialize()

void xt_idxsection_initialize ( void )

Definition at line 195 of file xt_idxsection.c.

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

◆ xt_idxsection_new()

Xt_idxlist xt_idxsection_new ( Xt_int start,
int num_dimensions,
const Xt_int global_size[num_dimensions],
const int local_size[num_dimensions],
const Xt_int local_start[num_dimensions] )

generates an index list that is comprised of a section of a set of indices that are arranged in an n-dimensional cartesian coordinate system. The linear index correspondence is computed such that the right-most dimension is the one where indices increase fastest (i.e. according to C convention).

Parameters
[in]startlowest index of the global array (typically 0 or 1)
[in]num_dimensionsnumber of dimensions
[in]global_sizeglobal size of each dimension
[in]local_sizesize of the local section in each dimension
[in]local_startvector with the lowest position in each dimension of the local window within the global index space
Remarks
Negative values for global_size and local_size are allowed. Negative signs do not change the set of selected indices, only their ordering (see Negative global and local sizes).

Definition at line 333 of file xt_idxsection.c.

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

◆ xt_idxsection_unpack()

Xt_idxlist xt_idxsection_unpack ( void * buffer,
int buffer_size,
int * position,
MPI_Comm comm )

Definition at line 424 of file xt_idxsection.c.

Here is the call graph for this function:

Variable Documentation

◆ dim_desc_dt

MPI_Datatype dim_desc_dt
static

Definition at line 165 of file xt_idxsection.c.

◆ idxsection_vtable

const struct xt_idxlist_vtable idxsection_vtable
static
Initial value:
= {
.delete = idxsection_delete,
.get_pack_size = idxsection_get_pack_size,
.pack = idxsection_pack,
.copy = idxsection_copy,
.sorted_copy = idxsection_sorted_copy,
.get_indices = idxsection_get_indices,
.get_indices_const = idxsection_get_indices_const,
.get_num_index_stripes = idxsection_get_num_index_stripes,
.get_index_stripes = idxsection_get_index_stripes,
.get_index_at_position = idxsection_get_index_at_position,
.get_indices_at_positions = NULL,
.get_position_of_index = idxsection_get_position_of_index,
.get_positions_of_indices = idxsection_get_positions_of_indices,
.get_position_of_index_off = idxsection_get_position_of_index_off,
.get_positions_of_indices_off = NULL,
.get_min_index = idxsection_get_min_index,
.get_max_index = idxsection_get_max_index,
.get_sorting = idxsection_get_sorting,
.get_bounding_box = NULL,
.idxlist_pack_code = SECTION,
}
@ SECTION
static Xt_idxlist idxsection_copy(Xt_idxlist idxlist)
static size_t idxsection_get_positions_of_indices(Xt_idxlist body_idxlist, Xt_int const *selection_idx, size_t num_selection, int *positions, int single_match_only)
static int idxsection_get_position_of_index_off(Xt_idxlist idxlist, Xt_int index, int *position, int offset)
static Xt_int idxsection_get_max_index(Xt_idxlist idxlist)
static void idxsection_delete(Xt_idxlist data)
static int idxsection_get_num_index_stripes(Xt_idxlist idxlist)
static void idxsection_pack(Xt_idxlist data, void *buffer, int buffer_size, int *position, MPI_Comm comm)
static size_t idxsection_get_pack_size(Xt_idxlist data, MPI_Comm comm)
static int idxsection_get_sorting(Xt_idxlist idxlist)
static int idxsection_get_index_at_position(Xt_idxlist idxlist, int position, Xt_int *index)
static int idxsection_get_position_of_index(Xt_idxlist idxlist, Xt_int index, int *position)
static Xt_idxlist idxsection_sorted_copy(Xt_idxlist idxlist, Xt_config config)
static void idxsection_get_index_stripes(Xt_idxlist idxlist, struct Xt_stripe *restrict stripes, size_t num_stripes_alloc)
static Xt_int idxsection_get_min_index(Xt_idxlist idxlist)
static void idxsection_get_indices(Xt_idxlist idxlist, Xt_int *indices)
static const Xt_int * idxsection_get_indices_const(Xt_idxlist idxlist)

Definition at line 131 of file xt_idxsection.c.