24static void utest_init_data();
25static void utest_check_fixed();
37 xt_initialize(MPI_COMM_WORLD);
39 int comm_rank, comm_size;
40 MPI_Comm_rank(MPI_COMM_WORLD, &comm_rank);
41 MPI_Comm_size(MPI_COMM_WORLD, &comm_size);
44 PUT_ERR(
"ERROR: test requires 2 processes");
57 src_fields_collection[i] = src_fields[i];
68 } collection_selection_configs[] =
69 {{.N = 3, .indices = (
size_t[]){0, 2, 3}},
70 {.N = 4, .indices = (
size_t[]){0, 1, 2, 3}},
71 {.N = 2, .indices = NULL}};
73 NUM_COLL_SEL_CONFIGS =
74 sizeof(collection_selection_configs) /
75 sizeof(collection_selection_configs[0])};
78 for (
size_t i = 0; i < NUM_COLL_SEL_CONFIGS; ++i) {
83 collection_selection_configs[i].
N,
84 collection_selection_configs[i].indices);
90 } fixed_value_configs[] =
91 {{.fixed_value = 1.0, .num_tgts = 0, .tgts = NULL},
92 {.fixed_value = 2.0, .num_tgts = 4, .tgts = (
size_t[]){0,2,4,6}},
93 {.fixed_value = 3.0, .num_tgts = 8,
94 .tgts = (
size_t[]){0,1,2,3,4,5,6,7}}};
96 NUM_FIXED_VALUE_CONFIGS =
97 sizeof(fixed_value_configs) /
98 sizeof(fixed_value_configs[0])};
101 for (
size_t j = 0; j < NUM_FIXED_VALUE_CONFIGS; ++j) {
109 sel, fixed_value_configs[j].fixed_value,
110 fixed_value_configs[j].num_tgts, fixed_value_configs[j].tgts);
112 for (
int use_interp_fixed_copy = 0; use_interp_fixed_copy <= 1;
113 ++use_interp_fixed_copy) {
115 if (use_interp_fixed_copy) {
119 interp_fixed = interp_fixed_copy;
128 if (comm_rank == 1) {
129 for (
size_t k = 0; k < collection_selection_configs[i].N; ++k) {
130 double fixed_value = fixed_value_configs[j].fixed_value;
131 for (
size_t l = 0; l < fixed_value_configs[j].num_tgts; ++l) {
139 double frac_mask_fallback_value;
140 } frac_mask_configs[] =
142 {.frac_mask_fallback_value = 10.0}};
144 NUM_FRAC_MASK_CONFIGS =
145 sizeof(frac_mask_configs) /
sizeof(frac_mask_configs[0])};
147 for (
size_t frac_mask_config_idx = 0;
148 frac_mask_config_idx < NUM_FRAC_MASK_CONFIGS;
149 ++frac_mask_config_idx) {
151 double frac_mask_fallback_value =
152 frac_mask_configs[frac_mask_config_idx].frac_mask_fallback_value;
160 interp_fixed, src_fields_collection, NULL, tgt_field_collection,
161 frac_mask_fallback_value, 1.0, 0.0);
173 interp_fixed, src_fields_collection, NULL,
174 1, frac_mask_fallback_value, 1.0, 0.0);
176 interp_fixed, tgt_field_collection,
177 frac_mask_fallback_value, 1.0, 0.0);
182 PUT_ERR(
"error in execute_put_test");
184 PUT_ERR(
"error in execute_get_test");
196 interp_fixed, src_fields_collection, NULL,
197 1, frac_mask_fallback_value, 1.0, 0.0);
199 interp_fixed, tgt_field_collection,
200 frac_mask_fallback_value, 1.0, 0.0);
206 PUT_ERR(
"error in execute_put_test");
208 PUT_ERR(
"error in execute_get_test");
233static void utest_init_data() {
248static void utest_check_fixed() {
void yac_collection_selection_delete(struct yac_collection_selection *collection_selection)
Delete a collection selection object.
struct yac_collection_selection * yac_collection_selection_new(size_t collection_size, size_t const *selection_indices)
Create a new collection selection.
struct yac_interp_operator * yac_interp_operator_fixed_new(struct yac_collection_selection const *collection_selection, double value, size_t count, size_t const *pos)
Create a fixed-value interpolation operator.
void yac_interp_operator_execute_wait(struct yac_interp_operator *interp)
Wait for all pending put/get operations to finish.
struct yac_interp_operator * yac_interp_operator_copy(struct yac_interp_operator *interp)
Create a deep copy of the interpolation operator.
enum YAC_INTERP_TEST_STATUS yac_interp_operator_execute_put_test(struct yac_interp_operator *interp)
Test whether the put phase has completed.
enum YAC_INTERP_TEST_STATUS yac_interp_operator_execute_get_test(struct yac_interp_operator *interp)
Test whether the get phase has completed.
void yac_interp_operator_execute_get(struct yac_interp_operator *interp, double **tgt_field, double frac_mask_fallback_value, double scale_factor, double scale_summand)
void yac_interp_operator_execute_put(struct yac_interp_operator *interp, double ***src_fields, double ***src_frac_masks, int is_target, double frac_mask_fallback_value, double scale_factor, double scale_summand)
void yac_interp_operator_execute_get_async(struct yac_interp_operator *interp, double **tgt_field, double frac_mask_fallback_value, double scale_factor, double scale_summand)
void yac_interp_operator_execute(struct yac_interp_operator *interp, double ***src_fields, double ***src_frac_masks, double **tgt_field, double frac_mask_fallback_value, double scale_factor, double scale_summand)
void yac_interp_operator_delete(struct yac_interp_operator *interp)
Delete the interpolation operator and free resources.
Fixed-value interpolation operator in YAC.
double const YAC_FRAC_MASK_NO_VALUE
Public interface for interpolation execution in YAC.
Abstract interpolation operator type.
static double tgt_field_data[MAX_COLLECTION_SIZE][NUM_TGT_POINTS]
static double src_fields_data[MAX_COLLECTION_SIZE][NUM_SRC_FIELDS][NUM_SRC_POINTS]
static double ref_tgt_field_data[MAX_COLLECTION_SIZE][NUM_TGT_POINTS]