YAC 3.21.0
Yet Another Coupler
Loading...
Searching...
No Matches
test_yac_pak_mci.c
Go to the documentation of this file.
1// Copyright (c) 2026 The YAC Authors
2//
3// SPDX-License-Identifier: BSD-3-Clause
4
5#include <stdlib.h>
6#include <stdio.h>
7#include <string.h>
8#include <unistd.h>
9#include <mpi.h>
10#include "io_utils.h"
11
12#include "tests.h"
13#include "yac.h"
14#include "test_yac_pak_common.h"
15
39#define YAC_RAD (0.01745329251994329576923690768489)
40#define SETUP_REGION_NAME "distributed grid pair generation"
41
42#define UTEST_COL_FIELD 1
43#define UTEST_COL_TYPE 4
44#define UTEST_COL_DATETIME 6
45#define UTEST_COL_TSTART 8
46#define UTEST_COL_TEND 9
47
48static char const * utest_csv_column(char const *line, int idx) {
49 char const *p = line;
50 for (int i = 0; i < idx; i++) {
51 while (*p && *p != '\t') p++;
52 if (*p != '\t') return NULL;
53 p++;
54 }
55 return p;
56}
57
58static int utest_csv_lookup(
59 char const *path, int key_idx, char const *key,
60 int out_idx, char *buf, size_t buf_size) {
61
62 FILE *f = fopen(path, "r");
63 if (!f) return -1;
64
65 size_t const klen = strlen(key);
66 int header_seen = 0;
67 int found = 0;
68 char line[2048];
69
70 while (!found && fgets(line, sizeof(line), f)) {
71 if (line[0] == '#' || line[0] == '\n' || line[0] == '\r') continue;
72 if (!header_seen) { header_seen = 1; continue; }
73
74 char const *k = utest_csv_column(line, key_idx);
75 if (!k || strncmp(k, key, klen) || (k[klen] != '\t')) continue;
76 found = 1;
77
78 if (buf == NULL) continue;
79 char const *out = utest_csv_column(line, out_idx);
80 size_t n = 0;
81 while (out && out[n] && (out[n] != '\t') && (n + 1 < buf_size)) n++;
82 if (out) memcpy(buf, out, n);
83 buf[n] = '\0';
84 }
85 fclose(f);
86 return found;
87}
88
89static int utest_csv_has_type(char const *path, char const *type) {
90 return utest_csv_lookup(path, UTEST_COL_TYPE, type, 0, NULL, 0);
91}
92
93static int utest_csv_has_field(char const *path, char const *field) {
94 return utest_csv_lookup(path, UTEST_COL_FIELD, field, 0, NULL, 0);
95}
96
97/* Checks that a REGION event lies within the interval of the WAIT event. */
98static int utest_csv_region_within_wait(char const *path) {
99
100 char wait_start[64], wait_end[64], region_start[64], region_end[64];
101 if ((utest_csv_lookup(path, UTEST_COL_TYPE, "WAIT", UTEST_COL_TSTART,
102 wait_start, sizeof(wait_start)) != 1) ||
103 (utest_csv_lookup(path, UTEST_COL_TYPE, "WAIT", UTEST_COL_TEND,
104 wait_end, sizeof(wait_end)) != 1) ||
105 (utest_csv_lookup(path, UTEST_COL_TYPE, "REGION", UTEST_COL_TSTART,
106 region_start, sizeof(region_start)) != 1) ||
107 (utest_csv_lookup(path, UTEST_COL_TYPE, "REGION", UTEST_COL_TEND,
108 region_end, sizeof(region_end)) != 1)) return 0;
109
110 return (atof(region_start) >= atof(wait_start)) &&
111 (atof(region_end) <= atof(wait_end));
112}
113
114/* Checks that the WAIT carries the datetime of the exchange it completes,
115 * rather than the step the field's clock has since moved on to. */
116static int utest_csv_wait_datetime_matches(
117 char const *path, char const *exchange_type) {
118
119 char exchange_dt[64], wait_dt[64];
120 if (utest_csv_lookup(
121 path, UTEST_COL_TYPE, exchange_type, UTEST_COL_DATETIME,
122 exchange_dt, sizeof(exchange_dt)) != 1) return 0;
123 if (utest_csv_lookup(
124 path, UTEST_COL_TYPE, "WAIT", UTEST_COL_DATETIME,
125 wait_dt, sizeof(wait_dt)) != 1) return 0;
126 return (exchange_dt[0] != '\0') && !strcmp(exchange_dt, wait_dt);
127}
128
129static void utest_check_types_present(char const *path,
130 char const * const *types, int n) {
131 if (!yac_file_exists(path)) { PUT_ERR(" FAIL: trace file not found"); return; }
132 for (int i = 0; i < n; i++)
133 if (utest_csv_has_type(path, types[i]) != 1)
134 PUT_ERR(" FAIL: expected type missing in trace file");
135}
136
137static void utest_check_types_absent(char const *path,
138 char const * const *types, int n) {
139 for (int i = 0; i < n; i++)
140 if (utest_csv_has_type(path, types[i]) == 1)
141 PUT_ERR(" FAIL: unexpected type found in trace file (SETUP off)");
142}
143
144static void utest_run_coupling_round(int rank, int use_instance_api) {
145 int const is_src = (rank == 0);
146 char const *comp_name = is_src ? "atm" : "ocn";
147 char const *grid_name = is_src ? "atm_grid" : "ocn_grid";
148
149 int yac_id = -1;
150 if (use_instance_api) {
151 yac_cinit_comm_instance(MPI_COMM_WORLD, &yac_id);
154 yac_id, "2000-01-01T00:00:00", "2000-01-01T01:00:00");
155 } else {
156 yac_cinit();
158 yac_cdef_datetime("2000-01-01T00:00:00", "2000-01-01T01:00:00");
159 }
160
161 int comp_id;
162 if (use_instance_api)
163 yac_cdef_comp_instance(yac_id, comp_name, &comp_id);
164 else
165 yac_cdef_comp(comp_name, &comp_id);
166
167 int grid_id;
169 grid_name, (int[2]){3, 3}, (int[2]){0, 0},
170 (double[]){0 * YAC_RAD, 1 * YAC_RAD, 2 * YAC_RAD},
171 (double[]){0 * YAC_RAD, 1 * YAC_RAD, 2 * YAC_RAD},
172 &grid_id);
173
174 int point_id;
176 grid_id, (int[2]){3, 3}, YAC_LOCATION_CORNER,
177 (double[]){0 * YAC_RAD, 1 * YAC_RAD, 2 * YAC_RAD},
178 (double[]){0 * YAC_RAD, 1 * YAC_RAD, 2 * YAC_RAD},
179 &point_id);
180
181 int field_id;
183 "heat_flux", comp_id, &point_id, 1, 1,
185
186 int interp;
188 yac_cadd_interp_stack_config_nnn(interp, YAC_NNN_AVG, 1, 0.0, 0.0);
189
190 if (use_instance_api)
192 yac_id,
193 "atm", "atm_grid", "heat_flux",
194 "ocn", "ocn_grid", "heat_flux",
196 interp, 0, 0);
197 else
199 "atm", "atm_grid", "heat_flux",
200 "ocn", "ocn_grid", "heat_flux",
202 interp, 0, 0);
203
205
206 if (use_instance_api) {
208 yac_cenddef_instance(yac_id);
209 } else {
211 yac_cenddef();
212 }
213
214 double pts[9] = {0};
215 int info, ierr;
216 if (is_src) {
217 double *ps[1] = {pts};
218 double **pss[1] = {ps};
219 yac_cput(field_id, 1, pss, &info, &ierr);
221 if (ierr) INC_ERR;
222 } else {
223 double *prr[1] = {pts};
224 yac_cget(field_id, 1, prr, &info, &ierr);
226 if (ierr) INC_ERR;
227 }
228
229 if (use_instance_api)
231 else
233}
234
235/* Test 1: Setup and coupling events via the explicit instance API. */
236static void utest_trace_content(int rank) {
237 setenv("YAC_PAK_TRACE", "1", 1);
238 setenv("YAC_PAK_TRACE_LEVEL", "1", 1);
239 setenv("YAC_PAK_TRACE_SETUP", "1", 1);
240 setenv("YAC_PAK_TRACE_DIR", "mci_content_traces", 1);
241
242 if (yac_file_exists("mci_content_traces") && (rank == 0))
243 yac_remove_directory("mci_content_traces");
244 MPI_Barrier(MPI_COMM_WORLD);
245
246 utest_run_coupling_round(rank, 1);
247
248 MPI_Barrier(MPI_COMM_WORLD);
249
250 if (rank == 0) {
251 char const * const p0_types[] =
252 {"INIT", "DEF_COMP", "SYNC_DEF", "ENDDEF", "PUT", "FINALIZE"};
253 char const * const p1_types[] =
254 {"INIT", "DEF_COMP", "SYNC_DEF", "ENDDEF", "GET", "FINALIZE"};
255 utest_check_types_present("mci_content_traces/atm_r0.csv", p0_types, 6);
256 utest_check_types_present("mci_content_traces/ocn_r1.csv", p1_types, 6);
257 yac_remove_directory("mci_content_traces");
258 }
259
260 utest_clear_trace_env();
261}
262
263/* Test 2: YAC_PAK_TRACE_SETUP not set, only coupling events (PUT/GET) appear. */
264static void utest_coupling_only(int rank) {
265 setenv("YAC_PAK_TRACE", "1", 1);
266 setenv("YAC_PAK_TRACE_LEVEL", "1", 1);
267 setenv("YAC_PAK_TRACE_DIR", "mci_coupling_only_traces", 1);
268
269 if (yac_file_exists("mci_coupling_only_traces") && (rank == 0))
270 yac_remove_directory("mci_coupling_only_traces");
271 MPI_Barrier(MPI_COMM_WORLD);
272
273 utest_run_coupling_round(rank, 0);
274
275 MPI_Barrier(MPI_COMM_WORLD);
276
277 if (rank == 0) {
278 char const * const setup_types[] =
279 {"INIT", "DEF_COMP", "ENDDEF", "SYNC_DEF", "FINALIZE"};
280 char const * const req_atm[] = {"PUT"};
281 char const * const req_ocn[] = {"GET"};
282 utest_check_types_present("mci_coupling_only_traces/atm_r0.csv", req_atm, 1);
283 utest_check_types_absent("mci_coupling_only_traces/atm_r0.csv", setup_types, 5);
284 utest_check_types_present("mci_coupling_only_traces/ocn_r1.csv", req_ocn, 1);
285 utest_check_types_absent("mci_coupling_only_traces/ocn_r1.csv", setup_types, 5);
286 yac_remove_directory("mci_coupling_only_traces");
287 }
288
289 utest_clear_trace_env();
290}
291
292/* Test 3: YAC_PAK_TRACE_LEVEL=2, tests a nested REGION inside the
293 * coupling. */
294static void utest_interp_trace_level2(int rank) {
295 setenv("YAC_PAK_TRACE", "1", 1);
296 setenv("YAC_PAK_TRACE_LEVEL", "2", 1);
297 setenv("YAC_PAK_TRACE_DIR", "mci_interp_trace_traces", 1);
298
299 if (yac_file_exists("mci_interp_trace_traces") && (rank == 0))
300 yac_remove_directory("mci_interp_trace_traces");
301 MPI_Barrier(MPI_COMM_WORLD);
302
303 utest_run_coupling_round(rank, 1);
304
305 MPI_Barrier(MPI_COMM_WORLD);
306
307 if (rank == 0) {
308 char const *atm_path = "mci_interp_trace_traces/atm_r0.csv";
309 char const *ocn_path = "mci_interp_trace_traces/ocn_r1.csv";
310
311 char const * const atm_types[] = {"PUT"};
312 char const * const ocn_types[] = {"GET"};
313 utest_check_types_present(atm_path, atm_types, 1);
314 utest_check_types_present(ocn_path, ocn_types, 1);
315
316 if (utest_csv_has_type(atm_path, "REGION") != 1 &&
317 utest_csv_has_type(ocn_path, "REGION") != 1)
318 PUT_ERR(" FAIL: level-2: no REGION event recorded on either side");
319
320 if (utest_csv_has_field(atm_path, SETUP_REGION_NAME) == 1 ||
321 utest_csv_has_field(ocn_path, SETUP_REGION_NAME) == 1)
322 PUT_ERR(" FAIL: level-2: setup region recorded without YAC_PAK_TRACE_SETUP");
323
324 yac_remove_directory("mci_interp_trace_traces");
325 }
326
327 utest_clear_trace_env();
328}
329
330/* Test 4: Test setup-phase region gating. */
331static void utest_setup_regions_gating(int rank) {
332 /* Case A: SETUP=1, LEVEL=1 -> lifecycle events only, no REGION events */
333 setenv("YAC_PAK_TRACE", "1", 1);
334 setenv("YAC_PAK_TRACE_LEVEL", "1", 1);
335 setenv("YAC_PAK_TRACE_SETUP", "1", 1);
336 setenv("YAC_PAK_TRACE_DIR", "mci_setup_lvl1_traces", 1);
337
338 if (yac_file_exists("mci_setup_lvl1_traces") && (rank == 0))
339 yac_remove_directory("mci_setup_lvl1_traces");
340 MPI_Barrier(MPI_COMM_WORLD);
341
342 utest_run_coupling_round(rank, 1);
343
344 MPI_Barrier(MPI_COMM_WORLD);
345
346 if (rank == 0) {
347 char const *path = "mci_setup_lvl1_traces/atm_r0.csv";
348 char const * const lifecycle[] = {"ENDDEF"};
349 utest_check_types_present(path, lifecycle, 1);
350 if (utest_csv_has_type(path, "REGION") == 1)
351 PUT_ERR(" FAIL: setup regions recorded with LEVEL=1 (should need LEVEL=2)");
352 yac_remove_directory("mci_setup_lvl1_traces");
353 }
354
355 utest_clear_trace_env();
356
357 /* Case B: SETUP=1, LEVEL=2 -> setup-phase REGION events additionally recorded */
358 setenv("YAC_PAK_TRACE", "1", 1);
359 setenv("YAC_PAK_TRACE_LEVEL", "2", 1);
360 setenv("YAC_PAK_TRACE_SETUP", "1", 1);
361 setenv("YAC_PAK_TRACE_DIR", "mci_setup_lvl2_traces", 1);
362
363 if (yac_file_exists("mci_setup_lvl2_traces") && (rank == 0))
364 yac_remove_directory("mci_setup_lvl2_traces");
365 MPI_Barrier(MPI_COMM_WORLD);
366
367 utest_run_coupling_round(rank, 1);
368
369 MPI_Barrier(MPI_COMM_WORLD);
370
371 if (rank == 0) {
372 char const *path = "mci_setup_lvl2_traces/atm_r0.csv";
373 char const * const types[] = {"ENDDEF", "REGION"};
374 utest_check_types_present(path, types, 2);
375 if (utest_csv_has_field(path, SETUP_REGION_NAME) != 1)
376 PUT_ERR(" FAIL: setup_lvl2: setup region '" SETUP_REGION_NAME "' missing");
377 yac_remove_directory("mci_setup_lvl2_traces");
378 }
379
380 utest_clear_trace_env();
381}
382
383/* Test 5: YAC_PAK_TRACE_AUTOFLUSH=0, flush suppressed */
384static void utest_autoflush_off(int rank) {
385 setenv("YAC_PAK_TRACE", "1", 1);
386 setenv("YAC_PAK_TRACE_LEVEL", "1", 1);
387 setenv("YAC_PAK_TRACE_DIR", "mci_noflush_traces", 1);
388 setenv("YAC_PAK_TRACE_AUTOFLUSH", "0", 1);
389
390 if (yac_file_exists("mci_noflush_traces") && (rank == 0))
391 yac_remove_directory("mci_noflush_traces");
392 MPI_Barrier(MPI_COMM_WORLD);
393
394 utest_run_coupling_round(rank, 0);
395
396 MPI_Barrier(MPI_COMM_WORLD);
397
398 if (rank == 0) {
399 if (yac_file_exists("mci_noflush_traces/atm_r0.csv"))
400 PUT_ERR(" FAIL: autoflush=0: atm_r0.csv exists (should not)");
401 if (yac_file_exists("mci_noflush_traces/ocn_r1.csv"))
402 PUT_ERR(" FAIL: autoflush=0: ocn_r1.csv exists (should not)");
403 yac_remove_directory("mci_noflush_traces");
404 }
405
406 utest_clear_trace_env();
407}
408
409/* Test 6: YAC_PAK_TRACE_CONFIG=1: coupling_config.yaml is written. */
410static void utest_config_output(int rank) {
411 setenv("YAC_PAK_TRACE", "1", 1);
412 setenv("YAC_PAK_TRACE_LEVEL", "1", 1);
413 setenv("YAC_PAK_TRACE_DIR", "mci_config_traces", 1);
414 setenv("YAC_PAK_TRACE_CONFIG","1", 1);
415
416 if (yac_file_exists("mci_config_traces") && (rank == 0))
417 yac_remove_directory("mci_config_traces");
418 MPI_Barrier(MPI_COMM_WORLD);
419
420 utest_run_coupling_round(rank, 1);
421
422 MPI_Barrier(MPI_COMM_WORLD);
423
424 if (rank == 0) {
425 if (!yac_file_exists("mci_config_traces/coupling_config.yaml"))
426 PUT_ERR(" FAIL: coupling_config.yaml not written");
427 if (!yac_file_contains("mci_config_traces/coupling_config.yaml", "heat_flux"))
428 PUT_ERR(" FAIL: coupling_config.yaml missing field name 'heat_flux'");
429 if (!yac_file_contains("mci_config_traces/coupling_config.yaml", "atm"))
430 PUT_ERR(" FAIL: coupling_config.yaml missing component 'atm'");
431 yac_remove_directory("mci_config_traces");
432 }
433
434 utest_clear_trace_env();
435}
436
437/* Test 7: No YAC_PAK_TRACE_CONFIG: coupling_config.yaml is not written. */
438static void utest_config_output_disabled(int rank) {
439 setenv("YAC_PAK_TRACE", "1", 1);
440 setenv("YAC_PAK_TRACE_LEVEL", "1", 1);
441 setenv("YAC_PAK_TRACE_DIR", "mci_noconfig_traces", 1);
442 unsetenv("YAC_PAK_TRACE_CONFIG");
443
444 if (yac_file_exists("mci_noconfig_traces") && (rank == 0))
445 yac_remove_directory("mci_noconfig_traces");
446 MPI_Barrier(MPI_COMM_WORLD);
447
448 utest_run_coupling_round(rank, 1);
449
450 MPI_Barrier(MPI_COMM_WORLD);
451
452 if (rank == 0) {
453 if (yac_file_exists("mci_noconfig_traces/coupling_config.yaml"))
454 PUT_ERR(" FAIL: coupling_config.yaml written without YAC_PAK_TRACE_CONFIG");
455 yac_remove_directory("mci_noconfig_traces");
456 }
457
458 utest_clear_trace_env();
459}
460
461/* Coupling round for the asynchronous case: the source field steps with the
462 * coupling, the target field twice as often, so that the target's second step
463 * has action NONE and can be advanced with yac_cupdate. The target receives
464 * with yac_cget_async, both sides complete with yac_cwait. */
465static void utest_run_async_round(int rank, int map_on_tgt) {
466 int const is_src = (rank == 0);
467 char const *comp_name = is_src ? "atm" : "ocn";
468 char const *grid_name = is_src ? "atm_grid" : "ocn_grid";
469
470 yac_cinit();
472 yac_cdef_datetime("2000-01-01T00:00:00", "2000-01-01T00:00:10");
473
474 int comp_id;
475 yac_cdef_comp(comp_name, &comp_id);
476
477 int grid_id;
479 grid_name, (int[2]){3, 3}, (int[2]){0, 0},
480 (double[]){0 * YAC_RAD, 1 * YAC_RAD, 2 * YAC_RAD},
481 (double[]){0 * YAC_RAD, 1 * YAC_RAD, 2 * YAC_RAD},
482 &grid_id);
483
484 int point_id;
486 grid_id, (int[2]){3, 3}, YAC_LOCATION_CORNER,
487 (double[]){0 * YAC_RAD, 1 * YAC_RAD, 2 * YAC_RAD},
488 (double[]){0 * YAC_RAD, 1 * YAC_RAD, 2 * YAC_RAD},
489 &point_id);
490
491 int field_id;
493 "heat_flux", comp_id, &point_id, 1, 1,
494 is_src ? "2" : "1", YAC_TIME_UNIT_SECOND, &field_id);
495
496 int interp;
498
500 interp, YAC_NNN_AVG, map_on_tgt ? 2 : 1, 0.0, 0.0);
501
502 if (map_on_tgt) {
503 int ext_couple_config;
504 yac_cget_ext_couple_config(&ext_couple_config);
505 yac_cset_ext_couple_config_mapping_side(ext_couple_config, 0);
507 "atm", "atm_grid", "heat_flux",
508 "ocn", "ocn_grid", "heat_flux",
510 interp, 0, 0, ext_couple_config);
511 yac_cfree_ext_couple_config(ext_couple_config);
512 } else {
514 "atm", "atm_grid", "heat_flux",
515 "ocn", "ocn_grid", "heat_flux",
517 interp, 0, 0);
518 }
519
521
523 yac_cenddef();
524
525 double pts[9] = {0};
526 int info, ierr;
527 if (is_src) {
528 double *ps[1] = {pts};
529 double **pss[1] = {ps};
530 yac_cput(field_id, 1, pss, &info, &ierr);
532 if (ierr) INC_ERR;
534 } else {
535 double *prr[1] = {pts};
536 yac_cget_async(field_id, 1, prr, &info, &ierr);
538 if (ierr) INC_ERR;
543 }
544
546}
547
548/* Test 8: UPDATE, AGET and WAIT are recorded at level 1, alongside PUT/GET. */
549static void utest_update_wait(int rank) {
550 setenv("YAC_PAK_TRACE", "1", 1);
551 setenv("YAC_PAK_TRACE_LEVEL", "1", 1);
552 setenv("YAC_PAK_TRACE_DIR", "mci_update_wait_traces", 1);
553
554 if (yac_file_exists("mci_update_wait_traces") && (rank == 0))
555 yac_remove_directory("mci_update_wait_traces");
556 MPI_Barrier(MPI_COMM_WORLD);
557
558 utest_run_async_round(rank, 0);
559
560 MPI_Barrier(MPI_COMM_WORLD);
561
562 if (rank == 0) {
563 char const * const req_atm[] = {"PUT", "WAIT"};
564 char const * const req_ocn[] = {"AGET", "WAIT", "UPDATE"};
565 char const * const abs_atm[] = {"UPDATE"};
566 char const * const abs_ocn[] = {"GET"};
567 utest_check_types_present(
568 "mci_update_wait_traces/atm_r0.csv", req_atm, 2);
569 utest_check_types_present(
570 "mci_update_wait_traces/ocn_r1.csv", req_ocn, 3);
571 utest_check_types_absent(
572 "mci_update_wait_traces/atm_r0.csv", abs_atm, 1);
573 utest_check_types_absent(
574 "mci_update_wait_traces/ocn_r1.csv", abs_ocn, 1);
575 if (utest_csv_wait_datetime_matches(
576 "mci_update_wait_traces/ocn_r1.csv", "AGET") != 1)
577 PUT_ERR(" FAIL: WAIT datetime does not match the AGET it completes");
578 yac_remove_directory("mci_update_wait_traces");
579 }
580
581 utest_clear_trace_env();
582}
583
584/* Test 9: Mapping on target. */
585static void utest_wait_region(int rank) {
586 setenv("YAC_PAK_TRACE", "1", 1);
587 setenv("YAC_PAK_TRACE_LEVEL", "2", 1);
588 setenv("YAC_PAK_TRACE_DIR", "mci_wait_region_traces", 1);
589
590 if (yac_file_exists("mci_wait_region_traces") && (rank == 0))
591 yac_remove_directory("mci_wait_region_traces");
592 MPI_Barrier(MPI_COMM_WORLD);
593
594 utest_run_async_round(rank, 1);
595
596 MPI_Barrier(MPI_COMM_WORLD);
597
598 if (rank == 0) {
599 char const *ocn_path = "mci_wait_region_traces/ocn_r1.csv";
600 char const * const req_ocn[] = {"AGET", "WAIT", "REGION"};
601 utest_check_types_present(ocn_path, req_ocn, 3);
602 if (utest_csv_region_within_wait(ocn_path) != 1)
603 PUT_ERR(" FAIL: no REGION recorded inside the WAIT");
604 yac_remove_directory("mci_wait_region_traces");
605 }
606
607 utest_clear_trace_env();
608}
609
610int main(void) {
611 MPI_Init(NULL, NULL);
612
613 int rank, size;
614 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
615 MPI_Comm_size(MPI_COMM_WORLD, &size);
616
617 if (size != 2) {
618 fputs("wrong number of processes (must be 2)\n", stderr);
619 MPI_Finalize();
620 return EXIT_FAILURE;
621 }
622
623 utest_trace_content(rank);
624 utest_coupling_only(rank);
625 utest_interp_trace_level2(rank);
626 utest_setup_regions_gating(rank);
627 utest_autoflush_off(rank);
628 utest_config_output(rank);
629 utest_config_output_disabled(rank);
630 utest_update_wait(rank);
631 utest_wait_region(rank);
632
633 MPI_Finalize();
634 return TEST_EXIT_CODE;
635}
char * key
enum callback_type type
void yac_remove_directory(char const *path)
Remove a directory and its contents recursively.
Definition io_utils.c:500
int yac_file_contains(char const *path, char const *needle)
Check whether a file contains a specific string.
Definition io_utils.c:399
int yac_file_exists(const char *filename)
Check whether a file exists.
Definition io_utils.c:394
int point_id
#define UTEST_COL_DATETIME
#define UTEST_COL_TEND
#define UTEST_COL_TSTART
#define UTEST_COL_TYPE
#define SETUP_REGION_NAME
#define YAC_RAD
#define UTEST_COL_FIELD
#define TEST_EXIT_CODE
Definition tests.h:15
#define INC_ERR
Definition tests.h:13
#define PUT_ERR(string)
Definition tests.h:10
int info
int grid_id
int * field_id
int comp_id
double(* p)(double lon, double lat)
Definition toy_scrip.c:119
void yac_cenddef(void)
Definition yac.c:5006
void yac_cdef_datetime_instance(int yac_instance_id, const char *start_datetime, const char *end_datetime)
Definition of job start and end datetime.
Definition yac.c:1019
void yac_cfree_ext_couple_config(int ext_couple_config_id)
Definition yac.c:2100
void yac_cdef_datetime(const char *start_datetime, const char *end_datetime)
Definition of job start and end datetime for the default YAC instance.
Definition yac.c:1028
void yac_csync_def_instance(int yac_instance_id)
Definition yac.c:4918
void yac_csync_def(void)
Definition yac.c:4923
void yac_cinit(void)
Definition yac.c:737
void yac_cfinalize_instance(int yac_instance_id)
Finalises YAC.
Definition yac.c:998
void yac_cfinalize()
Finalises YAC.
Definition yac.c:1007
void yac_cenddef_instance(int yac_instance_id)
Definition yac.c:4984
void yac_cget_ext_couple_config(int *ext_couple_config_id)
Definition yac.c:2079
int const YAC_LOCATION_CORNER
Definition yac.c:39
void yac_cdef_couple_custom(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_timestep, int time_unit, int time_reduction, int interp_stack_config_id, int src_lag, int tgt_lag, int ext_couple_config_id)
Definition yac.c:2443
void yac_cget(int const field_id, int collection_size, double **recv_field, int *info, int *ierr)
Definition yac.c:3298
void yac_cdef_comp_instance(int yac_instance_id, char const *comp_name, int *comp_id)
Definition yac.c:1339
void yac_cupdate(int field_id)
Definition yac.c:2962
void yac_cget_action(int field_id, int *action)
Definition yac.c:2893
void yac_cdef_grid_reg2d(const char *grid_name, int nbr_vertices[2], int cyclic[2], double *x_vertices, double *y_vertices, int *grid_id)
Definition yac.c:5511
void yac_cdef_points_reg2d(int const grid_id, int const *nbr_points, int const located, double const *x_points, double const *y_points, int *point_id)
Definition yac.c:1540
void yac_cinit_comm_instance(MPI_Comm comm, int *yac_instance_id)
Definition yac.c:700
int const YAC_TIME_UNIT_SECOND
Definition yac.c:64
void yac_cput(int const field_id, int const collection_size, double ***const send_field, int *info, int *ierr)
Definition yac.c:4271
void yac_cget_async(int const field_id, int collection_size, double **recv_field, int *info, int *ierr)
Definition yac.c:3307
int const YAC_ACTION_NONE
no data exchanges
Definition yac.c:47
void yac_cdef_calendar(int calendar)
Definition yac.c:1036
void yac_cwait(int field_id)
Definition yac.c:3773
int const YAC_PROLEPTIC_GREGORIAN
Definition yac.c:73
int const YAC_ACTION_COUPLING
data exchange
Definition yac.c:49
void yac_cset_ext_couple_config_mapping_side(int ext_couple_config_id, int mapping_side)
Definition yac.c:2171
void yac_cfree_interp_stack_config(int interp_stack_config_id)
Definition yac.c:5834
int const YAC_NNN_AVG
Definition yac.c:84
void yac_cadd_interp_stack_config_nnn(int interp_stack_config_id, int type, size_t n, double max_search_distance, double scale)
Definition yac.c:5890
void yac_cget_interp_stack_config(int *interp_stack_config_id)
Definition yac.c:5818
void yac_cdef_comp(char const *comp_name, int *comp_id)
Definition yac.c:1345
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)
Definition yac.c:1929
void yac_cdef_couple_instance(int yac_instance_id, 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_timestep, int time_unit, int time_reduction, int interp_stack_config_id, int src_lag, int tgt_lag)
Definition yac.c:2458
void yac_cdef_couple(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_timestep, int time_unit, int time_reduction, int interp_stack_config_id, int src_lag, int tgt_lag)
Definition yac.c:2475
int const YAC_REDUCTION_TIME_NONE
Definition yac.c:57