|
YAC 3.18.0
Yet Another Coupler
|
Public interface for interpolation execution in YAC. More...
#include <math.h>

Go to the source code of this file.
Typedefs | |
| typedef struct Xt_redist_ * | Xt_redist |
Functions | |
| struct yac_interpolation * | yac_interpolation_new (struct yac_collection_selection const *collection_selection, double frac_mask_fallback_value, double scale_factor, double scale_summand) |
| Create a new interpolation object. | |
| void | yac_interpolation_inc_ref_count (struct yac_interpolation *interpolation) |
| Increase the reference count of an interpolation. | |
| int | yac_interpolation_with_frac_mask (struct yac_interpolation *interpolation) |
| Query whether interpolation uses fractional masks. | |
| void | yac_interpolation_add_fixed (struct yac_interpolation *interp, double value, size_t count, size_t *pos) |
| Add a fixed-value operator to an interpolation. | |
| void | yac_interpolation_add_direct (struct yac_interpolation *interp, Xt_redist redist) |
| Add a direct redistribution operator. | |
| void | yac_interpolation_add_direct_mf (struct yac_interpolation *interp, Xt_redist *redists, size_t num_src_fields) |
| Add a direct redistribution operator for multiple source fields. | |
| void | yac_interpolation_add_sum_at_src (struct yac_interpolation *interp, Xt_redist *halo_redists, size_t tgt_count, size_t *num_src_per_tgt, size_t *src_field_idx, size_t *src_idx, size_t num_src_fields, Xt_redist result_redist) |
| Add a sum operator where accumulation occurs on source processes. | |
| void | yac_interpolation_add_sum_at_tgt (struct yac_interpolation *interp, Xt_redist *src_redists, size_t *tgt_pos, size_t tgt_count, size_t *num_src_per_tgt, size_t *src_field_idx, size_t *src_idx, size_t num_src_fields) |
| Add a sum operator where accumulation occurs on target processes. | |
| void | yac_interpolation_add_weight_sum_mvp_at_src (struct yac_interpolation *interp, Xt_redist *halo_redists, size_t tgt_count, size_t *num_src_per_tgt, double *weights, size_t *src_field_idx, size_t *src_idx, size_t num_src_fields, Xt_redist result_redist) |
| Add a weighted sum operator (distributed matrix-vector product), which computes the productes at the source processes. | |
| void | yac_interpolation_add_weight_sum_mvp_at_tgt (struct yac_interpolation *interp, Xt_redist *src_redists, size_t *tgt_pos, size_t tgt_count, size_t *num_src_per_tgt, double *weights, size_t *src_field_idx, size_t *src_idx, size_t num_src_fields) |
| Add a weighted sum operator (distributed matrix-vector product), which computes the product at the target processes. | |
| struct yac_interpolation * | yac_interpolation_copy (struct yac_interpolation *interp) |
| Create a deep copy of an interpolation object. | |
| void | yac_interpolation_execute (struct yac_interpolation *interp, double ***src_fields, double **tgt_field) |
| Execute interpolation synchronously and write results to the target field. | |
| void | yac_interpolation_execute_frac (struct yac_interpolation *interp, double ***src_fields, double ***src_frac_masks, double **tgt_field) |
| Execute interpolation with fractional masks and write results to the target field. | |
| void | yac_interpolation_execute_put (struct yac_interpolation *interp, double ***src_fields) |
| Provide source field data and start asynchronous execution of interpolation (put phase). | |
| void | yac_interpolation_execute_put_frac (struct yac_interpolation *interp, double ***src_fields, double ***src_frac_masks) |
| Provide source field data with fractional masks and start asynchronous execution of interpolation (put phase). | |
| void | yac_interpolation_execute_get (struct yac_interpolation *interp, double **tgt_field) |
| Complete interpolation and write results to the target field (get phase). | |
| void | yac_interpolation_execute_get_async (struct yac_interpolation *interp, double **tgt_field) |
| Complete interpolation asynchronously and write results to the target field (get phase). | |
| int | yac_interpolation_execute_put_test (struct yac_interpolation *interp) |
| Test whether the asynchronous put phase has completed. | |
| int | yac_interpolation_execute_get_test (struct yac_interpolation *interp) |
| Test whether the asynchronous get phase has completed. | |
| void | yac_interpolation_execute_wait (struct yac_interpolation *interp) |
| Wait for completion of pending asynchronous interpolation operations. | |
| void | yac_interpolation_delete (struct yac_interpolation *interp) |
| Free an interpolation object and release all resources. | |
Variables | |
| double const | YAC_FRAC_MASK_NO_VALUE |
Public interface for interpolation execution in YAC.
This header provides the API for building, composing, and executing distributed interpolation operators. Interpolation objects encapsulate both numerical operators (fixed values, direct redistribution, sums, weighted sums) and the communication patterns required to apply them in parallel across MPI processes.
An interpolation object may consist of multiple operators that are applied in sequence. At runtime, users can put source fields into the interpolation, optionally provide fractional masks, and obtain the interpolated results on the target fields.
The API supports both synchronous and asynchronous execution, as well as source- and target-side accumulation strategies.
Definition in file interpolation.h.
| typedef struct Xt_redist_* Xt_redist |
Definition at line 29 of file interpolation.h.
| void yac_interpolation_add_direct | ( | struct yac_interpolation * | interp, |
| Xt_redist | redist ) |
Add a direct redistribution operator.
| [in,out] | interp | Interpolation object. |
| [in] | redist | Redistribution handle from yaxt. |
Definition at line 127 of file interpolation.c.


| void yac_interpolation_add_direct_mf | ( | struct yac_interpolation * | interp, |
| Xt_redist * | redists, | ||
| size_t | num_src_fields ) |
Add a direct redistribution operator for multiple source fields.
| [in,out] | interp | Interpolation object. |
| [in] | redists | Array of redistribution handles (length = num_src_fields). |
| [in] | num_src_fields | Number of source fields to redistribute. |
Definition at line 134 of file interpolation.c.


| void yac_interpolation_add_fixed | ( | struct yac_interpolation * | interp, |
| double | value, | ||
| size_t | count, | ||
| size_t * | pos ) |
Add a fixed-value operator to an interpolation.
| [in,out] | interp | Interpolation object. |
| [in] | value | Fixed value to assign. |
| [in] | count | Number of target positions to assign. |
| [in] | pos | Array of target indices of length count. |
Definition at line 117 of file interpolation.c.


| void yac_interpolation_add_sum_at_src | ( | struct yac_interpolation * | interp, |
| Xt_redist * | halo_redists, | ||
| size_t | tgt_count, | ||
| size_t * | num_src_per_tgt, | ||
| size_t * | src_field_idx, | ||
| size_t * | src_idx, | ||
| size_t | num_src_fields, | ||
| Xt_redist | result_redist ) |
Add a sum operator where accumulation occurs on source processes.
| [in,out] | interp | Interpolation object. |
| [in] | halo_redists | Redistribution handles for halo exchanges. |
| [in] | tgt_count | Number of target points. |
| [in] | num_src_per_tgt | Array giving number of source points per target. |
| [in] | src_field_idx | Array of source field indices. |
| [in] | src_idx | Array of source local indices. |
| [in] | num_src_fields | Number of source fields. |
| [in] | result_redist | Redistribution handle for final results. |
Definition at line 144 of file interpolation.c.


| void yac_interpolation_add_sum_at_tgt | ( | struct yac_interpolation * | interp, |
| Xt_redist * | src_redists, | ||
| size_t * | tgt_pos, | ||
| size_t | tgt_count, | ||
| size_t * | num_src_per_tgt, | ||
| size_t * | src_field_idx, | ||
| size_t * | src_idx, | ||
| size_t | num_src_fields ) |
Add a sum operator where accumulation occurs on target processes.
| [in,out] | interp | Interpolation object. |
| [in] | src_redists | Redistribution handles for source fields. |
| [in] | tgt_pos | Target positions. |
| [in] | tgt_count | Number of target points. |
| [in] | num_src_per_tgt | Array giving number of source points per target. |
| [in] | src_field_idx | Array of source field indices. |
| [in] | src_idx | Array of source local indices. |
| [in] | num_src_fields | Number of source fields. |
Definition at line 158 of file interpolation.c.


| void yac_interpolation_add_weight_sum_mvp_at_src | ( | struct yac_interpolation * | interp, |
| Xt_redist * | halo_redists, | ||
| size_t | tgt_count, | ||
| size_t * | num_src_per_tgt, | ||
| double * | weights, | ||
| size_t * | src_field_idx, | ||
| size_t * | src_idx, | ||
| size_t | num_src_fields, | ||
| Xt_redist | result_redist ) |
Add a weighted sum operator (distributed matrix-vector product), which computes the productes at the source processes.
| [in,out] | interp | Interpolation object. |
| [in] | halo_redists | Redistribution handles for halo exchanges. |
| [in] | tgt_count | Number of target points. |
| [in] | num_src_per_tgt | Array giving number of source points per target. |
| [in] | weights | Array of interpolation weights. |
| [in] | src_field_idx | Array of source field indices. |
| [in] | src_idx | Array of source local indices. |
| [in] | num_src_fields | Number of source fields. |
| [in] | result_redist | Redistribution handle for final results. |
Definition at line 172 of file interpolation.c.


| void yac_interpolation_add_weight_sum_mvp_at_tgt | ( | struct yac_interpolation * | interp, |
| Xt_redist * | src_redists, | ||
| size_t * | tgt_pos, | ||
| size_t | tgt_count, | ||
| size_t * | num_src_per_tgt, | ||
| double * | weights, | ||
| size_t * | src_field_idx, | ||
| size_t * | src_idx, | ||
| size_t | num_src_fields ) |
Add a weighted sum operator (distributed matrix-vector product), which computes the product at the target processes.
| [in,out] | interp | Interpolation object. |
| [in] | src_redists | Redistribution handles for source fields. |
| [in] | tgt_pos | Target positions. |
| [in] | tgt_count | Number of target points. |
| [in] | num_src_per_tgt | Array giving number of source points per target. |
| [in] | weights | Array of interpolation weights. |
| [in] | src_field_idx | Array of source field indices. |
| [in] | src_idx | Array of source local indices. |
| [in] | num_src_fields | Number of source fields. |
Definition at line 186 of file interpolation.c.


| struct yac_interpolation * yac_interpolation_copy | ( | struct yac_interpolation * | interp | ) |
Create a deep copy of an interpolation object.
| [in] | interp | Interpolation object to copy. |
Definition at line 200 of file interpolation.c.


| void yac_interpolation_delete | ( | struct yac_interpolation * | interp | ) |
Free an interpolation object and release all resources.
| [in] | interp | Interpolation object to delete (NULL is safe). |
Definition at line 373 of file interpolation.c.


| void yac_interpolation_execute | ( | struct yac_interpolation * | interp, |
| double *** | src_fields, | ||
| double ** | tgt_field ) |
Execute interpolation synchronously and write results to the target field.
| [in] | interp | Interpolation object. |
| [in] | src_fields | Source field data dimensions: [collection_idx][field_idx][local_idx] |
| [out] | tgt_field | Target field data dimensions: [collection_idx][local_idx] |
Definition at line 253 of file interpolation.c.


| void yac_interpolation_execute_frac | ( | struct yac_interpolation * | interp, |
| double *** | src_fields, | ||
| double *** | src_frac_masks, | ||
| double ** | tgt_field ) |
Execute interpolation with fractional masks and write results to the target field.
| [in] | interp | Interpolation object. |
| [in] | src_fields | Source field data, pre-multiplied by the corresponding fractional mask values dimensions: [collection_idx][field_idx][local_idx] |
| [in] | src_frac_masks | Fractional mask values dimensions: [collection_idx][field_idx][local_idx] |
| [out] | tgt_field | Target field data dimensions: [collection_idx][local_idx] |
Definition at line 230 of file interpolation.c.


| void yac_interpolation_execute_get | ( | struct yac_interpolation * | interp, |
| double ** | tgt_field ) |
Complete interpolation and write results to the target field (get phase).
| [in] | interp | Interpolation object. |
| [out] | tgt_field | Target field data dimensions: [collection_idx][local_idx] |
Definition at line 309 of file interpolation.c.


| void yac_interpolation_execute_get_async | ( | struct yac_interpolation * | interp, |
| double ** | tgt_field ) |
Complete interpolation asynchronously and write results to the target field (get phase).
| [in] | interp | Interpolation object. |
| [out] | tgt_field | Target field data dimensions: [collection_idx][local_idx] |
Definition at line 320 of file interpolation.c.


| int yac_interpolation_execute_get_test | ( | struct yac_interpolation * | interp | ) |
Test whether the asynchronous get phase has completed.
| [in] | interp | Interpolation object. |
Definition at line 343 of file interpolation.c.


| void yac_interpolation_execute_put | ( | struct yac_interpolation * | interp, |
| double *** | src_fields ) |
Provide source field data and start asynchronous execution of interpolation (put phase).
| [in] | interp | Interpolation object. |
| [in] | src_fields | Source field data dimensions: [collection_idx][field_idx][local_idx] |
Definition at line 295 of file interpolation.c.


| void yac_interpolation_execute_put_frac | ( | struct yac_interpolation * | interp, |
| double *** | src_fields, | ||
| double *** | src_frac_masks ) |
Provide source field data with fractional masks and start asynchronous execution of interpolation (put phase).
| [in] | interp | Interpolation object. |
| [in] | src_fields | Source field data, pre-multiplied by the corresponding fractional mask values dimensions: [collection_idx][field_idx][local_idx] |
| [in] | src_frac_masks | Fractional mask values dimensions: [collection_idx][field_idx][local_idx] |
Definition at line 272 of file interpolation.c.


| int yac_interpolation_execute_put_test | ( | struct yac_interpolation * | interp | ) |
Test whether the asynchronous put phase has completed.
| [in] | interp | Interpolation object. |
Definition at line 331 of file interpolation.c.


| void yac_interpolation_execute_wait | ( | struct yac_interpolation * | interp | ) |
Wait for completion of pending asynchronous interpolation operations.
This routine blocks until all outstanding put/get operations associated with interp have finished.
| [in] | interp | Interpolation object. |
Definition at line 355 of file interpolation.c.


| void yac_interpolation_inc_ref_count | ( | struct yac_interpolation * | interpolation | ) |
Increase the reference count of an interpolation.
| [in,out] | interpolation | Interpolation object. |
Definition at line 362 of file interpolation.c.

| struct yac_interpolation * yac_interpolation_new | ( | struct yac_collection_selection const * | collection_selection, |
| double | frac_mask_fallback_value, | ||
| double | scale_factor, | ||
| double | scale_summand ) |
Create a new interpolation object.
This constructor initializes a new interpolation structure operating on the provided source collection selection. The target field space is assumed to be contiguous with a collection size equal to the number of selected source collections.
| [in] | collection_selection | Selection of field collections to which this interpolation applies. Must not be NULL. |
| [in] | frac_mask_fallback_value | Value to be assigned to target points whose sum of fractional mask values of all contributing source points is zero. If the value YAC_FRAC_MASK_NO_VALUE is provided, fractional masking is deactivated for this interpolation object. |
| [in] | scale_factor | Scaling factor applied to all interpolated target points (except those receiving a fixed value). |
| [in] | scale_summand | Scaling summand added to all interpolated target points (except those receiving a fixed value). |
collection_selection applies exclusively to the source side.yac_collection_selection_get_size(collection_selection). Definition at line 54 of file interpolation.c.


| int yac_interpolation_with_frac_mask | ( | struct yac_interpolation * | interpolation | ) |
Query whether interpolation uses fractional masks.
| [in] | interpolation | Interpolation object. |
Definition at line 367 of file interpolation.c.

|
extern |
Value used to indicate that not fractional masking is to be use
Definition at line 27 of file interpolation.c.