Yet Another eXchange Tool  0.9.0
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);
73  const struct Xt_stripe *,
74  int *, struct Xt_pos_ext **, int);
77  int *, int *);
80  void (*get_bounding_box)(Xt_idxlist idxlist, unsigned ndim,
81  const Xt_int global_size[ndim],
82  Xt_int global_start_index,
83  struct Xt_bounds bounds[ndim]);
85 };
86 
87 void
89  struct Xt_stripe ** stripes,
90  int * num_stripes);
91 
92 struct Xt_idxlist_ {
93  const struct xt_idxlist_vtable *vtable;
96 };
97 
99 
101 
102 static inline void Xt_idxlist_init(Xt_idxlist idxlist,
103  const struct xt_idxlist_vtable *vtable,
104  int num_indices)
105 {
106  idxlist->vtable = vtable;
107  idxlist->uid = xt_idxlist_new_uid();
108  idxlist->num_indices = num_indices;
109 }
110 
112 xt_default_isect(Xt_idxlist idxlist_src, Xt_idxlist idxlist_dst);
113 
114 /*
115  * for index lists this large, stripe representation generally gives
116  * better performance for internal computations
117  */
118 enum {
120 };
121 
122 #endif
123 /*
124  * Local Variables:
125  * c-basic-offset: 2
126  * coding: utf-8
127  * indent-tabs-mode: nil
128  * show-trailing-whitespace: t
129  * require-trailing-newline: t
130  * End:
131  */
int MPI_Comm
Definition: core.h:64
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 *)
int(* get_indices_at_positions)(Xt_idxlist idxlist, const int *positions, int num, Xt_int *index, Xt_int undef_idx)
int(* get_pos_exts_of_index_stripes)(Xt_idxlist, int, const struct Xt_stripe *, int *, struct Xt_pos_ext **, int)
void(* pack)(Xt_idxlist, void *, int, int *, MPI_Comm)
void(* get_index_stripes)(Xt_idxlist, struct Xt_stripe **, int *)
Xt_idxlist(* copy)(Xt_idxlist)
int(* get_position_of_index)(Xt_idxlist, Xt_int, int *)
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)
Xt_int(* get_min_index)(Xt_idxlist)
int(* get_positions_of_indices)(Xt_idxlist, Xt_int const *, int, int *, int)
int(* get_positions_of_indices_off)(Xt_idxlist, Xt_int const *, int, int *, int *)
base definitions header file
uint64_t Xt_uid
Definition: xt_core.h:72
XT_INT Xt_int
Definition: xt_core.h:68
struct Xt_idxlist_ * Xt_idxlist
Definition: xt_core.h:80
index list declaration
void xt_idxlist_get_index_stripes_keep_buf(Xt_idxlist idxlist, struct Xt_stripe **stripes, int *num_stripes)
Definition: xt_idxlist.c:127
@ CHEAP_VECTOR_SIZE
Xt_idxlist xt_default_isect(Xt_idxlist idxlist_src, Xt_idxlist idxlist_dst)
static void Xt_idxlist_init(Xt_idxlist idxlist, const struct xt_idxlist_vtable *vtable, int num_indices)
Xt_uid xt_idxlist_new_uid(void)
Definition: xt_idxlist.c:407
void xt_idxlist_intersection_init(void)