Yet Another eXchange Tool 0.11.2
Loading...
Searching...
No Matches
xt_idxlist_internal.h
Go to the documentation of this file.
1
13/*
14 * Keywords:
15 * Maintainer: Jörg Behrens <behrens@dkrz.de>
16 * Moritz Hanke <hanke@dkrz.de>
17 * Thomas Jahns <jahns@dkrz.de>
18 * URL: https://dkrz-sw.gitlab-pages.dkrz.de/yaxt/
19 *
20 * Redistribution and use in source and binary forms, with or without
21 * modification, are permitted provided that the following conditions are
22 * met:
23 *
24 * Redistributions of source code must retain the above copyright notice,
25 * this list of conditions and the following disclaimer.
26 *
27 * Redistributions in binary form must reproduce the above copyright
28 * notice, this list of conditions and the following disclaimer in the
29 * documentation and/or other materials provided with the distribution.
30 *
31 * Neither the name of the DKRZ GmbH nor the names of its contributors
32 * may be used to endorse or promote products derived from this software
33 * without specific prior written permission.
34 *
35 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
36 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
37 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
38 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
39 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
40 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
41 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
42 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
43 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
44 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
45 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
46 */
47#ifndef XT_IDXLIST_INTERNAL_H
48#define XT_IDXLIST_INTERNAL_H
49
50#ifdef HAVE_CONFIG_H
51#include <config.h>
52#endif
53
54#include <stdbool.h>
55
56#include "core/ppm_visibility.h"
57#include "xt/xt_config.h"
58#include "xt/xt_core.h"
59#include "xt/xt_idxlist.h"
60
62
63 void (*delete)(Xt_idxlist);
64
66 void (*pack)(Xt_idxlist, void*, int, int*, MPI_Comm);
69 void (*get_indices)(Xt_idxlist, Xt_int *indices);
70 Xt_int const * (*get_indices_const)(Xt_idxlist idxlist);
72 void (*get_index_stripes)(Xt_idxlist, struct Xt_stripe *restrict, size_t);
74 int (*get_indices_at_positions)(Xt_idxlist idxlist, const int *positions,
75 int num, Xt_int *index, Xt_int undef_idx);
78 size_t, int *, int);
80 const struct Xt_stripe *,
81 int *, struct Xt_pos_ext **, int,
82 Xt_config);
85 int *, int *);
89 void (*get_bounding_box)(Xt_idxlist idxlist, unsigned ndim,
90 const Xt_int global_size[ndim],
91 Xt_int global_start_index,
92 struct Xt_bounds bounds[ndim]);
94};
95
98 struct Xt_stripe *restrict stripes,
99 size_t num_stripes_alloc);
100
102 const struct xt_idxlist_vtable *vtable;
105};
106
108
110
111static inline void Xt_idxlist_init(Xt_idxlist idxlist,
112 const struct xt_idxlist_vtable *vtable,
113 int num_indices)
114{
115 idxlist->vtable = vtable;
116 idxlist->uid = xt_idxlist_new_uid();
117 idxlist->num_indices = num_indices;
118}
119
121xt_default_isect(Xt_idxlist idxlist_src, Xt_idxlist idxlist_dst,
122 Xt_config config);
123
124#define xt_idxlist_get_num_indices(idxlist) ((idxlist)->num_indices)
125
126/*
127 * for index lists this large, stripe representation generally gives
128 * better performance for internal computations
129 */
130enum {
132};
133
136 Xt_config config);
137
140 Xt_idxlist idxlist,
141 int num_stripes,
142 const struct Xt_stripe stripes[num_stripes],
143 int *num_ext,
144 struct Xt_pos_ext **pos_ext,
145 int single_match_only,
146 Xt_config config);
147
148#endif
149/*
150 * Local Variables:
151 * c-basic-offset: 2
152 * coding: utf-8
153 * indent-tabs-mode: nil
154 * show-trailing-whitespace: t
155 * require-trailing-newline: t
156 * End:
157 */
int MPI_Comm
Definition core.h:64
#define PPM_DSO_INTERNAL
const struct xt_idxlist_vtable * vtable
size_t(* get_pack_size)(Xt_idxlist, MPI_Comm)
Xt_int(* get_max_index)(Xt_idxlist)
int(* get_position_of_index_off)(Xt_idxlist, Xt_int, int *, int)
int(* get_index_at_position)(Xt_idxlist, int, Xt_int *)
Xt_idxlist(* sorted_copy)(Xt_idxlist, Xt_config)
int(* get_indices_at_positions)(Xt_idxlist idxlist, const int *positions, int num, Xt_int *index, Xt_int undef_idx)
void(* get_index_stripes)(Xt_idxlist, struct Xt_stripe *restrict, size_t)
int(* get_pos_exts_of_index_stripes)(Xt_idxlist, int, const struct Xt_stripe *, int *, struct Xt_pos_ext **, int, Xt_config)
void(* pack)(Xt_idxlist, void *, int, int *, MPI_Comm)
Xt_idxlist(* copy)(Xt_idxlist)
int(* get_position_of_index)(Xt_idxlist, Xt_int, int *)
int(* get_num_index_stripes)(Xt_idxlist)
int(* get_sorting)(Xt_idxlist)
void(* get_bounding_box)(Xt_idxlist idxlist, unsigned ndim, const Xt_int global_size[ndim], Xt_int global_start_index, struct Xt_bounds bounds[ndim])
void(* get_indices)(Xt_idxlist, Xt_int *indices)
size_t(* get_positions_of_indices)(Xt_idxlist, Xt_int const *, size_t, int *, int)
Xt_int(* get_min_index)(Xt_idxlist)
int(* get_positions_of_indices_off)(Xt_idxlist, Xt_int const *, int, int *, int *)
opaque configuration object for settings where the default needs to be overridden
struct Xt_config_ * Xt_config
Definition xt_config.h:58
base definitions header file
uint64_t Xt_uid
Definition xt_core.h:76
XT_INT Xt_int
Definition xt_core.h:72
struct Xt_idxlist_ * Xt_idxlist
Definition xt_core.h:84
static struct xt_gpu_vtable vtable
Definition xt_gpu.c:75
index list declaration
PPM_DSO_INTERNAL Xt_uid xt_idxlist_new_uid(void)
Definition xt_idxlist.c:454
PPM_DSO_INTERNAL void xt_idxlist_intersection_init(void)
PPM_DSO_INTERNAL void xt_idxlist_get_index_stripes_keep_buf(Xt_idxlist idxlist, struct Xt_stripe *restrict stripes, size_t num_stripes_alloc)
PPM_DSO_INTERNAL Xt_idxlist xt_default_isect(Xt_idxlist idxlist_src, Xt_idxlist idxlist_dst, Xt_config config)
@ CHEAP_VECTOR_SIZE
static void Xt_idxlist_init(Xt_idxlist idxlist, const struct xt_idxlist_vtable *vtable, int num_indices)
PPM_DSO_INTERNAL bool xt_idxlist_is_stripe_conversion_profitable_(Xt_idxlist idxlist, Xt_config config)
Definition xt_idxlist.c:479
PPM_DSO_INTERNAL int xt_idxlist_get_pos_exts_of_index_stripes_custom(Xt_idxlist idxlist, int num_stripes, const struct Xt_stripe stripes[num_stripes], int *num_ext, struct Xt_pos_ext **pos_ext, int single_match_only, Xt_config config)
Definition xt_idxlist.c:275