|
YAC 3.15.0
Yet Another Coupler
|
#include "config.h"#include <string.h>#include <math.h>#include <yaxt.h>#include "ppm/core.h"#include "utils_core.h"#include "interpolation/interpolation_internal.h"#include "interpolation/operators/interp_operator_internal.h"#include "interpolation/operators/interp_operator_fixed.h"#include "interpolation/operators/interp_operator_direct.h"#include "interpolation/operators/interp_operator_direct_mf.h"#include "interpolation/operators/interp_operator_sum_mvp_at_src.h"#include "interpolation/operators/interp_operator_sum_mvp_at_tgt.h"#include "yac_mpi_internal.h"#include "collection_selection_internal.h"
Go to the source code of this file.
Data Structures | |
| struct | yac_interpolation |
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. | |
| static void | yac_interpolation_add (struct yac_interpolation *interp, struct yac_interp_operator *interp_type) |
| 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_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 (struct yac_interpolation *interp, double ***src_fields, double **tgt_field) |
| Execute interpolation synchronously and write results to the target field. | |
| 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_put (struct yac_interpolation *interp, double ***src_fields) |
| Provide source field data 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_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_delete (struct yac_interpolation *interp) |
| Free an interpolation object and release all resources. | |
| struct yac_collection_selection const * | yac_interpolation_get_collection_selection (struct yac_interpolation const *interp) |
| Return the collection selection associated with an interpolation. | |
| double | yac_interpolation_get_const_frac_mask_no_value_c2f () |
| double | yac_interpolation_get_const_frac_mask_undef_c2f () |
Variables | |
| double const | YAC_FRAC_MASK_NO_VALUE = 133713371337.0 |
| double const | YAC_FRAC_MASK_UNDEF = -133713371337.0 |
|
static |
Definition at line 100 of file interpolation.c.


| 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.


| struct yac_collection_selection const * yac_interpolation_get_collection_selection | ( | struct yac_interpolation const * | interp | ) |
Return the collection selection associated with an interpolation.
The returned pointer is owned by the interpolation object; the caller must not free it. If interp is NULL the function returns NULL.
| [in] | interp | Pointer to interpolation object (may be NULL). |
Definition at line 388 of file interpolation.c.
| double yac_interpolation_get_const_frac_mask_no_value_c2f | ( | ) |
Definition at line 394 of file interpolation.c.
| double yac_interpolation_get_const_frac_mask_undef_c2f | ( | ) |
Definition at line 398 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.

| double const YAC_FRAC_MASK_NO_VALUE = 133713371337.0 |
Value used to indicate that not fractional masking is to be use
Definition at line 27 of file interpolation.c.
| double const YAC_FRAC_MASK_UNDEF = -133713371337.0 |
Value indicating that fractional mask behavious
Definition at line 28 of file interpolation.c.