YAC 3.13.0
Yet Another Coupler
Loading...
Searching...
No Matches
interpolation_exchange.c File Reference
#include <string.h>
#include <yaxt.h>
#include "utils_core.h"
#include "interpolation/interpolation_exchange.h"
Include dependency graph for interpolation_exchange.c:

Go to the source code of this file.

Data Structures

struct  yac_interpolation_exchange
 

Enumerations

enum  exchange_state { EXCHANGE_IDLE , EXCHANGE_WAIT_PUT , EXCHANGE_WAIT_GET , EXCHANGE_ACTIVE }
 
enum  empty_exchange_state { EXCHANGE_INVALID , EXCHANGE_UNSET , EXCHANGE_AT_PUT , EXCHANGE_AT_GET }
 

Functions

static Xt_redist combine_redists (Xt_redist *redists, size_t num_redists, size_t collection_size)
 
static void do_empty_exchange (struct yac_interpolation_exchange *exchange, int is_put, char const *routine_name)
 
static struct yac_interpolation_exchangeyac_interpolation_exchange_new_ (Xt_redist redist, size_t count, char const *name, int with_frac_mask)
 
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_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_put (struct yac_interpolation_exchange *exchange, double const **send_data, char const *routine_name)
 Execute only the put phase asynchronously.
 
static void yac_interpolation_exchange_execute_get_ (struct yac_interpolation_exchange *exchange, double **recv_data, int is_async, 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.
 
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.
 
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.
 

Enumeration Type Documentation

◆ empty_exchange_state

Enumerator
EXCHANGE_INVALID 
EXCHANGE_UNSET 

exchange is source and/or target

EXCHANGE_AT_PUT 

exchange is neither source nor target and not put/get has been called

EXCHANGE_AT_GET 

exchange is neither source nor target and exchange is executed at put

Definition at line 19 of file interpolation_exchange.c.

◆ exchange_state

Enumerator
EXCHANGE_IDLE 
EXCHANGE_WAIT_PUT 

exchange is currently not in use

EXCHANGE_WAIT_GET 

contains valid put data, but is not yet communicated

EXCHANGE_ACTIVE 

contains valid get data, but is not yet communicated

Definition at line 12 of file interpolation_exchange.c.

Function Documentation

◆ combine_redists()

static Xt_redist combine_redists ( Xt_redist * redists,
size_t num_redists,
size_t collection_size )
static

Definition at line 49 of file interpolation_exchange.c.

Here is the caller graph for this function:

◆ do_empty_exchange()

static void do_empty_exchange ( struct yac_interpolation_exchange * exchange,
int is_put,
char const * routine_name )
static

Definition at line 87 of file interpolation_exchange.c.

Here is the caller graph for this function:

◆ 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 156 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 570 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 524 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 510 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_()

static void yac_interpolation_exchange_execute_get_ ( struct yac_interpolation_exchange * exchange,
double ** recv_data,
int is_async,
char const * routine_name )
static

Definition at line 378 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 517 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 277 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 228 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 164 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 170 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 176 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 142 of file interpolation_exchange.c.

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

◆ yac_interpolation_exchange_new_()

static struct yac_interpolation_exchange * yac_interpolation_exchange_new_ ( Xt_redist redist,
size_t count,
char const * name,
int with_frac_mask )
static

Definition at line 108 of file interpolation_exchange.c.

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 202 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 254 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 182 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 564 of file interpolation_exchange.c.

Here is the caller graph for this function: