Yet Another eXchange Tool  DO_NOT_EDIT_HERE
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 
99 size_t xt_idxlist_get_pack_size(Xt_idxlist idxlist, MPI_Comm comm);
100 
125 void xt_idxlist_pack(Xt_idxlist idxlist, void* buffer, int buffer_size,
126  int* position, MPI_Comm comm);
127 
145 Xt_idxlist xt_idxlist_unpack(void* buffer, int buffer_size,
146  int* position, MPI_Comm comm);
147 
160 xt_idxlist_get_intersection(Xt_idxlist idxlist_src, Xt_idxlist idxlist_dst);
161 
169 
177 
184 void xt_idxlist_get_indices(Xt_idxlist idxlist, Xt_int *indices);
185 
194 
205  struct Xt_stripe **stripes,
206  int *num_stripes);
207 
217 int xt_idxlist_get_index_at_position(Xt_idxlist idxlist, int position,
218  Xt_int * index);
219 
233  const int *positions,
234  int num_pos, Xt_int *indices,
235  Xt_int undef_idx);
236 
249  int *position);
250 
270  const Xt_int *indices,
271  int num_indices, int *positions,
272  int single_match_only);
273 
294  Xt_idxlist idxlist,
295  int num_stripes,
296  const struct Xt_stripe stripes[num_stripes],
297  int *num_ext,
298  struct Xt_pos_ext **pos_ext,
299  int single_match_only);
300 
301 
316  int * position, int offset);
317 
335 /* FIXME: this should probably return the number of failed lookups */
337  const Xt_int *indices,
338  int num_indices, int * positions,
339  int * offsets);
340 
348 
356 
370 void xt_idxlist_get_bounding_box(Xt_idxlist idxlist, unsigned ndim,
371  const Xt_int global_size[ndim],
372  Xt_int global_start_index,
373  struct Xt_bounds bounds[ndim]);
374 
382 
383 #endif // XT_IDXLIST_H
384 
385 /*
386  * Local Variables:
387  * c-basic-offset: 2
388  * coding: utf-8
389  * indent-tabs-mode: nil
390  * show-trailing-whitespace: t
391  * require-trailing-newline: t
392  * End:
393  */
Xt_idxlist xt_idxlist_unpack(void *buffer, int buffer_size, int *position, MPI_Comm comm)
int xt_idxlist_get_num_indices(Xt_idxlist idxlist)
Definition: xt_idxlist.c:97
base definitions header file
uint64_t Xt_uid
Definition: xt_core.h:72
void xt_idxlist_get_indices(Xt_idxlist idxlist, Xt_int *indices)
Definition: xt_idxlist.c:101
void xt_idxlist_delete(Xt_idxlist idxlist)
Definition: xt_idxlist.c:73
int xt_idxlist_get_position_of_index_off(Xt_idxlist idxlist, Xt_int index, int *position, int offset)
Definition: xt_idxlist.c:253
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:321
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:261
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:192
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:154
void xt_idxlist_get_index_stripes(Xt_idxlist idxlist, struct Xt_stripe **stripes, int *num_stripes)
Definition: xt_idxlist.c:117
Xt_int xt_idxlist_get_min_index(Xt_idxlist idxlist)
Definition: xt_idxlist.c:296
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:226
Xt_int size
Definition: xt_idxlist.h:66
int xt_idxlist_get_index_at_position(Xt_idxlist idxlist, int position, Xt_int *index)
Definition: xt_idxlist.c:147
int xt_idxlist_get_position_of_index(Xt_idxlist idxlist, Xt_int index, int *position)
Definition: xt_idxlist.c:185
XT_INT Xt_int
Definition: xt_core.h:68
Xt_int xt_idxlist_get_max_index(Xt_idxlist idxlist)
Definition: xt_idxlist.c:301
Xt_uid xt_idxlist_get_uid(Xt_idxlist idxlist)
Definition: xt_idxlist.c:414
Xt_idxlist xt_idxlist_copy(Xt_idxlist idxlist)
Definition: xt_idxlist.c:92
size_t xt_idxlist_get_pack_size(Xt_idxlist idxlist, MPI_Comm comm)
Definition: xt_idxlist.c:78
Xt_int start
Definition: xt_idxlist.h:66
const Xt_int * xt_idxlist_get_indices_const(Xt_idxlist idxlist)
Definition: xt_idxlist.c:107
void xt_idxlist_pack(Xt_idxlist idxlist, void *buffer, int buffer_size, int *position, MPI_Comm comm)
Definition: xt_idxlist.c:84
int MPI_Comm
Definition: core.h:64
Xt_idxlist xt_idxlist_get_intersection(Xt_idxlist idxlist_src, Xt_idxlist idxlist_dst)