101 {
"irecv_isend_packed",
103 {
"irecv_isend_ddt_packed",
104#ifdef XT_ENABLE_DDT_EXCHANGER
113#ifdef XT_CAN_USE_MPI_NEIGHBOR_ALLTOALL
148 if (eentry != SIZE_MAX)
150 static const char fmt[]
151 =
"error: unexpected exchanger function (%p)!";
152 char buf[
sizeof (fmt) + 3*
sizeof(
void *)];
153 sprintf(buf, fmt, (
void *)exchanger_new);
154 Xt_abort(Xt_default_comm, buf,
filename, __LINE__);
161#ifdef XT_CAN_USE_MPI_NEIGHBOR_ALLTOALL
164 xt_mpi_call(MPI_Comm_test_inter(comm, &flag), comm);
171 return exchanger_new;
178 { .name =
"quicksort",
188 { .name =
"mergesort",
206 .exchanger_team_share = NULL,
236 if (eentry != SIZE_MAX)
238 static const char fmt[]
239 =
"error: unexpected exchanger function (%p)!";
240 char buf[
sizeof (fmt) + 3*
sizeof(
void *)];
241 sprintf(buf, fmt, (
const void *)sort_funcs);
242 Xt_abort(Xt_default_comm, buf,
filename, __LINE__);
251 static const char fmt[]
252 =
"error: user-requested exchanger code (%d) does not exist!";
253 char buf[
sizeof (fmt) + 3*
sizeof(
int)];
254 sprintf(buf, fmt, algo);
255 Xt_abort(Xt_default_comm, buf,
filename, __LINE__);
290 *gen = *bucket_gen_iface;
299 static const char fmt[]
300 =
"error: user-requested exchanger code (%d) does not exist!";
301 char buf[
sizeof (fmt) + 3*
sizeof(
int)];
302 const char *msg = buf;
311 if (default_entry == SIZE_MAX) {
312 msg =
"error: invalid default exchanger constructor!";
315 fprintf(stderr,
"warning: %s exchanger unavailable, using "
322 sprintf(buf, fmt, method);
324 Xt_abort(Xt_default_comm, msg,
filename, __LINE__);
352 Xt_abort(Xt_default_comm,
353 "error: automatic opening of OpenMP parallel regions requested,"
354 " but OpenMP is not configured.\n",
filename, __LINE__);
357 int thread_support_provided = MPI_THREAD_SINGLE;
358 xt_mpi_call(MPI_Query_thread(&thread_support_provided), Xt_default_comm);
359 if (thread_support_provided != MPI_THREAD_MULTIPLE)
360 Xt_abort(Xt_default_comm,
361 "error: automatic opening of OpenMP parallel regions requested,"
362 "\n but MPI is not running in thread-safe mode.\n",
391 if (use_stripe_align < 0 || use_stripe_align > 2)
392 Xt_abort(Xt_default_comm,
393 "error: invalid value passed to "
394 "xt_config_set_xmap_stripe_align.\n",
filename, __LINE__);
527 const char *config_env = getenv(
"XT_CONFIG_DEFAULT_EXCHANGE_METHOD");
530 if (exchanger_id != -1)
533 fprintf(stderr,
"warning: Unexpected value "
534 "for XT_CONFIG_DEFAULT_EXCHANGE_METHOD=%s\n", config_env);
536 config_env = getenv(
"XT_CONFIG_DEFAULT_IDXVEC_AUTOCONVERT_SIZE");
541 if (!strcmp(config_env,
"INT_MAX")) {
543 endptr = config_env + 7;
546 v = strtol(config_env, &endptr_, 0);
549 if ((errno == ERANGE && (v == LONG_MAX || v == LONG_MIN))
550 || (errno != 0 && v == 0)) {
551 perror(
"failed to parse value of "
552 "XT_CONFIG_DEFAULT_IDXVEC_AUTOCONVERT_SIZE environment variable");
553 }
else if (endptr == config_env) {
554 fputs(
"malformed value of XT_CONFIG_DEFAULT_IDXVEC_AUTOCONVERT_SIZE"
555 " environment variable, no digits were found\n",
557 }
else if (v < 1 || v > INT_MAX) {
558 fprintf(stderr,
"value of XT_CONFIG_DEFAULT_IDXVEC_AUTOCONVERT_SIZE"
559 " environment variable (%ld) out of range [1,%d]\n",
564 config_env = getenv(
"XT_CONFIG_DEFAULT_MULTI_THREAD_MODE");
567 long v = strtol(config_env, &endptr, 0);
568 if (endptr != config_env) {
569 if ((errno == ERANGE && (v == LONG_MAX || v == LONG_MIN))
570 || (errno != 0 && v == 0)) {
571 perror(
"failed to parse value of "
572 "XT_CONFIG_DEFAULT_MULTI_THREAD_MODE environment variable");
573 goto dont_set_mt_mode;
575 fprintf(stderr,
"numeric value of XT_CONFIG_DEFAULT_MULTI_THREAD_MODE"
576 " environment variable (%ld) out of range [0,%d]\n",
578 goto dont_set_mt_mode;
579 }
else if (*endptr) {
580 fprintf(stderr,
"trailing text '%s' found after numeric value (%*s) in "
581 "XT_CONFIG_DEFAULT_MULTI_THREAD_MODE environment variable\n",
582 endptr, (
int)(endptr-config_env), config_env);
583 goto dont_set_mt_mode;
586 if (!strcasecmp(config_env,
"XT_MT_OPENMP")) {
588 fputs(
"multi-threaded operation requested via "
589 "XT_CONFIG_DEFAULT_MULTI_THREAD_MODE, but OpenMP support is not"
590 " compiled in!\n", stderr);
591 goto dont_set_mt_mode;
595 }
else if (!strcasecmp(config_env,
"XT_MT_NONE")) {
598 fputs(
"unexpected value of XT_CONFIG_DEFAULT_MULTI_THREAD_MODE"
599 " environment variable, unrecognized text or numeral\n",
601 goto dont_set_mt_mode;
608 config_env = getenv(
"XT_CONFIG_DEFAULT_SORT_ALGORITHM");
611 long v = strtol(config_env, &endptr, 0);
612 if (endptr != config_env) {
613 if ((errno == ERANGE && (v == LONG_MAX || v == LONG_MIN))
614 || (errno != 0 && v == 0)) {
615 perror(
"failed to parse value of "
616 "XT_CONFIG_DEFAULT_SORT_ALGORITHM environment variable");
617 goto dont_set_sort_algorithm;
619 fprintf(stderr,
"numeric value of XT_CONFIG_DEFAULT_SORT_ALGORITHM"
620 " environment variable (%ld) out of range [0,%d]\n",
622 goto dont_set_sort_algorithm;
623 }
else if (*endptr) {
624 fprintf(stderr,
"trailing text '%s' found after numeric value (%*s) in "
625 "XT_CONFIG_DEFAULT_SORT_ALGORITHM environment variable\n",
626 endptr, (
int)(endptr-config_env), config_env);
627 goto dont_set_sort_algorithm;
630 if (!strcasecmp(config_env,
"QUICKSORT")) {
632 }
else if (!strcasecmp(config_env,
"MERGESORT")) {
635 fputs(
"unexpected value of XT_CONFIG_DEFAULT_SORT_ALGORITHM"
636 " environment variable, unrecognized text or numeral\n",
638 goto dont_set_sort_algorithm;
643dont_set_sort_algorithm:;
645 const char *evn =
"XT_CONFIG_DEFAULT_XMAP_STRIPE_ALIGN";
646 config_env = getenv(evn);
648 config_env = getenv((evn =
"XT_CONFIG_DEFAULT_DIST_DIR_STRIPE_ALIGNMENT"));
653 if (!strcmp(config_env,
"auto")) {
655 endptr = config_env + 4;
656 }
else if (!strcmp(config_env,
"one_by_one")) {
658 endptr = config_env + 10;
659 }
else if (!strcmp(config_env,
"always")) {
661 endptr = config_env + 6;
664 v = strtol(config_env, &endptr_, 0);
667 if ((errno == ERANGE && (v == LONG_MAX || v == LONG_MIN))
668 || (errno != 0 && v == 0)) {
669 fprintf(stderr,
"warning: failed to parse value of "
670 "environment variable %s: %s", evn, strerror(errno));
671 }
else if (endptr == config_env) {
672 fprintf(stderr,
"warning: malformed value of environment variable "
673 "%s, no digits or symbolic constant found\n", evn);
674 }
else if (v < 0 || v > 2) {
675 fprintf(stderr,
"value of environment variable %s (%ld) out of range [0,2]\n", evn, v);
682 static const char evn[] =
"XT_CONFIG_DEFAULT_MEM_SAVING";
683 config_env = getenv(evn);
687 if (!strcasecmp(config_env,
"FORCE_NOSORT")) {
689 endptr = config_env + 12;
692 v = strtol(config_env, &endptr_, 0);
695 if ((errno == ERANGE && (v == LONG_MAX || v == LONG_MIN))
696 || (errno != 0 && v == 0)) {
697 perror(
"failed to parse value of "
698 "XT_CONFIG_DEFAULT_MEM_SAVING environment variable");
699 }
else if (endptr == config_env) {
700 fprintf(stderr,
"warning: malformed value of environment variable "
701 "%s, no digits or symbolic constant found\n", evn);
703 fprintf(stderr,
"numeric value of XT_CONFIG_DEFAULT_MEM_SAVING"
704 " environment variable (%ld) out of range [0,%d]\n",
706 }
else if (*endptr) {
707 fprintf(stderr,
"trailing text '%s' found after value (%*s) in "
708 "%s environment variable\n",
709 endptr, (
int)(endptr-config_env), evn, config_env);
void xt_mergesort_index(Xt_int *restrict v_idx, int n, int *restrict v_pos, int reset_pos)
void xt_mergesort_xt_int_permutation(Xt_int *a, size_t n, int *restrict permutation)
void xt_mergesort_idxpos(idxpos_type *v, size_t n)
void xt_mergesort_int_permutation(int *a, size_t n, int *permutation)
void xt_mergesort_int(int a[], size_t n)
void xt_mergesort_xt_int(Xt_int a[], size_t n)
add versions of standard API functions not returning on error
void xt_quicksort_index(Xt_int *restrict v_idx, int n, int *restrict v_pos, int reset_pos)
void xt_quicksort_xt_int_permutation(Xt_int *a, size_t n, int *restrict permutation)
void xt_quicksort_int(int a[], size_t n)
void xt_quicksort_xt_int(Xt_int a[], size_t n)
void xt_quicksort_int_permutation(int *restrict a, size_t n, int *restrict permutation)
void xt_quicksort_idxpos(idxpos_type v[], size_t n)
const struct Xt_sort_algo_funcptr * sort_funcs
Xt_exchanger_new exchanger_new
const struct Xt_xmdd_bucket_gen_ * xmdd_bucket_gen
void xt_config_set_xmap_stripe_align(Xt_config config, int use_stripe_align)
void xt_config_set_idxvec_autoconvert_size(Xt_config config, int cnvsize)
void xt_config_set_redist_mthread_mode(Xt_config config, int mode)
void xt_config_defaults_init(void)
static const char filename[]
int xt_exchanger_id_by_name(const char *name)
int xt_sort_algo_id_by_name(const char *name)
void xt_config_delete(Xt_config config)
void xt_config_set_exchange_method(Xt_config config, int method)
void xt_config_set_sort_algorithm_by_id(Xt_config config, int algo)
int xt_config_get_mem_saving(Xt_config config)
static const struct @117030141027020005042111231012044123003044056005 sort_algo_table[]
void xt_config_set_mem_saving(Xt_config config, int memconserve)
int xt_config_get_dist_dir_stripe_alignment(Xt_config config)
void xt_config_set_dist_dir_stripe_alignment(Xt_config config, int use_stripe_alignment)
int xt_config_get_sort_algorithm_id(Xt_config config)
Xt_xmdd_bucket_gen xt_config_get_xmdd_bucket_gen(Xt_config config)
int xt_config_get_redist_mthread_mode(Xt_config config)
Xt_config xt_config_new(void)
void xt_config_set_xmdd_bucket_gen(Xt_config config, Xt_xmdd_bucket_gen bucket_gen_iface)
Xt_exchanger_new xt_config_get_exchange_new_by_comm(Xt_config config, MPI_Comm comm)
int xt_config_get_xmap_stripe_align(Xt_config config)
int xt_config_get_idxvec_autoconvert_size(Xt_config config)
int xt_config_get_exchange_method(Xt_config config)
struct Xt_config_ xt_default_config
struct Xt_sort_algo_funcptr func
static size_t sort_algo_by_table(const struct Xt_sort_algo_funcptr *sort_funcs)
static size_t exchanger_by_function(Xt_exchanger_new exchanger_new)
static const struct @166373060313372022170003223057022306144070252033 exchanger_table[]
opaque configuration object for settings where the default needs to be overridden
struct Xt_config_ * Xt_config
@ xt_exchanger_irecv_isend
@ xt_exchanger_irecv_send
@ xt_exchanger_irecv_isend_packed
@ xt_exchanger_irecv_isend_ddt_packed
@ xt_exchanger_neigh_alltoall
@ xt_exchanger_mix_isend_irecv
implementation of configuration object
#define XT_CONFIG_SET_FORCE_NOSORT_BIT(config, val)
#define XT_CONFIG_GET_FORCE_NOSORT(config)
@ xt_force_xmap_striping_bit_ofs
@ xt_mthread_mode_bit_ofs
#define XT_CONFIG_GET_XMAP_STRIPING(config)
#define XT_CONFIG_SET_XMAP_STRIPING(config, v)
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)
Xt_exchanger xt_exchanger_irecv_isend_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)
Xt_exchanger xt_exchanger_irecv_isend_ddt_packed_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)
Xt_exchanger xt_exchanger_irecv_isend_packed_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)
Xt_exchanger xt_exchanger_irecv_send_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)
Xt_exchanger xt_exchanger_mix_isend_irecv_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)
Xt_exchanger xt_exchanger_neigh_alltoall_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)
Provide non-public declarations common to all index lists.
#define xt_mpi_call(call, comm)
struct Xt_xmdd_bucket_gen_ * Xt_xmdd_bucket_gen
const struct Xt_xmdd_bucket_gen_ Xt_xmdd_cycl_stripe_bucket_gen_desc
Default bucket generator for creation of distributed directories.
Default bucket generator for creation of distributed directories.