YAC 3.12.0
Yet Another Coupler
Loading...
Searching...
No Matches
interpolation_exchange.h File Reference

Interpolation exchange object for temporary buffers and MPI exchanges. More...

#include <yaxt.h>
Include dependency graph for interpolation_exchange.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  YAC_INTERP_EXCH_STATUS { YAC_INTERP_EXCH_IDLE = 0 , YAC_INTERP_EXCH_WAIT_PUT = 1 , YAC_INTERP_EXCH_WAIT_GET = 2 , YAC_INTERP_EXCH_ACTIVE = 3 }
 Status of an interpolation exchange. More...
 
enum  YAC_INTERP_EXCH_TEST_STATUS { YAC_INTERP_EXCH_INCOMPLETE = 0 , YAC_INTERP_EXCH_COMPLETE = 1 }
 Status returned by test routines. More...
 

Functions

struct yac_interpolation_exchangeyac_interpolation_exchange_new (Xt_redist *redists, size_t num_fields, size_t collection_size, int with_frac_mask, char const *name)
 Create a new interpolation exchange object.
 
struct yac_interpolation_exchangeyac_interpolation_exchange_copy (struct yac_interpolation_exchange *exchange)
 Create a deep copy of an interpolation exchange.
 
void yac_interpolation_exchange_inc_ref_count (struct yac_interpolation_exchange *exchange)
 Increase the reference count of an exchange object.
 
int yac_interpolation_exchange_is_source (struct yac_interpolation_exchange *exchange)
 Query whether the current process participates as source.
 
int yac_interpolation_exchange_is_target (struct yac_interpolation_exchange *exchange)
 Query whether the current process participates as target.
 
void yac_interpolation_exchange_execute (struct yac_interpolation_exchange *exchange, double const **send_data, double **recv_data, char const *routine_name)
 Execute the full exchange (put + get) synchronously.
 
void yac_interpolation_exchange_execute_put (struct yac_interpolation_exchange *exchange, double const **send_data, char const *routine_name)
 Execute only the put phase asynchronously.
 
void yac_interpolation_exchange_wait (struct yac_interpolation_exchange *exchange, char const *routine_name)
 Wait for completion of pending put/get phases.
 
enum YAC_INTERP_EXCH_TEST_STATUS yac_interpolation_exchange_put_test (struct yac_interpolation_exchange *exchange, char const *routine_name)
 Test whether the put phase has completed.
 
enum YAC_INTERP_EXCH_TEST_STATUS yac_interpolation_exchange_get_test (struct yac_interpolation_exchange *exchange, char const *routine_name)
 Test whether the get phase has completed.
 
enum YAC_INTERP_EXCH_STATUS yac_interpolation_exchange_status (struct yac_interpolation_exchange *exchange, char const *routine_name)
 
void yac_interpolation_exchange_execute_get (struct yac_interpolation_exchange *exchange, double **recv_data, char const *routine_name)
 Execute the get phase and receive target data synchronously.
 
void yac_interpolation_exchange_execute_get_async (struct yac_interpolation_exchange *exchange, double **recv_data, char const *routine_name)
 Execute the get phase asynchronously.
 
int yac_interpolation_exchange_with_frac_mask (struct yac_interpolation_exchange *exchange)
 Query whether the exchange has fractional mask support.
 
void yac_interpolation_exchange_delete (struct yac_interpolation_exchange *exchange, char const *routine_name)
 Delete an interpolation exchange and release resources.
 

Detailed Description

Interpolation exchange object for temporary buffers and MPI exchanges.

This header defines the yac_interpolation_exchange structure, which manages temporary send/receive buffers and asynchronous exchanges for interpolation operators. It supports fractional masking and tracks the exchange status through its lifecycle (idle, active, wait for put/get).

Interpolation operators use this object to perform communication and accumulation of source fields to target fields.

Definition in file interpolation_exchange.h.

Enumeration Type Documentation

◆ YAC_INTERP_EXCH_STATUS

Status of an interpolation exchange.

Enumerator
YAC_INTERP_EXCH_IDLE 

No ongoing exchange.

YAC_INTERP_EXCH_WAIT_PUT 

Waiting for put phase completion.

YAC_INTERP_EXCH_WAIT_GET 

Waiting for get phase completion.

YAC_INTERP_EXCH_ACTIVE 

Exchange is active.

Definition at line 24 of file interpolation_exchange.h.

◆ YAC_INTERP_EXCH_TEST_STATUS

Status returned by test routines.

Enumerator
YAC_INTERP_EXCH_INCOMPLETE 

Operation still in progress.

YAC_INTERP_EXCH_COMPLETE 

No ongoing operation.

Definition at line 32 of file interpolation_exchange.h.

Function Documentation

◆ yac_interpolation_exchange_copy()

struct yac_interpolation_exchange * yac_interpolation_exchange_copy ( struct yac_interpolation_exchange * exchange)

Create a deep copy of an interpolation exchange.

Parameters
[in]exchangeExchange object to copy.
Returns
Newly allocated copy of the exchange.

Definition at line 154 of file interpolation_exchange.c.

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

◆ yac_interpolation_exchange_delete()

void yac_interpolation_exchange_delete ( struct yac_interpolation_exchange * exchange,
char const * routine_name )

Delete an interpolation exchange and release resources.

Parameters
[in,out]exchangeExchange object (NULL is safe).
[in]routine_nameName of the calling routine (for logging).

Definition at line 568 of file interpolation_exchange.c.

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

◆ yac_interpolation_exchange_execute()

void yac_interpolation_exchange_execute ( struct yac_interpolation_exchange * exchange,
double const ** send_data,
double ** recv_data,
char const * routine_name )

Execute the full exchange (put + get) synchronously.

Parameters
[in,out]exchangeExchange object.
[in]send_dataArray of source field pointers.
[out]recv_dataArray of target field pointers.
[in]routine_nameName of the calling routine (for logging).

Definition at line 522 of file interpolation_exchange.c.

Here is the caller graph for this function:

◆ yac_interpolation_exchange_execute_get()

void yac_interpolation_exchange_execute_get ( struct yac_interpolation_exchange * exchange,
double ** recv_data,
char const * routine_name )

Execute the get phase and receive target data synchronously.

Parameters
[in,out]exchangeExchange object.
[out]recv_dataArray of target field pointers.
[in]routine_nameName of the calling routine (for logging).

Definition at line 508 of file interpolation_exchange.c.

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

◆ yac_interpolation_exchange_execute_get_async()

void yac_interpolation_exchange_execute_get_async ( struct yac_interpolation_exchange * exchange,
double ** recv_data,
char const * routine_name )

Execute the get phase asynchronously.

Parameters
[in,out]exchangeExchange object.
[out]recv_dataArray of target field pointers.
[in]routine_nameName of the calling routine (for logging).

Definition at line 515 of file interpolation_exchange.c.

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

◆ yac_interpolation_exchange_execute_put()

void yac_interpolation_exchange_execute_put ( struct yac_interpolation_exchange * exchange,
double const ** send_data,
char const * routine_name )

Execute only the put phase asynchronously.

Parameters
[in,out]exchangeExchange object.
[in]send_dataArray of source field pointers.
[in]routine_nameName of the calling routine (for logging).

Definition at line 275 of file interpolation_exchange.c.

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

◆ yac_interpolation_exchange_get_test()

enum YAC_INTERP_EXCH_TEST_STATUS yac_interpolation_exchange_get_test ( struct yac_interpolation_exchange * exchange,
char const * routine_name )

Test whether the get phase has completed.

Parameters
[in]exchangeExchange object.
[in]routine_nameName of the calling routine (for logging).
Returns
YAC_INTERP_EXCH_COMPLETE if no open get operation is in progress, YAC_INTERP_EXCH_INCOMPLETE otherwise.

Definition at line 226 of file interpolation_exchange.c.

Here is the caller graph for this function:

◆ yac_interpolation_exchange_inc_ref_count()

void yac_interpolation_exchange_inc_ref_count ( struct yac_interpolation_exchange * exchange)

Increase the reference count of an exchange object.

Parameters
[in,out]exchangeExchange object.

Definition at line 162 of file interpolation_exchange.c.

Here is the caller graph for this function:

◆ yac_interpolation_exchange_is_source()

int yac_interpolation_exchange_is_source ( struct yac_interpolation_exchange * exchange)

Query whether the current process participates as source.

Parameters
[in]exchangeExchange object.
Returns
Nonzero if the process holds source data, 0 otherwise.

Definition at line 168 of file interpolation_exchange.c.

Here is the caller graph for this function:

◆ yac_interpolation_exchange_is_target()

int yac_interpolation_exchange_is_target ( struct yac_interpolation_exchange * exchange)

Query whether the current process participates as target.

Parameters
[in]exchangeExchange object.
Returns
Nonzero if the process holds target data, 0 otherwise.

Definition at line 174 of file interpolation_exchange.c.

Here is the caller graph for this function:

◆ yac_interpolation_exchange_new()

struct yac_interpolation_exchange * yac_interpolation_exchange_new ( Xt_redist * redists,
size_t num_fields,
size_t collection_size,
int with_frac_mask,
char const * name )

Create a new interpolation exchange object.

Parameters
[in]redistsArray of redistribution handles (yaxt)
dimensions: [num_fields]
[in]num_fieldsNumber of fields involved in the exchange.
[in]collection_sizeNumber of field collections handled.
[in]with_frac_maskNonzero to enable fractional mask support.
[in]nameName of the exchange (for logging/debugging).
Returns
Newly allocated interpolation exchange object.

Definition at line 140 of file interpolation_exchange.c.

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

◆ yac_interpolation_exchange_put_test()

enum YAC_INTERP_EXCH_TEST_STATUS yac_interpolation_exchange_put_test ( struct yac_interpolation_exchange * exchange,
char const * routine_name )

Test whether the put phase has completed.

Parameters
[in]exchangeExchange object.
[in]routine_nameName of the calling routine (for logging).
Returns
YAC_INTERP_EXCH_COMPLETE if no open put operation is in progress, YAC_INTERP_EXCH_INCOMPLETE otherwise.

Definition at line 200 of file interpolation_exchange.c.

Here is the caller graph for this function:

◆ yac_interpolation_exchange_status()

enum YAC_INTERP_EXCH_STATUS yac_interpolation_exchange_status ( struct yac_interpolation_exchange * exchange,
char const * routine_name )

Definition at line 252 of file interpolation_exchange.c.

Here is the caller graph for this function:

◆ yac_interpolation_exchange_wait()

void yac_interpolation_exchange_wait ( struct yac_interpolation_exchange * exchange,
char const * routine_name )

Wait for completion of pending put/get phases.

Parameters
[in,out]exchangeExchange object.
[in]routine_nameName of the calling routine (for logging).

Definition at line 180 of file interpolation_exchange.c.

Here is the caller graph for this function:

◆ yac_interpolation_exchange_with_frac_mask()

int yac_interpolation_exchange_with_frac_mask ( struct yac_interpolation_exchange * exchange)

Query whether the exchange has fractional mask support.

Parameters
[in]exchangeExchange object.
Returns
Nonzero if fractional mask support is enabled, 0 otherwise.

Definition at line 562 of file interpolation_exchange.c.

Here is the caller graph for this function: