78 if (config == NULL)
return;
87 if (
src == NULL)
return NULL;
91 memcpy(copy,
src,
sizeof(*copy));
94 if (
src->yaxt_exchanger_name != NULL) {
109 "ERROR(yac_interpolation_gen_config_set_reorder): config is NULL");
113 "ERROR(yac_interpolation_gen_config_set_reorder): invalid reorder value");
124 "ERROR(yac_interpolation_gen_config_set_reorder): config is NULL");
128 "ERROR(yac_interpolation_gen_config_set_reorder): invalid reorder value");
139 "ERROR(yac_interpolation_gen_config_set_collection_size): config is NULL");
142 "ERROR(yac_interpolation_gen_config_set_collection_size): "
143 "collection_size must be != SIZE_MAX");
146 "ERROR(yac_interpolation_gen_config_set_collection_size): "
147 "collection_size must be > 0");
160 "ERROR(yac_interpolation_gen_config_set_collection_selection): config is NULL");
163 "ERROR(yac_interpolation_gen_config_set_collection_selection): "
164 "collection_selection must be != NULL");
167 "ERROR(yac_interpolation_gen_config_set_collection_selection): "
168 "collection_size of collection_selection must be > 0");
181 "ERROR(yac_interpolation_gen_config_set_frac_mask_fallback_value): "
185 "ERROR(yac_interpolation_gen_config_set_frac_mask_fallback_value): "
186 "%lf is not a valid fractional masking fallback value",
197 "ERROR(yac_interpolation_gen_config_set_scaling_factor): config is NULL");
200 "ERROR(yac_interpolation_gen_config_set_scaling_factor): "
211 "ERROR(yac_interpolation_gen_config_set_scaling_summand): config is NULL");
214 "ERROR(yac_interpolation_gen_config_set_scaling_summand): "
225 "ERROR(yac_interpolation_gen_config_set_yaxt_exchanger_name): "
237 "ERROR(yac_interpolation_gen_config_set_yaxt_exchanger_name_f2c): "
251 "ERROR(yac_interpolation_gen_config_get_reorder): config is NULL");
262 "ERROR(yac_interpolation_gen_config_get_collection_selection): "
266 "ERROR(yac_interpolation_gen_config_get_collection_selection): "
267 "collection_selection is unset");
277 "ERROR(yac_interpolation_gen_config_get_frac_mask_fallback_value): "
288 "ERROR(yac_interpolation_gen_config_get_scaling_factor): config is NULL");
298 "ERROR(yac_interpolation_gen_config_get_scaling_summand): config is NULL");
308 "ERROR(yac_interpolation_gen_config_get_yaxt_exchanger_name): "
323 ret = (a == NULL) - (b == NULL);
374 cfg != NULL,
"ERROR(yac_interpolation_gen_config_pack): config is NULL");
376 int pack_size_int, pack_size_dble;
377 yac_mpi_call(MPI_Pack_size(1, MPI_INT, comm, &pack_size_int), comm);
378 yac_mpi_call(MPI_Pack_size(1, MPI_DOUBLE, comm, &pack_size_dble), comm);
380 return pack_size_int +
387 "yac_interpolation_gen_config_get_pack_size",
393 void *
buffer,
int buffer_size,
int * position, MPI_Comm comm) {
396 cfg != NULL,
"ERROR(yac_interpolation_gen_config_pack): config is NULL");
398 int reorder = (int)cfg->
reorder;
400 MPI_Pack(&reorder, 1, MPI_INT,
buffer, buffer_size, position, comm), comm);
405 position, comm), comm);
409 position, comm), comm);
413 position, comm), comm);
419 "yac_interpolation_gen_config_pack",
424 void const *
buffer,
int buffer_size,
int *position, MPI_Comm comm) {
430 MPI_Unpack(
buffer, buffer_size, position, &reorder_int, 1, MPI_INT, comm),
436 buffer, buffer_size, position,
440 buffer, buffer_size, position,
444 buffer, buffer_size, position,
#define YAC_ASSERT(exp, msg)
size_t yac_collection_selection_get_collection_size(struct yac_collection_selection const *collection_selection)
Get the size of the collection selection.
struct yac_collection_selection * yac_collection_selection_unpack(void const *buffer, int buffer_size, int *position, MPI_Comm comm)
Unpack a collection selection from a contiguous MPI buffer.
size_t yac_collection_selection_get_pack_size(struct yac_collection_selection const *sel, MPI_Comm comm)
Compute the MPI pack size of a collection selection.
void yac_collection_selection_delete(struct yac_collection_selection *collection_selection)
Delete a collection selection object.
int yac_collection_selection_compare(struct yac_collection_selection const *a, struct yac_collection_selection const *b)
Compare two collection selections.
struct yac_collection_selection * yac_collection_selection_copy(const struct yac_collection_selection *collection_selection)
Selection of indices from a collection.
void yac_collection_selection_pack(struct yac_collection_selection const *sel, void *buffer, int buffer_size, int *position, MPI_Comm comm)
Pack a collection selection into a contiguous MPI buffer.
struct yac_collection_selection * yac_collection_selection_new(size_t collection_size, size_t const *selection_indices)
Create a new collection selection.
yac_interp_weights_reorder_type
@ YAC_MAPPING_ON_TGT
weights will be applied at target processes
@ YAC_MAPPING_ON_SRC
weights will be applied at source processes
double const YAC_FRAC_MASK_NO_VALUE
void yac_interpolation_gen_config_set_reorder(struct yac_interpolation_gen_config *config, enum yac_interp_weights_reorder_type reorder)
Set the reordering strategy for interpolation weights.
void yac_interpolation_gen_config_set_collection_size(struct yac_interpolation_gen_config *config, size_t collection_size)
Set the number of contiguous fields (starting at "0") in the field collection.
void yac_interpolation_gen_config_set_yaxt_exchanger_name_f2c(struct yac_interpolation_gen_config *config, char const *name)
enum yac_interp_weights_reorder_type yac_interpolation_gen_config_get_reorder(struct yac_interpolation_gen_config const *config)
Get the configured reordering strategy.
int yac_interpolation_gen_config_compare(struct yac_interpolation_gen_config const *a, struct yac_interpolation_gen_config const *b)
Compare two interpolation configuration structures.
void yac_interpolation_gen_config_set_reorder_f2c(struct yac_interpolation_gen_config *config, int reorder)
double yac_interpolation_gen_config_get_frac_mask_fallback_value(struct yac_interpolation_gen_config const *config)
Get the configured fractional mask fallback value.
void yac_interpolation_gen_config_set_collection_selection(struct yac_interpolation_gen_config *config, struct yac_collection_selection const *collection_selection)
Set the collection selection of source field in the source field collection.
void yac_interpolation_gen_config_set_scaling_factor(struct yac_interpolation_gen_config *config, double scaling_factor)
Set the multiplicative scaling factor.
double yac_interpolation_gen_config_get_scaling_factor(struct yac_interpolation_gen_config const *config)
Get the configured scaling factor.
struct yac_collection_selection const * yac_interpolation_gen_config_get_collection_selection(struct yac_interpolation_gen_config const *config)
Get the configured collection selection.
size_t yac_interpolation_gen_config_get_pack_size(struct yac_interpolation_gen_config const *cfg, MPI_Comm comm)
Get the MPI packing size of an interpolation generation configuration.
void yac_interpolation_gen_config_set_yaxt_exchanger_name(struct yac_interpolation_gen_config *config, char const *name)
Set the name of the Yaxt exchanger.
const char * yac_interpolation_gen_config_get_yaxt_exchanger_name(struct yac_interpolation_gen_config const *config)
Get the configured Yaxt exchanger name.
void yac_interpolation_gen_config_delete(struct yac_interpolation_gen_config *config)
Release a interpolation generation configuration structure allocated by yac_interpolation_gen_config_...
void yac_interpolation_gen_config_set_frac_mask_fallback_value(struct yac_interpolation_gen_config *config, double frac_mask_fallback_value)
Set the fractional mask fallback value.
struct yac_interpolation_gen_config * yac_interpolation_gen_config_copy(struct yac_interpolation_gen_config const *src)
Create a copy of an interpolation generation configuration.
struct yac_interpolation_gen_config * yac_interpolation_gen_config_new(void)
Allocate and initialise an interpolation generation configuration structure.
void yac_interpolation_gen_config_pack(struct yac_interpolation_gen_config const *cfg, void *buffer, int buffer_size, int *position, MPI_Comm comm)
Pack an interpolation generation configuration into an MPI buffer.
void yac_interpolation_gen_config_set_scaling_summand(struct yac_interpolation_gen_config *config, double scaling_summand)
Set the additive scaling summand.
double yac_interpolation_gen_config_get_scaling_summand(struct yac_interpolation_gen_config const *config)
Get the configured scaling summand.
struct yac_interpolation_gen_config * yac_interpolation_gen_config_unpack(void const *buffer, int buffer_size, int *position, MPI_Comm comm)
Unpack an interpolation generation configuration from an MPI buffer.
Defines internal basic interpolation definitions.
#define YAC_FRAC_MASK_VALUE_IS_VALID(value)
Test whether a fractional mask value is valid.
add versions of standard API functions not returning on error
Configuration structure for interpolation generation.
struct yac_collection_selection * collection_selection
char * yaxt_exchanger_name
double frac_mask_fallback_value
enum yac_interp_weights_reorder_type reorder
#define YAC_ASSERT_F(exp, format,...)
size_t yac_string_get_pack_size(char const *caller, char const *string, MPI_Comm comm, int allow_null)
Compute number of bytes required to pack a string for MPI transport.
char * yac_string_unpack(void const *buffer, int buffer_size, int *position, MPI_Comm comm)
Unpack a C string from a buffer packed with yac_string_pack.
void yac_string_pack(char const *caller, char const *string, void *buffer, int buffer_size, int *position, MPI_Comm comm, int allow_null)
Pack a C string into a provided buffer using MPI_Pack semantics.
#define yac_mpi_call(call, comm)