Yet Another eXchange Tool  0.9.0
Classes | Typedefs | Functions | Variables
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/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/mergesort.h"
#include "xt/quicksort.h"
#include "xt_idxlist_unpack.h"
#include "core/ppm_xfuncs.h"
#include "core/core.h"
#include "instr.h"
Include dependency graph for xt_idxsection.c:

Go to the source code of this file.

Classes

struct  dim_desc
 
struct  Xt_idxsection_
 

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 void idxsection_get_indices (Xt_idxlist idxlist, Xt_int *indices)
 
static const Xt_intidxsection_get_indices_const (Xt_idxlist idxlist)
 
static void idxsection_get_index_stripes (Xt_idxlist idxlist, struct Xt_stripe **stripes, int *num_stripes)
 
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 int idxsection_get_positions_of_indices (Xt_idxlist body_idxlist, Xt_int const *selection_idx, int 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_num_indices (Xt_idxsection section)
 
void xt_idxsection_initialize (void)
 
void xt_idxsection_finalize (void)
 
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_idxlist xt_idxsection_get_intersection (Xt_idxlist idxlist_src, Xt_idxlist idxlist_dst)
 
static int idxsection_get_indices_any (Xt_int start_index, Xt_int *indices, int ndim, struct dim_desc dims[ndim])
 
static int idxsection_get_positions_of_indices_v1 (Xt_idxlist body_idxlist, const Xt_int selection_idx[], int num_selection, int positions[], int single_match_only)
 
static int idxsection_get_positions_of_indices_v2 (Xt_idxlist body_idxlist, const Xt_int selection_idx[], int 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 int idxsection_get_positions_of_indices_v3 (Xt_idxlist body_idxlist, const Xt_int *restrict selection_idx, int 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.

Typedef Documentation

◆ Xt_idxsection

typedef struct Xt_idxsection_* Xt_idxsection

Definition at line 146 of file xt_idxsection.c.

Function Documentation

◆ idxsection_copy()

static Xt_idxlist idxsection_copy ( Xt_idxlist  idxlist)
static

Definition at line 560 of file xt_idxsection.c.

◆ idxsection_delete()

static void idxsection_delete ( Xt_idxlist  data)
static

Definition at line 302 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 740 of file xt_idxsection.c.

◆ idxsection_get_index_stripes()

static void idxsection_get_index_stripes ( Xt_idxlist  idxlist,
struct Xt_stripe **  stripes,
int *  num_stripes 
)
static

Definition at line 676 of file xt_idxsection.c.

◆ idxsection_get_indices()

static void idxsection_get_indices ( Xt_idxlist  idxlist,
Xt_int indices 
)
static

Definition at line 630 of file xt_idxsection.c.

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

◆ idxsection_get_indices_any()

static int idxsection_get_indices_any ( Xt_int  start_index,
Xt_int indices,
int  ndim,
struct dim_desc  dims[ndim] 
)
static

Definition at line 593 of file xt_idxsection.c.

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 664 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 1359 of file xt_idxsection.c.

◆ idxsection_get_min_index()

static Xt_int idxsection_get_min_index ( Xt_idxlist  idxlist)
static

Definition at line 1352 of file xt_idxsection.c.

◆ idxsection_get_num_indices()

static int idxsection_get_num_indices ( Xt_idxsection  section)
static

Definition at line 579 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 313 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 775 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 1335 of file xt_idxsection.c.

Here is the call graph for this function:

◆ idxsection_get_positions_of_indices()

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

Definition at line 1282 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 1065 of file xt_idxsection.c.

Here is the caller graph for this function:

◆ idxsection_get_positions_of_indices_v1()

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

Definition at line 839 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 int idxsection_get_positions_of_indices_v2 ( Xt_idxlist  body_idxlist,
const Xt_int  selection_idx[],
int  num_selection,
int  positions[],
int  single_match_only 
)
static

Definition at line 928 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 int idxsection_get_positions_of_indices_v3 ( Xt_idxlist  body_idxlist,
const Xt_int *restrict  selection_idx,
int  num_selection,
int *restrict  positions,
int  single_match_only 
)
static

Definition at line 1188 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 329 of file xt_idxsection.c.

◆ xt_idxsection_finalize()

void xt_idxsection_finalize ( void  )

Definition at line 194 of file xt_idxsection.c.

Here is the caller graph for this function:

◆ xt_idxsection_get_intersection()

Xt_idxlist xt_idxsection_get_intersection ( Xt_idxlist  idxlist_src,
Xt_idxlist  idxlist_dst 
)

Definition at line 466 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 
)

Definition at line 398 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 167 of file xt_idxsection.c.

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 199 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 349 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 143 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,
.get_indices = idxsection_get_indices,
.get_indices_const = idxsection_get_indices_const,
.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_bounding_box = NULL,
.idxlist_pack_code = SECTION,
}
@ SECTION
static int idxsection_get_positions_of_indices(Xt_idxlist body_idxlist, Xt_int const *selection_idx, int num_selection, int *positions, int single_match_only)
static Xt_idxlist idxsection_copy(Xt_idxlist idxlist)
static void idxsection_get_index_stripes(Xt_idxlist idxlist, struct Xt_stripe **stripes, int *num_stripes)
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 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_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_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 114 of file xt_idxsection.c.