Yet Another eXchange Tool  DO_NOT_EDIT_HERE
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://doc.redmine.dkrz.de/yaxt/html/
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 "xt/xt_core.h"
55 #include "xt/xt_idxlist.h"
56 
58 
59  void (*delete)(Xt_idxlist);
60 
62  void (*pack)(Xt_idxlist, void*, int, int*, MPI_Comm);
64  void (*get_indices)(Xt_idxlist, Xt_int *indices);
65  Xt_int const * (*get_indices_const)(Xt_idxlist idxlist);
66  void (*get_index_stripes)(Xt_idxlist, struct Xt_stripe **, int *);
68  int (*get_indices_at_positions)(Xt_idxlist idxlist, const int *positions,
69  int num, Xt_int *index, Xt_int undef_idx);
71  int (*get_positions_of_indices)(Xt_idxlist, Xt_int const *, int, int *, int);
72  int (*get_pos_exts_of_index_stripes)(Xt_idxlist, int, const struct Xt_stripe *,
73  int *, struct Xt_pos_ext **, int);
75  int (*get_positions_of_indices_off)(Xt_idxlist, Xt_int const *, int,
76  int *, int *);
79  void (*get_bounding_box)(Xt_idxlist idxlist, unsigned ndim,
80  const Xt_int global_size[ndim],
81  Xt_int global_start_index,
82  struct Xt_bounds bounds[ndim]);
84 };
85 
86 struct Xt_idxlist_ {
87  const struct xt_idxlist_vtable *vtable;
90 };
91 
93 
95 
96 static inline void Xt_idxlist_init(Xt_idxlist idxlist,
97  const struct xt_idxlist_vtable *vtable,
98  int num_indices)
99 {
100  idxlist->vtable = vtable;
101  idxlist->uid = xt_idxlist_new_uid();
102  idxlist->num_indices = num_indices;
103 }
104 
106 xt_default_isect(Xt_idxlist idxlist_src, Xt_idxlist idxlist_dst);
107 
108 /*
109  * for index lists this large, stripe representation generally gives
110  * better performance for internal computations
111  */
112 enum {
114 };
115 
116 #endif
117 /*
118  * Local Variables:
119  * c-basic-offset: 2
120  * coding: utf-8
121  * indent-tabs-mode: nil
122  * show-trailing-whitespace: t
123  * require-trailing-newline: t
124  * End:
125  */
Xt_idxlist xt_default_isect(Xt_idxlist idxlist_src, Xt_idxlist idxlist_dst)
int(* get_position_of_index)(Xt_idxlist, Xt_int, int *)
base definitions header file
uint64_t Xt_uid
Definition: xt_core.h:72
int(* get_pos_exts_of_index_stripes)(Xt_idxlist, int, const struct Xt_stripe *, int *, struct Xt_pos_ext **, int)
int(* get_index_at_position)(Xt_idxlist, int, Xt_int *)
int(* get_indices_at_positions)(Xt_idxlist idxlist, const int *positions, int num, Xt_int *index, Xt_int undef_idx)
int(* get_position_of_index_off)(Xt_idxlist, Xt_int, int *, int)
void(* get_indices)(Xt_idxlist, Xt_int *indices)
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])
int(* get_positions_of_indices_off)(Xt_idxlist, Xt_int const *, int, int *, int *)
Xt_idxlist(* copy)(Xt_idxlist)
XT_INT Xt_int
Definition: xt_core.h:68
Xt_int(* get_max_index)(Xt_idxlist)
struct Xt_idxlist_ * Xt_idxlist
Definition: xt_core.h:80
static void Xt_idxlist_init(Xt_idxlist idxlist, const struct xt_idxlist_vtable *vtable, int num_indices)
void(* get_index_stripes)(Xt_idxlist, struct Xt_stripe **, int *)
Xt_uid xt_idxlist_new_uid(void)
Definition: xt_idxlist.c:396
void(* pack)(Xt_idxlist, void *, int, int *, MPI_Comm)
void xt_idxlist_intersection_init(void)
int(* get_positions_of_indices)(Xt_idxlist, Xt_int const *, int, int *, int)
const struct xt_idxlist_vtable * vtable
size_t(* get_pack_size)(Xt_idxlist, MPI_Comm)
Xt_int(* get_min_index)(Xt_idxlist)
index list declaration
int MPI_Comm
Definition: core.h:64