Yet Another eXchange Tool 0.11.1
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#ifdef HAVE_CONFIG_H
48#include <config.h>
49#endif
50
51#include <stdint.h>
52
53#include <mpi.h>
54
55#include "core/ppm_visibility.h"
56#include "xt/xt_redist.h"
57#include "xt/xt_config.h"
58#include "xt/sort_common.h"
60#include "xt_exchanger.h"
61
74
76{
77 void (*sort_int)(int *a, size_t n);
78 void (*sort_xt_int)(Xt_int *a, size_t n);
79 void (*sort_index)(Xt_int *restrict a, int n, int *restrict idx,
80 int reset_index);
81 void (*sort_idxpos)(idxpos_type *v, size_t n);
82 void (*sort_xt_int_permutation)(Xt_int a[], size_t n, int permutation[]);
83 void (*sort_int_permutation)(int a[], size_t n, int permutation[]);
84};
85
86
111
112extern struct Xt_config_ xt_default_config;
113
116
117int
118xt_sort_algo_id_by_name(const char *name);
119
130
131#define XT_CONFIG_GET_FORCE_NOSORT(config) \
132 (((config)->flags & xt_force_nosort) != UINT32_C(0))
133#define XT_CONFIG_SET_FORCE_NOSORT(config) \
134 do { (config)->flags |= (uint32_t)xt_force_nosort; } while (0)
135#define XT_CONFIG_UNSET_FORCE_NOSORT(config) \
136 do { (config)->flags &= ~(uint32_t)xt_force_nosort; } while (0)
137
138#define XT_CONFIG_GET_DIST_DIR_STRIPING(config) \
139 (((config)->flags >> xt_force_dist_dir_striping_bit_ofs) & 3U)
140#define XT_CONFIG_SET_DIST_DIR_STRIPING(config, v) \
141 do { (config)->flags \
142 = ((config)->flags & ~(uint32_t)xt_force_dist_dir_striping_mask) \
143 | (uint32_t)((v&3) << xt_force_dist_dir_striping_bit_ofs); } \
144 while (0)
145
146#define XT_CONFIG_BUCKET_DESTROY(config, bucket_gen_state) \
147 do { if ((config)->xmdd_bucket_gen->destroy) \
148 (config)->xmdd_bucket_gen->destroy((bucket_gen_state)); \
149 } while (0)
150/*
151 * Local Variables:
152 * c-basic-offset: 2
153 * coding: utf-8
154 * indent-tabs-mode: nil
155 * show-trailing-whitespace: t
156 * require-trailing-newline: t
157 * End:
158 */
int MPI_Comm
Definition core.h:64
#define PPM_DSO_INTERNAL
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[])
char name[32]
Definition xt_config.c:92
opaque configuration object for settings where the default needs to be overridden
xt_config_flags
@ exch_no_dt_dup
@ xt_mthread_mode_num_bits
@ xt_force_dist_dir_striping_mask
@ xt_force_dist_dir_striping_bit_ofs
@ xt_force_nosort
@ xt_force_dist_dir_striping_num_bits
@ 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:214
PPM_DSO_INTERNAL void xt_config_defaults_init(void)
Definition xt_config.c:443
PPM_DSO_INTERNAL Xt_exchanger_new xt_config_get_exchange_new_by_comm(Xt_config config, MPI_Comm comm)
Definition xt_config.c:157
struct Xt_config_ xt_default_config
Definition xt_config.c:203
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