YAC 3.21.0
Yet Another Coupler
Loading...
Searching...
No Matches
instance.c File Reference
#include "config.h"
#include <limits.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <mpi.h>
#include "utils_core.h"
#include "io_utils.h"
#include "yac.h"
#include "instance.h"
#include "event.h"
#include "yac_mpi_common.h"
#include "fields.h"
#include "component.h"
#include "config_yaml.h"
#include "yac_pak.h"
#include "yac_pak_instrument.h"
#include "interpolation/interpolation_exchange.h"
#include "interpolation/interpolation_internal.h"
#include "interpolation/interpolation_gen_config_internal.h"
Include dependency graph for instance.c:

Go to the source code of this file.

Data Structures

struct  yac_instance
 
struct  comp_grid_config
 
struct  comp_grid_pair_config
 
struct  field_config_event_data
 
struct  src_field_config
 
struct  tgt_field_config
 
struct  field_config
 
struct  output_grid
 
struct  dist_flag
 

Macros

#define CHECK_PHASE(REF_PHASE, NEW_PHASE)
 
#define CHECK_MIN_PHASE(MIN_REF_PHASE)
 
#define CHECK_MAX_PHASE(MAX_REF_PHASE)
 
#define YAC_PAK_TRACE_SETUP_START(CALLER, TYPE)
 
#define YAC_PAK_TRACE_SETUP_STOP()
 

Enumerations

enum  yac_instance_phase {
  INSTANCE_DEFINITION = 0 , INSTANCE_DEFINITION_COMP = 1 , INSTANCE_DEFINITION_SYNC = 2 , INSTANCE_EXCHANGE = 3 ,
  INSTANCE_UNKNOWN = 4
}
 
enum  field_availability_type { SOURCE_FLAG = 1 << 0 , TARGET_FLAG = 1 << 1 , SOURCE_TARGET_FLAG = (1 << 0) | (1 << 1) }
 
enum  field_type { SRC = 1 , TGT = 2 }
 

Functions

 DEF_NAME_TYPE_PAIRS (calendar_type_table, DEF_NAME_TYPE_PAIR(CALENDAR_NOT_SET, CALENDAR_NOT_SET), DEF_NAME_TYPE_PAIR(PROLEPTIC_GREGORIAN, PROLEPTIC_GREGORIAN), DEF_NAME_TYPE_PAIR(YEAR_OF_360_DAYS, YEAR_OF_360_DAYS), DEF_NAME_TYPE_PAIR(YEAR_OF_365_DAYS, YEAR_OF_365_DAYS))
 
static int compare_comp_grid_config (const void *a, const void *b)
 
static struct coupling_fieldget_coupling_field (char const *component_name, const char *field_name, const char *grid_name, size_t num_fields, struct coupling_field **coupling_fields)
 
static int compare_field_config_interpolation_build_config (struct field_config *a, struct field_config *b)
 
static struct field_config_event_data get_event_data (struct yac_instance *instance, int couple_idx, int field_couple_idx, enum field_type field_type)
 
static struct eventgenerate_event (struct field_config_event_data event_data)
 
static int * determine_valid_field_configurations (struct yac_couple_config *couple_config, MPI_Comm comm, struct coupling_field **coupling_fields, size_t num_fields)
 
static void get_interp_fields_from_coupling_field (struct coupling_field *field, char const *const *mask_names, size_t num_mask_names, struct yac_interp_field **interp_fields, size_t *num_fields, MPI_Comm comm)
 
static struct src_field_config get_src_interp_config (struct yac_couple_config *couple_config, size_t couple_idx, size_t field_couple_idx, struct coupling_field *field, MPI_Comm comm)
 
static struct tgt_field_config get_tgt_interp_config (struct yac_couple_config *couple_config, size_t couple_idx, size_t field_couple_idx, struct coupling_field *field, MPI_Comm comm)
 
static int compare_dist_flags (const void *a_, const void *b_)
 
static void generate_dist_flag_config_ids (uint64_t *local_flags, size_t flag_count, uint64_t *global_flags_buffer, struct dist_flag *dist_flags, int *dist_flag_ids, MPI_Comm comm)
 
static void generate_coupling_field_avail_config_ids (struct field_config *field_configs, size_t num_fields, MPI_Comm comm)
 
static void get_field_configuration (struct yac_instance *instance, struct field_config **field_configs_, size_t *count)
 
static int compare_interp_field (struct yac_interp_field *a, struct yac_interp_field *b)
 
static int compare_field_config_interp_fields (struct field_config *a, struct field_config *b)
 
static int compare_field_config (const void *a, const void *b)
 
static struct yac_interp_weightsgenerate_interp_weights (struct src_field_config src_interp_config, struct yac_interp_grid *interp_grid)
 
static void get_output_grids (struct yac_instance *instance, struct yac_basic_grid **local_grids, size_t num_local_grids, struct output_grid **output_grids, size_t *output_grid_count)
 
static int compare_output_grids (const void *a, const void *b)
 
static void write_grids_to_file (struct yac_instance *instance, struct yac_basic_grid **grids, size_t num_grids)
 
static void generate_interpolations (struct yac_instance *instance, struct yac_basic_grid **grids, size_t num_grids)
 
void yac_instance_sync_def (struct yac_instance *instance)
 
void yac_instance_sync_def_comps (struct yac_instance *instance, char const **comp_names, size_t num_comp_names)
 
void yac_instance_setup (struct yac_instance *instance, struct yac_basic_grid **grids, size_t num_grids)
 
char * yac_instance_setup_and_emit_config (struct yac_instance *instance, struct yac_basic_grid **grids, size_t num_grids, int emit_flags)
 
MPI_Comm yac_instance_get_comps_comm (struct yac_instance *instance, char const **comp_names, size_t num_comp_names)
 
int yac_instance_get_nbr_comps (struct yac_instance *instance)
 
int yac_instance_get_comp_size (struct yac_instance *instance, const char *comp_name)
 
int yac_instance_get_comp_rank (struct yac_instance *instance, const char *comp_name)
 
struct yac_instanceyac_instance_new (MPI_Comm yac_comm)
 
void yac_instance_dummy_new (MPI_Comm comm)
 
void yac_instance_delete (struct yac_instance *instance)
 
MPI_Comm yac_instance_get_comm (struct yac_instance *instance)
 
struct yac_couple_configyac_instance_get_couple_config (struct yac_instance *instance)
 
void yac_instance_set_couple_config (struct yac_instance *instance, struct yac_couple_config *couple_config)
 
void yac_instance_def_calendar (int calendar_type, char const *source)
 
void yac_instance_def_datetime (struct yac_instance *instance, const char *start_datetime, const char *end_datetime)
 
char * yac_instance_get_start_datetime (struct yac_instance *instance)
 
char * yac_instance_get_end_datetime (struct yac_instance *instance)
 
void yac_instance_def_components (struct yac_instance *instance, char const **comp_names, size_t num_comps)
 
int yac_instance_components_are_defined (struct yac_instance *instance)
 
static bool check_timedelta_positive (const char *timestep)
 
struct coupling_fieldyac_instance_add_field (struct yac_instance *instance, char const *field_name, char const *comp_name, struct yac_basic_grid *grid, struct yac_interp_field *interp_fields, size_t num_interp_fields, int collection_size, char const *timestep)
 
void yac_instance_def_couple (struct yac_instance *instance, char const *src_comp_name, char const *src_grid_name, char const *src_field_name, char const *tgt_comp_name, char const *tgt_grid_name, char const *tgt_field_name, char const *coupling_period, int time_reduction, struct yac_interp_stack_config *interp_stack_config, int src_lag, int tgt_lag, const char *weight_file_name, int weight_file_on_existing, int mapping_on_source, double scale_factor, double scale_summand, size_t num_src_mask_names, char const *const *src_mask_names, char const *tgt_mask_name, char const *yaxt_exchanger_name, struct yac_collection_selection const *collection_selection, int use_raw_exchange)
 
struct coupling_fieldyac_instance_get_field (struct yac_instance *instance, const char *comp_name, const char *grid_name, const char *field_name)
 

Variables

static const char * yac_instance_phase_str []
 
static struct field_config_event_data empty_event_data
 

Macro Definition Documentation

◆ CHECK_MAX_PHASE

#define CHECK_MAX_PHASE ( MAX_REF_PHASE)
Value:
{ \
enum yac_instance_phase ref_max_phase_ = (MAX_REF_PHASE); \
YAC_ASSERT_F( \
instance->phase <= (ref_max_phase_), \
"Invalid phase (current phase: \"%s\" maximum expected phase: \"%s\")", \
MIN(instance->phase,INSTANCE_UNKNOWN)], \
yac_instance_phase_str[(ref_max_phase_)]); \
}
static const char * yac_instance_phase_str[]
Definition instance.c:48
yac_instance_phase
Definition instance.c:31
@ INSTANCE_UNKNOWN
Definition instance.c:36
#define MIN(a, b)
Definition toy_common.h:29

Definition at line 74 of file instance.c.

◆ CHECK_MIN_PHASE

#define CHECK_MIN_PHASE ( MIN_REF_PHASE)
Value:
{ \
enum yac_instance_phase ref_min_phase_ = (MIN_REF_PHASE); \
YAC_ASSERT_F( \
instance->phase >= (ref_min_phase_), \
"Invalid phase (current phase: \"%s\" minimum expected phase: \"%s\")", \
yac_instance_phase_str[instance->phase], \
yac_instance_phase_str[(ref_min_phase_)]); \
}

Definition at line 65 of file instance.c.

◆ CHECK_PHASE

#define CHECK_PHASE ( REF_PHASE,
NEW_PHASE )
Value:
{ \
enum yac_instance_phase ref_phase_ = (REF_PHASE); \
YAC_ASSERT_F( \
instance->phase == (ref_phase_), \
"Invalid phase (current phase: \"%s\" expected phase: \"%s\")", \
yac_instance_phase_str[instance->phase], \
yac_instance_phase_str[(ref_phase_)]); \
instance->phase = (NEW_PHASE); \
}

Definition at line 55 of file instance.c.

◆ YAC_PAK_TRACE_SETUP_START

#define YAC_PAK_TRACE_SETUP_START ( CALLER,
TYPE )
Value:
{ \
int h_pak_trace = \
yac_pak_setup_trace_is_enabled(instance->pak) ? \
yac_pak_trace_start_setup(instance->pak, CALLER, TYPE) : -1;

Definition at line 85 of file instance.c.

◆ YAC_PAK_TRACE_SETUP_STOP

#define YAC_PAK_TRACE_SETUP_STOP ( )
Value:
yac_pak_trace_stop(instance->pak, h_pak_trace); \
}
int yac_pak_trace_stop(struct yac_pak *pak, int handle)
Stop a trace event.
Definition yac_pak.c:1055

Definition at line 91 of file instance.c.

Enumeration Type Documentation

◆ field_availability_type

Enumerator
SOURCE_FLAG 
TARGET_FLAG 
SOURCE_TARGET_FLAG 

Definition at line 40 of file instance.c.

◆ field_type

enum field_type
Enumerator
SRC 
TGT 

Definition at line 118 of file instance.c.

◆ yac_instance_phase

Enumerator
INSTANCE_DEFINITION 
INSTANCE_DEFINITION_COMP 
INSTANCE_DEFINITION_SYNC 
INSTANCE_EXCHANGE 
INSTANCE_UNKNOWN 

Definition at line 31 of file instance.c.

Function Documentation

◆ check_timedelta_positive()

static bool check_timedelta_positive ( const char * timestep)
static

Definition at line 1658 of file instance.c.

Here is the caller graph for this function:

◆ compare_comp_grid_config()

static int compare_comp_grid_config ( const void * a,
const void * b )
static

Definition at line 219 of file instance.c.

Here is the caller graph for this function:

◆ compare_dist_flags()

static int compare_dist_flags ( const void * a_,
const void * b_ )
static

Definition at line 629 of file instance.c.

Here is the caller graph for this function:

◆ compare_field_config()

static int compare_field_config ( const void * a,
const void * b )
static

Definition at line 936 of file instance.c.

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

◆ compare_field_config_interp_fields()

static int compare_field_config_interp_fields ( struct field_config * a,
struct field_config * b )
static

Definition at line 908 of file instance.c.

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

◆ compare_field_config_interpolation_build_config()

static int compare_field_config_interpolation_build_config ( struct field_config * a,
struct field_config * b )
static

Definition at line 248 of file instance.c.

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

◆ compare_interp_field()

static int compare_interp_field ( struct yac_interp_field * a,
struct yac_interp_field * b )
static

Definition at line 894 of file instance.c.

Here is the caller graph for this function:

◆ compare_output_grids()

static int compare_output_grids ( const void * a,
const void * b )
static

Definition at line 1052 of file instance.c.

Here is the caller graph for this function:

◆ DEF_NAME_TYPE_PAIRS()

DEF_NAME_TYPE_PAIRS ( calendar_type_table ,
DEF_NAME_TYPE_PAIR(CALENDAR_NOT_SET, CALENDAR_NOT_SET) ,
DEF_NAME_TYPE_PAIR(PROLEPTIC_GREGORIAN, PROLEPTIC_GREGORIAN) ,
DEF_NAME_TYPE_PAIR(YEAR_OF_360_DAYS, YEAR_OF_360_DAYS) ,
DEF_NAME_TYPE_PAIR(YEAR_OF_365_DAYS, YEAR_OF_365_DAYS)  )

Definition at line 198 of file instance.c.

Here is the call graph for this function:

◆ determine_valid_field_configurations()

static int * determine_valid_field_configurations ( struct yac_couple_config * couple_config,
MPI_Comm comm,
struct coupling_field ** coupling_fields,
size_t num_fields )
static

Definition at line 325 of file instance.c.

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

◆ generate_coupling_field_avail_config_ids()

static void generate_coupling_field_avail_config_ids ( struct field_config * field_configs,
size_t num_fields,
MPI_Comm comm )
static

Definition at line 698 of file instance.c.

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

◆ generate_dist_flag_config_ids()

static void generate_dist_flag_config_ids ( uint64_t * local_flags,
size_t flag_count,
uint64_t * global_flags_buffer,
struct dist_flag * dist_flags,
int * dist_flag_ids,
MPI_Comm comm )
static

Definition at line 637 of file instance.c.

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

◆ generate_event()

static struct event * generate_event ( struct field_config_event_data event_data)
static

Definition at line 311 of file instance.c.

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

◆ generate_interp_weights()

static struct yac_interp_weights * generate_interp_weights ( struct src_field_config src_interp_config,
struct yac_interp_grid * interp_grid )
static

Definition at line 999 of file instance.c.

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

◆ generate_interpolations()

static void generate_interpolations ( struct yac_instance * instance,
struct yac_basic_grid ** grids,
size_t num_grids )
static

Definition at line 1104 of file instance.c.

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

◆ get_coupling_field()

static struct coupling_field * get_coupling_field ( char const * component_name,
const char * field_name,
const char * grid_name,
size_t num_fields,
struct coupling_field ** coupling_fields )
static

Definition at line 230 of file instance.c.

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

◆ get_event_data()

static struct field_config_event_data get_event_data ( struct yac_instance * instance,
int couple_idx,
int field_couple_idx,
enum field_type field_type )
static

Definition at line 269 of file instance.c.

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

◆ get_field_configuration()

static void get_field_configuration ( struct yac_instance * instance,
struct field_config ** field_configs_,
size_t * count )
static

Definition at line 782 of file instance.c.

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

◆ get_interp_fields_from_coupling_field()

static void get_interp_fields_from_coupling_field ( struct coupling_field * field,
char const *const * mask_names,
size_t num_mask_names,
struct yac_interp_field ** interp_fields,
size_t * num_fields,
MPI_Comm comm )
static

Definition at line 442 of file instance.c.

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

◆ get_output_grids()

static void get_output_grids ( struct yac_instance * instance,
struct yac_basic_grid ** local_grids,
size_t num_local_grids,
struct output_grid ** output_grids,
size_t * output_grid_count )
static

Definition at line 1014 of file instance.c.

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

◆ get_src_interp_config()

static struct src_field_config get_src_interp_config ( struct yac_couple_config * couple_config,
size_t couple_idx,
size_t field_couple_idx,
struct coupling_field * field,
MPI_Comm comm )
static

Definition at line 561 of file instance.c.

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

◆ get_tgt_interp_config()

static struct tgt_field_config get_tgt_interp_config ( struct yac_couple_config * couple_config,
size_t couple_idx,
size_t field_couple_idx,
struct coupling_field * field,
MPI_Comm comm )
static

Definition at line 602 of file instance.c.

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

◆ write_grids_to_file()

static void write_grids_to_file ( struct yac_instance * instance,
struct yac_basic_grid ** grids,
size_t num_grids )
static

Definition at line 1060 of file instance.c.

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

◆ yac_instance_add_field()

struct coupling_field * yac_instance_add_field ( struct yac_instance * instance,
char const * field_name,
char const * comp_name,
struct yac_basic_grid * grid,
struct yac_interp_field * interp_fields,
size_t num_interp_fields,
int collection_size,
char const * timestep )

Adds a coupling field to a YAC instance

Parameters
[in]instanceYAC instance
[in]field_namename of the coupling field
[in]comp_namecomponent name
[in]gridgrid
[in]interp_fieldsinterpolation fields
[in]num_interp_fieldsnumber of entries in interp_fields
[in]collection_sizecollection size of field
[in]timesteptimestep at which put/get is called for this field in ISO 8601 format
Returns
pointer to coupling field

Definition at line 1666 of file instance.c.

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

◆ yac_instance_components_are_defined()

int yac_instance_components_are_defined ( struct yac_instance * instance)

Returns true if the components for this instance have already been defined

Parameters
[in]instanceYAC instance

Definition at line 1653 of file instance.c.

Here is the caller graph for this function:

◆ yac_instance_def_calendar()

void yac_instance_def_calendar ( int calendar_type,
char const * source )

Definition of calendar type

The definition is global for all instances. This function will set the calendar type, if it was unset before, or check that the provided calendar type is the same as the already set calendar type, if it was set before.

Parameters
[in]calendar_typecalendar type to be set or checked
[in]sourcesource of the calendar definition

Definition at line 1557 of file instance.c.

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

◆ yac_instance_def_components()

void yac_instance_def_components ( struct yac_instance * instance,
char const ** comp_names,
size_t num_comps )

Defines the components for a YAC instance

Parameters
[in]instanceYAC instance
[in]comp_namesnames of components
[in]num_compsnumber of entries in comp_names

Definition at line 1603 of file instance.c.

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

◆ yac_instance_def_couple()

void yac_instance_def_couple ( struct yac_instance * instance,
char const * src_comp_name,
char const * src_grid_name,
char const * src_field_name,
char const * tgt_comp_name,
char const * tgt_grid_name,
char const * tgt_field_name,
char const * coupling_period,
int time_reduction,
struct yac_interp_stack_config * interp_stack_config,
int src_lag,
int tgt_lag,
const char * weight_file_name,
int weight_file_on_existing,
int mapping_on_source,
double scale_factor,
double scale_summand,
size_t num_src_mask_names,
char const *const * src_mask_names,
char const * tgt_mask_name,
char const * yaxt_exchanger_name,
struct yac_collection_selection const * collection_selection,
int use_raw_exchange )

Defines a couple for a YAC instance

Parameters
[in]instanceYAC instance
[in]src_comp_namecomponent name of the source component
[in]src_grid_namegrid name of the source grid
[in]src_field_namefield name of the source field
[in]tgt_comp_namecomponent name of the target component
[in]tgt_grid_namegrid name of the target grid
[in]tgt_field_namefield name of the target field
[in]coupling_periodtime step for the coupling
[in]time_reductiontype for reducing multiple timesteps (
See also
YAC_REDUCTION_TIME_NONE etc.)
Parameters
[in]interp_stack_configinterpolation stack config to be used
[in]src_laglag for this couple on the source component
[in]tgt_laglag for this couple on the target component
[in]weight_file_namefile name for the weights file. NULL to disable this feature
[in]weight_file_on_existingspecifies how YAC is supposed to handle the case of an already existing file with the same name
[in]mapping_on_sourceside where the mapping is computed. Currently only source = 1 and target = 0 are allowed
[in]scale_factorscale factor
[in]scale_summandscale summand
[in]num_src_mask_namesnumber of source field mask names ("0" if no source field mask names are provided)
[in]src_mask_namesarray of source field mask names ("NULL" if num_src_mask_names == 0)
[in]tgt_mask_nametarget field mask name ("NULL" if no target field mask name is provided)
[in]yaxt_exchanger_nameyaxt exchanger method to be used for the interpoolation
[in]collection_selectioncollection selection for this couple
[in]use_raw_exchangeenables the use of raw exchange (YAC only transfers data required for interpolation to target process, afterwards user has to apply the interpolation himself)

Definition at line 1729 of file instance.c.

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

◆ yac_instance_def_datetime()

void yac_instance_def_datetime ( struct yac_instance * instance,
const char * start_datetime,
const char * end_datetime )

Definition of job start and end datetime

Parameters
[in]instanceYAC instance
[in]start_datetimecalendar job start datetime
[in]end_datetimecalendar job end datetime

Definition at line 1585 of file instance.c.

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

◆ yac_instance_delete()

void yac_instance_delete ( struct yac_instance * instance)

Destructor for a YAC instance

Parameters
[in]instanceYAC instance to be deleted

Definition at line 1509 of file instance.c.

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

◆ yac_instance_dummy_new()

void yac_instance_dummy_new ( MPI_Comm comm)

Dummy constructor, which can be called instead of yac_instance_new.

Parameters
[in]comm

Definition at line 1503 of file instance.c.

Here is the caller graph for this function:

◆ yac_instance_get_comm()

MPI_Comm yac_instance_get_comm ( struct yac_instance * instance)

Query routine for the MPI communicator associated with the instance.

Parameters
[in]instanceYAC instance
Returns
MPI communicator of the YAC instance

Definition at line 1535 of file instance.c.

Here is the caller graph for this function:

◆ yac_instance_get_comp_rank()

int yac_instance_get_comp_rank ( struct yac_instance * instance,
const char * comp_name )

Definition at line 1456 of file instance.c.

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

◆ yac_instance_get_comp_size()

int yac_instance_get_comp_size ( struct yac_instance * instance,
const char * comp_name )

Definition at line 1447 of file instance.c.

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

◆ yac_instance_get_comps_comm()

MPI_Comm yac_instance_get_comps_comm ( struct yac_instance * instance,
char const ** comp_names,
size_t num_comp_names )

returns a communicator containing all processes of the provided components

Parameters
[in]instanceYAC instance
[in]comp_namescomponent names
[in]num_comp_names

Definition at line 1431 of file instance.c.

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

◆ yac_instance_get_couple_config()

struct yac_couple_config * yac_instance_get_couple_config ( struct yac_instance * instance)

Get the coupling configuration data from a YAC instance

Parameters
[in]instanceYAC instance
Returns
coupling configuration data

Definition at line 1542 of file instance.c.

Here is the caller graph for this function:

◆ yac_instance_get_end_datetime()

char * yac_instance_get_end_datetime ( struct yac_instance * instance)

query routine for the end datetime of the job

Parameters
[in]instanceYAC instance
Returns
end datetime

Definition at line 1598 of file instance.c.

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

◆ yac_instance_get_field()

struct coupling_field * yac_instance_get_field ( struct yac_instance * instance,
const char * comp_name,
const char * grid_name,
const char * field_name )

Definition at line 1755 of file instance.c.

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

◆ yac_instance_get_nbr_comps()

int yac_instance_get_nbr_comps ( struct yac_instance * instance)

Definition at line 1440 of file instance.c.

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

◆ yac_instance_get_start_datetime()

char * yac_instance_get_start_datetime ( struct yac_instance * instance)

query routine for the start datetime of the job

Parameters
[in]instanceYAC instance
Returns
start datetime

Definition at line 1593 of file instance.c.

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

◆ yac_instance_new()

struct yac_instance * yac_instance_new ( MPI_Comm comm)

Constructor for a YAC instance.

Parameters
[in]commMPI communicator that contains the processes of all components that will be registered with this YAC instance
Returns
YAC instance
Remarks
This is collectiv for all processes in comm.

Definition at line 1465 of file instance.c.

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

◆ yac_instance_set_couple_config()

void yac_instance_set_couple_config ( struct yac_instance * instance,
struct yac_couple_config * couple_config )

Sets the coupling configuration data for a YAC instance

Parameters
[in]instanceYAC instance
[in]couple_configcoupling configuration data

Definition at line 1548 of file instance.c.

Here is the call graph for this function:

◆ yac_instance_setup()

void yac_instance_setup ( struct yac_instance * instance,
struct yac_basic_grid ** grids,
size_t num_grids )

initiates the generation of all data structures required for interpolation

Parameters
[in]instanceYAC instance
[in]gridsall locally available basic grids
[in]num_gridsnumber of locally available basic grids

Definition at line 1369 of file instance.c.

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

◆ yac_instance_setup_and_emit_config()

char * yac_instance_setup_and_emit_config ( struct yac_instance * instance,
struct yac_basic_grid ** grids,
size_t num_grids,
int emit_flags )

initiates the generation of all data structures required for interpolation

Parameters
[in]instanceYAC instance
[in]gridsall locally available basic grids
[in]num_gridsnumber of locally available basic grids
[in]emit_flagsflags for configuring the generated coupling configuration output (YAC_YAML_EMITTER_DEFAULT or YAC_YAML_EMITTER_JSON)
Returns
string containing coupling configuration

Definition at line 1419 of file instance.c.

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

◆ yac_instance_sync_def()

void yac_instance_sync_def ( struct yac_instance * instance)

synchronizes the grid and field definitions

Parameters
[in]instanceYAC instance

Definition at line 1336 of file instance.c.

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

◆ yac_instance_sync_def_comps()

void yac_instance_sync_def_comps ( struct yac_instance * instance,
char const ** comp_names,
size_t num_comp_names )

synchronizes the grid and field definitions for provided components

Parameters
[in]instanceYAC instance
[in]comp_namescomponent names
[in]num_comp_namesnumber of entries in comp_names
Remarks
The local process should have defined at least one of the components listed in comp_names.
This operation operation is collective for all processes in the provided instance that defined at least one component in comp_names.

Definition at line 1348 of file instance.c.

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

Variable Documentation

◆ empty_event_data

struct field_config_event_data empty_event_data
static
Initial value:
=
{.timestep = NULL,
.coupling_period = NULL,
.timelag = 0,
.reduction_operation = TIME_NONE,
.start_datetime = NULL,
.end_datetime = NULL}
@ TIME_NONE

◆ yac_instance_phase_str

const char* yac_instance_phase_str[]
static
Initial value:
=
{"definition phase",
"definition phase (after component definition)",
"definition phase (after synchronisation)",
"exchange phase",
"unknown phase"}

Definition at line 48 of file instance.c.