Yet Another eXchange Tool  0.9.0
xt_idxlist.h
Go to the documentation of this file.
1 
12 /*
13  * Keywords:
14  * Maintainer: Jörg Behrens <behrens@dkrz.de>
15  * Moritz Hanke <hanke@dkrz.de>
16  * Thomas Jahns <jahns@dkrz.de>
17  * URL: https://doc.redmine.dkrz.de/yaxt/html/
18  *
19  * Redistribution and use in source and binary forms, with or without
20  * modification, are permitted provided that the following conditions are
21  * met:
22  *
23  * Redistributions of source code must retain the above copyright notice,
24  * this list of conditions and the following disclaimer.
25  *
26  * Redistributions in binary form must reproduce the above copyright
27  * notice, this list of conditions and the following disclaimer in the
28  * documentation and/or other materials provided with the distribution.
29  *
30  * Neither the name of the DKRZ GmbH nor the names of its contributors
31  * may be used to endorse or promote products derived from this software
32  * without specific prior written permission.
33  *
34  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
35  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
36  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
37  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
38  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
39  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
40  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
41  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
42  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
43  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
44  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
45  */
46 
47 #ifndef XT_IDXLIST_H
48 #define XT_IDXLIST_H
49 
50 #ifdef HAVE_CONFIG_H
51 #include <config.h>
52 #endif
53 
54 #include <stdlib.h>
55 #include "xt/xt_core.h"
56 #include "xt/xt_stripe.h"
57 
65 struct Xt_bounds {
67 };
68 
81 void xt_idxlist_delete(Xt_idxlist idxlist);
82 
100 size_t xt_idxlist_get_pack_size(Xt_idxlist idxlist, MPI_Comm comm);
101 
126 void xt_idxlist_pack(Xt_idxlist idxlist, void* buffer, int buffer_size,
127  int* position, MPI_Comm comm);
128 
146 Xt_idxlist xt_idxlist_unpack(void* buffer, int buffer_size,
147  int* position, MPI_Comm comm);
148 
161 xt_idxlist_get_intersection(Xt_idxlist idxlist_src, Xt_idxlist idxlist_dst);
162 
170 
178 
185 void xt_idxlist_get_indices(Xt_idxlist idxlist, Xt_int *indices);
186 
195 
206  struct Xt_stripe **stripes,
207  int *num_stripes);
208 
218 int xt_idxlist_get_index_at_position(Xt_idxlist idxlist, int position,
219  Xt_int * index);
220 
234  const int *positions,
235  int num_pos, Xt_int *indices,
236  Xt_int undef_idx);
237 
250  int *position);
251 
271  const Xt_int *indices,
272  int num_indices, int *positions,
273  int single_match_only);
274 
297  Xt_idxlist idxlist,
298  int num_stripes,
299  const struct Xt_stripe stripes[num_stripes],
300  int *num_ext,
301  struct Xt_pos_ext **pos_ext,
302  int single_match_only);
303 
304 
319  int * position, int offset);
320 
338 /* FIXME: this should probably return the number of failed lookups */
340  const Xt_int *indices,
341  int num_indices, int * positions,
342  int * offsets);
343 
351 
359 
373 void xt_idxlist_get_bounding_box(Xt_idxlist idxlist, unsigned ndim,
374  const Xt_int global_size[ndim],
375  Xt_int global_start_index,
376  struct Xt_bounds bounds[ndim]);
377 
385 
386 #endif // XT_IDXLIST_H
387 
388 /*
389  * Local Variables:
390  * c-basic-offset: 2
391  * coding: utf-8
392  * indent-tabs-mode: nil
393  * show-trailing-whitespace: t
394  * require-trailing-newline: t
395  * End:
396  */
int MPI_Comm
Definition: core.h:64
Xt_int start
Definition: xt_idxlist.h:66
Xt_int size
Definition: xt_idxlist.h:66
base definitions header file
uint64_t Xt_uid
Definition: xt_core.h:72
XT_INT Xt_int
Definition: xt_core.h:68
int xt_idxlist_get_num_indices(Xt_idxlist idxlist)
Definition: xt_idxlist.c:98
int xt_idxlist_get_positions_of_indices(Xt_idxlist idxlist, const Xt_int *indices, int num_indices, int *positions, int single_match_only)
Definition: xt_idxlist.c:203
Xt_idxlist xt_idxlist_unpack(void *buffer, int buffer_size, int *position, MPI_Comm comm)
Xt_int xt_idxlist_get_min_index(Xt_idxlist idxlist)
Definition: xt_idxlist.c:307
int xt_idxlist_get_index_at_position(Xt_idxlist idxlist, int position, Xt_int *index)
Definition: xt_idxlist.c:158
Xt_int xt_idxlist_get_max_index(Xt_idxlist idxlist)
Definition: xt_idxlist.c:312
void xt_idxlist_get_indices(Xt_idxlist idxlist, Xt_int *indices)
Definition: xt_idxlist.c:102
int xt_idxlist_get_positions_of_indices_off(Xt_idxlist idxlist, const Xt_int *indices, int num_indices, int *positions, int *offsets)
Definition: xt_idxlist.c:272
Xt_uid xt_idxlist_get_uid(Xt_idxlist idxlist)
Definition: xt_idxlist.c:425
int xt_idxlist_get_position_of_index_off(Xt_idxlist idxlist, Xt_int index, int *position, int offset)
Definition: xt_idxlist.c:264
void xt_idxlist_pack(Xt_idxlist idxlist, void *buffer, int buffer_size, int *position, MPI_Comm comm)
Definition: xt_idxlist.c:85
size_t xt_idxlist_get_pack_size(Xt_idxlist idxlist, MPI_Comm comm)
Definition: xt_idxlist.c:79
int xt_idxlist_get_indices_at_positions(Xt_idxlist idxlist, const int *positions, int num_pos, Xt_int *indices, Xt_int undef_idx)
Definition: xt_idxlist.c:165
void xt_idxlist_get_index_stripes(Xt_idxlist idxlist, struct Xt_stripe **stripes, int *num_stripes)
Definition: xt_idxlist.c:118
void xt_idxlist_get_bounding_box(Xt_idxlist idxlist, unsigned ndim, const Xt_int global_size[ndim], Xt_int global_start_index, struct Xt_bounds bounds[ndim])
Definition: xt_idxlist.c:332
int xt_idxlist_get_pos_exts_of_index_stripes(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)
Definition: xt_idxlist.c:237
Xt_idxlist xt_idxlist_get_intersection(Xt_idxlist idxlist_src, Xt_idxlist idxlist_dst)
Xt_idxlist xt_idxlist_copy(Xt_idxlist idxlist)
Definition: xt_idxlist.c:93
const Xt_int * xt_idxlist_get_indices_const(Xt_idxlist idxlist)
Definition: xt_idxlist.c:108
int xt_idxlist_get_position_of_index(Xt_idxlist idxlist, Xt_int index, int *position)
Definition: xt_idxlist.c:196
void xt_idxlist_delete(Xt_idxlist idxlist)
Definition: xt_idxlist.c:74