YAC 3.12.0
Yet Another Coupler
Loading...
Searching...
No Matches
interp_operator_sum_mvp_at_tgt.c File Reference
Include dependency graph for interp_operator_sum_mvp_at_tgt.c:

Go to the source code of this file.

Data Structures

struct  yac_interp_operator_sum_mvp_at_tgt
 

Functions

static int yac_interp_operator_sum_mvp_at_tgt_is_source (struct yac_interp_operator *interp)
 
static int yac_interp_operator_sum_mvp_at_tgt_is_target (struct yac_interp_operator *interp)
 
static void yac_interp_operator_sum_mvp_at_tgt_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)
 
static void yac_interp_operator_sum_mvp_at_tgt_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)
 
static void yac_interp_operator_sum_mvp_at_tgt_execute_get (struct yac_interp_operator *interp, double **tgt_field, double frac_mask_fallback_value, double scale_factor, double scale_summand)
 
static void yac_interp_operator_sum_mvp_at_tgt_execute_get_async (struct yac_interp_operator *interp, double **tgt_field, double frac_mask_fallback_value, double scale_factor, double scale_summand)
 
static enum YAC_INTERP_TEST_STATUS yac_interp_operator_sum_mvp_at_tgt_execute_put_test (struct yac_interp_operator *interp)
 
static enum YAC_INTERP_TEST_STATUS yac_interp_operator_sum_mvp_at_tgt_execute_get_test (struct yac_interp_operator *interp)
 
static void yac_interp_operator_sum_mvp_at_tgt_execute_wait (struct yac_interp_operator *interp)
 
static struct yac_interp_operatoryac_interp_operator_sum_mvp_at_tgt_copy (struct yac_interp_operator *interp)
 
static void yac_interp_operator_sum_mvp_at_tgt_delete (struct yac_interp_operator *interp)
 
static int local_src_data_is_used (size_t count, size_t const *src_field_idx)
 
static struct yac_interp_operatoryac_interp_operator_sum_mvp_at_tgt_new_ (struct yac_collection_selection const *collection_selection, struct yac_interpolation_buffer src_send_data, struct yac_interpolation_buffer src_recv_data, struct yac_interpolation_exchange *src2tgt, size_t *tgt_pos, size_t tgt_count, size_t *prefix_num_src_per_tgt, double *weights, size_t *src_field_idx, size_t *src_idx, size_t num_src_fields, int with_frac_mask, int *ref_count)
 Internal constructor for the "sum_mvp_at_tgt" interpolation operator.
 
struct yac_interp_operatoryac_interp_operator_sum_mvp_at_tgt_new (struct yac_collection_selection const *collection_selection, 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, int with_frac_mask)
 Create a sum (weighted or unweighted) interpolation operator computed on the target processes.
 
static void compute_tgt (struct yac_interp_operator_sum_mvp_at_tgt *sum_mvp_at_tgt)
 

Variables

static struct yac_interp_operator_vtable const interpolation_sum_mvp_at_tgt_vtable
 

Function Documentation

◆ compute_tgt()

static void compute_tgt ( struct yac_interp_operator_sum_mvp_at_tgt * sum_mvp_at_tgt)
static

Definition at line 563 of file interp_operator_sum_mvp_at_tgt.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ local_src_data_is_used()

static int local_src_data_is_used ( size_t count,
size_t const * src_field_idx )
static

Definition at line 134 of file interp_operator_sum_mvp_at_tgt.c.

Here is the caller graph for this function:

◆ yac_interp_operator_sum_mvp_at_tgt_copy()

static struct yac_interp_operator * yac_interp_operator_sum_mvp_at_tgt_copy ( struct yac_interp_operator * interp)
static

Definition at line 710 of file interp_operator_sum_mvp_at_tgt.c.

Here is the call graph for this function:

◆ yac_interp_operator_sum_mvp_at_tgt_delete()

static void yac_interp_operator_sum_mvp_at_tgt_delete ( struct yac_interp_operator * interp)
static

Definition at line 737 of file interp_operator_sum_mvp_at_tgt.c.

Here is the call graph for this function:

◆ yac_interp_operator_sum_mvp_at_tgt_execute()

static void yac_interp_operator_sum_mvp_at_tgt_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 )
static

Definition at line 393 of file interp_operator_sum_mvp_at_tgt.c.

Here is the call graph for this function:

◆ yac_interp_operator_sum_mvp_at_tgt_execute_get()

static void yac_interp_operator_sum_mvp_at_tgt_execute_get ( struct yac_interp_operator * interp,
double ** tgt_field,
double frac_mask_fallback_value,
double scale_factor,
double scale_summand )
static

Definition at line 599 of file interp_operator_sum_mvp_at_tgt.c.

Here is the call graph for this function:

◆ yac_interp_operator_sum_mvp_at_tgt_execute_get_async()

static void yac_interp_operator_sum_mvp_at_tgt_execute_get_async ( struct yac_interp_operator * interp,
double ** tgt_field,
double frac_mask_fallback_value,
double scale_factor,
double scale_summand )
static

Definition at line 626 of file interp_operator_sum_mvp_at_tgt.c.

Here is the call graph for this function:

◆ yac_interp_operator_sum_mvp_at_tgt_execute_get_test()

static enum YAC_INTERP_TEST_STATUS yac_interp_operator_sum_mvp_at_tgt_execute_get_test ( struct yac_interp_operator * interp)
static

Definition at line 676 of file interp_operator_sum_mvp_at_tgt.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_interp_operator_sum_mvp_at_tgt_execute_put()

static void yac_interp_operator_sum_mvp_at_tgt_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 )
static

Definition at line 487 of file interp_operator_sum_mvp_at_tgt.c.

Here is the call graph for this function:

◆ yac_interp_operator_sum_mvp_at_tgt_execute_put_test()

static enum YAC_INTERP_TEST_STATUS yac_interp_operator_sum_mvp_at_tgt_execute_put_test ( struct yac_interp_operator * interp)
static

Definition at line 652 of file interp_operator_sum_mvp_at_tgt.c.

Here is the call graph for this function:

◆ yac_interp_operator_sum_mvp_at_tgt_execute_wait()

static void yac_interp_operator_sum_mvp_at_tgt_execute_wait ( struct yac_interp_operator * interp)
static

Definition at line 696 of file interp_operator_sum_mvp_at_tgt.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_interp_operator_sum_mvp_at_tgt_is_source()

static int yac_interp_operator_sum_mvp_at_tgt_is_source ( struct yac_interp_operator * interp)
static

Definition at line 375 of file interp_operator_sum_mvp_at_tgt.c.

◆ yac_interp_operator_sum_mvp_at_tgt_is_target()

static int yac_interp_operator_sum_mvp_at_tgt_is_target ( struct yac_interp_operator * interp)
static

Definition at line 384 of file interp_operator_sum_mvp_at_tgt.c.

◆ yac_interp_operator_sum_mvp_at_tgt_new_()

static struct yac_interp_operator * yac_interp_operator_sum_mvp_at_tgt_new_ ( struct yac_collection_selection const * collection_selection,
struct yac_interpolation_buffer src_send_data,
struct yac_interpolation_buffer src_recv_data,
struct yac_interpolation_exchange * src2tgt,
size_t * tgt_pos,
size_t tgt_count,
size_t * prefix_num_src_per_tgt,
double * weights,
size_t * src_field_idx,
size_t * src_idx,
size_t num_src_fields,
int with_frac_mask,
int * ref_count )
static

Internal constructor for the "sum_mvp_at_tgt" interpolation operator.

This function creates a target-side accumulation (sum) interpolation operator, where all source contributions are first redistributed to the target ranks using the provided exchange mapping (src2tgt). The actual weighted or unweighted summation is then performed locally on the target processes.

Unlike the public constructor yac_interp_operator_sum_mvp_at_tgt_new(), this routine takes already prepared internal data structures, such as the pre-initialized send and receive interpolation buffers. It is used by the public constructor and yac_interp_operator_sum_mvp_at_tgt_copy().

The resulting operator computes, for each target point t, the following:

\[
    T_t = \sum_{i \in S(t)} w_i \cdot S_{f(i)}[s(i)]
\]

where:

  • $S(t)$ is the set of source contributions for target t (consisting of local source fields and receive buffer for source contributions from other processes),
  • $w_i$ is the corresponding interpolation weight (or 1.0 if unweighted),
  • $f(i)$ is the source field index (or SIZE_MAX to indicate a contribution from a remote process),
  • $s(i)$ is the local source index within that field (or the receive buffer)

If fractional masks are enabled (with_frac_mask != 0), each source value is multiplied by its corresponding mask before accumulation. The mask values are also used to determine the effective weighting of each contribution. If the sum of all fractional mask values for source contribution for a target point is zero, the provided fallback value (see frac_mask_fallback_value in the execution call) is used instead.

Parameters
[in]collection_selectionSelection of field collections to which this operator applies.
[in]src_send_dataBuffer used to store the source data for the src2tgt exchange in the asynchronous put operation.
[in]src_recv_dataBuffer used to receive the source data from the src2tgt exchange in the asynchronous put operation.
[in]src2tgtExchange structure that describes the redistribution of source data required by processes for the interpolation of their local target points.
[in]tgt_posArray of local target indices (length = tgt_count). Defines which target points are to be interpolated.
[in]tgt_countNumber of target points to be computed by this interpolation operation.
[in]prefix_num_src_per_tgtPrefix-sum array of length tgt_count + 1. Defines the cumulative number of source contributions per target point. The number of source entries for target i is given by: $ N_i = prefix\_num\_src\_per\_tgt[i+1] - prefix\_num\_src\_per\_tgt[i] $.
[in]weightsInterpolation weights for all source contributions (length = prefix_num_src_per_tgt[tgt_count]). If NULL, an unweighted sum is performed.
[in]src_field_idxArray mapping each source contribution to a source field index (same length as weights). The special value SIZE_MAX denotes a contribution from a remote field (not owned by the local process).
[in]src_idxArray of source indices for each source contribution (same length as weights). Defines the position within the local source field data or receive buffer (depending on src_field_idx).
[in]num_src_fieldsNumber of fields the source data consists of.
[in]with_frac_maskNon-zero value enables fractional mask support. In this case, both source values and masks are redistributed.
[in,out]ref_countOptional external reference counter. If non-NULL, it is incremented and stored. Upon deletion it is decremented. This allows the sharing of multiple data arrays between copies of the same interpolation operation.
Returns
Newly allocated interpolation operator object implementing the "sum_mvp_at_tgt" semantics.
Remarks
  • The function performs internal consistency checks, including validation of src_field_idx, array length consistency, and matching redistribution dimensions.
  • The prefix-sum array (prefix_num_src_per_tgt) must satisfy prefix_num_src_per_tgt[0] == 0 and be monotonically increasing.
  • All MPI and yaxt data structures (src2tgt, src_send_data, src_recv_data) must be fully initialized prior to calling this constructor.
  • Intended for internal use; end users should prefer yac_interp_operator_sum_mvp_at_tgt_new(), which builds these structures automatically from high-level interpolation setup data.

Definition at line 249 of file interp_operator_sum_mvp_at_tgt.c.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ interpolation_sum_mvp_at_tgt_vtable

struct yac_interp_operator_vtable const interpolation_sum_mvp_at_tgt_vtable
static
Initial value:
= {
}
static void yac_interp_operator_sum_mvp_at_tgt_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)
static enum YAC_INTERP_TEST_STATUS yac_interp_operator_sum_mvp_at_tgt_execute_put_test(struct yac_interp_operator *interp)
static int yac_interp_operator_sum_mvp_at_tgt_is_target(struct yac_interp_operator *interp)
static void yac_interp_operator_sum_mvp_at_tgt_execute_get_async(struct yac_interp_operator *interp, double **tgt_field, double frac_mask_fallback_value, double scale_factor, double scale_summand)
static struct yac_interp_operator * yac_interp_operator_sum_mvp_at_tgt_copy(struct yac_interp_operator *interp)
static void yac_interp_operator_sum_mvp_at_tgt_delete(struct yac_interp_operator *interp)
static void yac_interp_operator_sum_mvp_at_tgt_execute_get(struct yac_interp_operator *interp, double **tgt_field, double frac_mask_fallback_value, double scale_factor, double scale_summand)
static void yac_interp_operator_sum_mvp_at_tgt_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)
static int yac_interp_operator_sum_mvp_at_tgt_is_source(struct yac_interp_operator *interp)
static void yac_interp_operator_sum_mvp_at_tgt_execute_wait(struct yac_interp_operator *interp)
static enum YAC_INTERP_TEST_STATUS yac_interp_operator_sum_mvp_at_tgt_execute_get_test(struct yac_interp_operator *interp)

Definition at line 47 of file interp_operator_sum_mvp_at_tgt.c.