Yet Another eXchange Tool 0.11.2
Loading...
Searching...
No Matches
xt_config_internal.h
Go to the documentation of this file.
1
13/*
14 * Maintainer: Jörg Behrens <behrens@dkrz.de>
15 * Moritz Hanke <hanke@dkrz.de>
16 * Thomas Jahns <jahns@dkrz.de>
17 *
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_CONFIG_INTERNAL_H
48#define XT_CONFIG_INTERNAL_H
49
50#ifdef HAVE_CONFIG_H
51#include <config.h>
52#endif
53
54#include <stdint.h>
55
56#include <mpi.h>
57
58#include "core/ppm_visibility.h"
59#include "xt/xt_redist.h"
60#include "xt/xt_config.h"
61#include "xt/sort_common.h"
63#include "xt_exchanger.h"
64
77
79{
80 void (*sort_int)(int *a, size_t n);
81 void (*sort_xt_int)(Xt_int *a, size_t n);
82 void (*sort_index)(Xt_int *restrict a, int n, int *restrict idx,
83 int reset_index);
84 void (*sort_idxpos)(idxpos_type *v, size_t n);
85 void (*sort_xt_int_permutation)(Xt_int a[], size_t n, int permutation[]);
86 void (*sort_int_permutation)(int a[], size_t n, int permutation[]);
87};
88
89
90struct Xt_config_ {
97 const struct Xt_sort_algo_funcptr *sort_funcs;
100 const struct Xt_xmdd_bucket_gen_ *xmdd_bucket_gen;
112 uint32_t flags;
113};
114
115extern struct Xt_config_ xt_default_config;
116
119
120int
121xt_sort_algo_id_by_name(const char *name);
122
133
134#define XT_CONFIG_GET_FORCE_NOSORT(config) \
135 (((config)->flags & xt_force_nosort) != UINT32_C(0))
136#define XT_CONFIG_SET_FORCE_NOSORT(config) \
137 do { (config)->flags |= (uint32_t)xt_force_nosort; } while (0)
138#define XT_CONFIG_UNSET_FORCE_NOSORT(config) \
139 do { (config)->flags &= ~(uint32_t)xt_force_nosort; } while (0)
140#define XT_CONFIG_SET_FORCE_NOSORT_BIT(config, val) \
141 do { (config)->flags = ((config)->flags & \
142 ~(uint32_t)xt_force_nosort) \
143 | ((uint32_t)(val != 0) << xt_force_nosort_bit_ofs); } while (0)
144
145#define XT_CONFIG_GET_XMAP_STRIPING(config) \
146 (((config)->flags >> xt_force_xmap_striping_bit_ofs) & 3U)
147#define XT_CONFIG_SET_XMAP_STRIPING(config, v) \
148 do { (config)->flags \
149 = ((config)->flags & ~(uint32_t)xt_force_xmap_striping_mask) \
150 | (uint32_t)((v&3) << xt_force_xmap_striping_bit_ofs); } \
151 while (0)
152
153#define XT_CONFIG_BUCKET_DESTROY(config, bucket_gen_state) \
154 do { if ((config)->xmdd_bucket_gen->destroy) \
155 (config)->xmdd_bucket_gen->destroy((bucket_gen_state)); \
156 } while (0)
157
158#endif /* XT_CONFIG_INTERNAL_H */
159/*
160 * Local Variables:
161 * c-basic-offset: 2
162 * coding: utf-8
163 * indent-tabs-mode: nil
164 * show-trailing-whitespace: t
165 * require-trailing-newline: t
166 * End:
167 */
int MPI_Comm
Definition core.h:64
#define PPM_DSO_INTERNAL
struct idxpos_struct idxpos_type
const struct Xt_sort_algo_funcptr * sort_funcs
Xt_exchanger_new exchanger_new
const struct Xt_xmdd_bucket_gen_ * xmdd_bucket_gen
void * exchanger_team_share
void(* sort_int)(int *a, size_t n)
void(* sort_xt_int_permutation)(Xt_int a[], size_t n, int permutation[])
void(* sort_idxpos)(idxpos_type *v, size_t n)
void(* sort_index)(Xt_int *restrict a, int n, int *restrict idx, int reset_index)
void(* sort_xt_int)(Xt_int *a, size_t n)
void(* sort_int_permutation)(int a[], size_t n, int permutation[])
struct Xt_config_ xt_default_config
Definition xt_config.c:204
char name[32]
Definition xt_config.c:93
opaque configuration object for settings where the default needs to be overridden
struct Xt_config_ * Xt_config
Definition xt_config.h:58
xt_config_flags
@ xt_force_xmap_striping_bit_ofs
@ xt_force_xmap_striping_num_bits
@ exch_no_dt_dup
@ xt_mthread_mode_num_bits
@ xt_force_nosort
@ xt_force_xmap_striping_mask
@ xt_mthread_mode_bit_ofs
@ xt_mthread_mode_mask
@ xt_force_nosort_bit_ofs
int xt_sort_algo_id_by_name(const char *name)
Definition xt_config.c:215
PPM_DSO_INTERNAL void xt_config_defaults_init(void)
Definition xt_config.c:525
PPM_DSO_INTERNAL Xt_exchanger_new xt_config_get_exchange_new_by_comm(Xt_config config, MPI_Comm comm)
Definition xt_config.c:158
XT_INT Xt_int
Definition xt_core.h:72
exchanging of data based on information provided by redist's
Xt_exchanger(* Xt_exchanger_new)(int nsend, int nrecv, const struct Xt_redist_msg *send_msgs, const struct Xt_redist_msg *recv_msgs, MPI_Comm comm, int tag_offset, Xt_config config)
redistribution of data