Coupled dummy IO process in C.
#include <mpi.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#define NBR_CELLS 2
#define NBR_VERTICES 4
#define YAC_RAD (0.01745329251994329576923690768489)
#define STR_USAGE "Usage: %s -c configFilename\n"
#define YAC_ASSERT_ARGS(exp, msg) \
{ \
if(!((exp))) { \
fprintf(stderr, "ERROR: %s\n" STR_USAGE, msg, argv[0]); \
exit(EXIT_FAILURE); \
} \
}
int argc, char ** argv, char const ** configFilename);
int main (int argc, char *argv[]) {
"atmos_out2",
"atmos_out3",
"atmos_out4",
"ocean_out1",
"ocean_out2",
"ocean_out3",
"ocean_out4"};
char * comp_name = "dummy_io";
char * grid_name[] = { "ocean_grid",
"atmos_grid"};
int grid_ids[2];
MPI_Comm local_comm;
MPI_Init (0, NULL);
char const * configFilename = "toy_dummy.yaml";
MPI_Comm_rank ( local_comm, &rank );
MPI_Comm_size ( local_comm, &size );
printf (" %s rank %d : local size %d \n", comp_name, rank, size );
for ( int igrid = 0; igrid < 2; igrid++ ) {
nbr_vertices,
nbr_cells,
&grid_ids[igrid] );
for (
int i = 0;
i < nbr_cells; ++
i ) {
}
nbr_cells,
for ( i = 0;
i < nbr_cells; ++
i )
}
MPI_Finalize ();
return 0;
}
int argc, char ** argv, char const ** configFilename) {
int opt;
while ((opt = getopt(argc, argv, "c:")) != -1) {
switch (opt) {
default:
case 'c':
*configFilename = optarg;
break;
}
}
}
int nbr_vertices_per_cell[NBR_CELLS]
static void parse_arguments(int argc, char **argv, enum experiment_type *experiment)
#define YAC_ASSERT_ARGS(exp, msg)
void yac_cset_global_index(int const *global_index, int location, int grid_id)
int const YAC_LOCATION_CELL
void yac_cfinalize()
Finalises YAC.
void yac_cget_comp_comm(int comp_id, MPI_Comm *comp_comm)
int const YAC_TIME_UNIT_SECOND
void yac_cdef_grid_unstruct(const char *grid_name, int nbr_vertices, int nbr_cells, int *num_vertices_per_cell, double *x_vertices, double *y_vertices, int *cell_to_vertex, int *grid_id)
void yac_cdef_points_unstruct(int const grid_id, int const nbr_points, int const located, double const *x_points, double const *y_points, int *point_id)
char * yac_cget_version(void)
void yac_cread_config_yaml(const char *yaml_filename)
void yac_cset_core_mask(int const *is_core, int location, int grid_id)
void yac_cset_mask(int const *is_valid, int points_id)
void yac_cdef_comp(char const *comp_name, int *comp_id)
void yac_cdef_field(char const *name, int const comp_id, int const *point_ids, int const num_pointsets, int collection_size, const char *timestep, int time_unit, int *field_id)