YAC 3.18.0
Yet Another Coupler
Loading...
Searching...
No Matches
Known Issues and FAQ

This page documents known issues, their solutions and frequently asked questions

Building YAC

Missing Python packages

Problem:

If you are trying to build YAC with the Python bindings (--enable-python-bindings) you may come across one of the following errors:

...
checking for python... python3
checking for Python.h... yes
checking whether Python module 'setuptools' is available... no
configure: error: in `/home/k/k202215/Programming/YAC-dev/build_yac_i273':
configure: error: Python module 'setuptools' needed to build the Python bindings is not available
@ error
Definition test_cxc.c:17

or

...
checking for python... python3
checking for Python.h... yes
checking whether Python module 'setuptools' is available... yes
checking whether Python module 'cython>=3.0.0' is available... no
configure: error: in `/home/k/k202215/Programming/YAC-dev/build_yac_i273':
configure: error: Python module 'cython>=3.0.0' needed to build the Python bindings is not available

Explanation:

YAC's Python bindings depend on a few Python packages. You can find a complete list of required Python packages that need to be installed on your system in the YAC documentation on the Python bindings.

During configuration YAC checks these dependencies and will raise an error like the ones shown above if a dependency is missing.

Solution:

Install the missing packages. There are several ways to install Python packages, depending on your system.

On Ubuntu, you can install packages system-wide with apt (e.g., apt install python3-setuptools).

On HPC systems, system-wide installation is usually not possible because of limited access rights. DKRZ provides a detailed guide on using Python on Levante here, including an overview of package installation methods.

A portable approach that works on most systems is to use virtual environments. For details, refer to the documentation of Python's venv package.

Common errors when running YAC

Error message: "missing definition"

Problem:

One of the most common ICON-coupling-related issues occurs when users encounter a failure during ICON initialization with an error message that looks as follows:

0: mo_atmo_coupling_frame: Constructing the coupling frame atmosphere-o3 provider.
0: ERROR: couple defined for field:
0: source (defined):
0: component name: "o3_provider"
0: grid name: "o3_grid"
0: field name: "o3"
0: target(not defined):
0: component name: "atmo"
0: grid name: "icon_atmos_grid"
0: field name: "o3"
0: Fatal error in instance.c, line 427: ERROR(get_field_configuration): missing definition
0: --------------------------------------------------------------------------
0: MPI_ABORT was invoked on rank 0 in communicator MPI_COMM_WORLD
0: with errorcode 1.
0:
0: NOTE: invoking MPI_ABORT causes Open MPI to kill all MPI processes.
0: You may or may not see output from other processes, depending on
0: exactly when Open MPI kills them.
0: --------------------------------------------------------------------------

Explanation:

The cause is that depending on the runscript, the ICON atmosphere component has different names (e.g. atm, atmo, or atmos). If this does not match the component name specified in the coupling configuration file, the error above will be generated.

An alternative cause is that a field mentioned in a couple definition was not defined (via yac_def_field or equivalent) in one of the related components. Ensure that all fields referenced in the coupling configuration are properly defined in both the source and target components before the search phase.

Solution:

Make naming in components and configuration file consistent.

Add missing field definitions in components.

If the missing field definition is expected (e.g. setup is still in development process and not yet complete), this error can be made non-fatal by setting missing_definition_is_fatal to false in the YAML configuration file.

Hint:

To help identify the cause, you can configure YAC to write out its internal coupling configuration to a file using the global_config debug option. Inspecting the generated file (optionally including debug definitions) allows you to verify which components, grids, and fields were actually defined and compare them against the coupling configuration.

Python bindings installation broken

Problem:

The following error can appear if the installation of the Python bindings is broken or you tried to install the Python bindings in an unexpected way:

Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/.../lib/python3.12/site-packages/yac/__init__.py", line 9, in <module>
raise ImportError(
ImportError: This file is intended solely for documentation and should not be imported.
Ensure your Python environment is properly configured.
If you use the PYTHONPATH mechanism, it must point to the build directory of YAC.

You will probably see this error when running YAC in a more complex setup. Generally, it should also be possible to trigger this error by trying to import YAC via

python3 -c "import yac"

Solution: (YAC <= 3.17.0)

Please upgrade to an newer version than 3.17.0.

Workaround: (YAC <= 3.17.0)

If you cannot upgrade to a newer YAC version containing the bugfix the error message should disappear by exporting the PYTHONPATH. If you cloned YAC into the folder $HOME/yac run

export PYTHONPATH=$HOME/yac/build/python

Consider, adding this line to your runscript or .bashrc file.

Refer to Alternative Installation (–enable-python-bindings) for detailed information.

Bit-reproducibility of interpolation results

Problem:

During initialization, YAC computes interpolation weights across all processes by redistributing grids between them. This redistribution depends on the distribution of the original data and the number of processes. Changing either parameter can alter which process computes which weights.

In an MPMD setup, the following factors can cause math functions (e.g. atan) to produce slightly different results across different executables/programs:

  • different compiler or linker flags
  • different math libraries
  • different linking order
  • Python (which uses lazy loading of libraries)

These differences can lead to non-reproducible interpolation results.

Workaround:

When using the Intel compiler, adding -fp-model source to the CFLAGS passed to YAC can help avoid this issue.

Interp method avg (bary) near the pole with Gaussian grid

Problem:

With YAC Version 3.10.0 (Oct 2025) a test case in OASIS3-MCT coupling bggd->nogt fails with the following error message:

Fatal error in /[...]/oasis3-mct/lib/yac/src/core/interp_method_avg.c, line 561: ERROR(compute_weights_bary_no::compute_sb_coords): internal error (could not solve linear 3x3 system)
(vector: (-1.104784e-02; 4.215997e-04; 9.999389e-01)
triangle: ((-2.212209e-02; 0.000000e+00; 9.997553e-01),
(-0.000000e+00; 0.000000e+00; 1.000000e+00),
(-0.000000e+00; 0.000000e+00; 1.000000e+00))

Solution:

Upgrade to Version 3.13.1 (Jan 2026) or newer.

Compiling and linking with YAC

Problem:

When compiling toy models using pkg-config --libs yac and pkg-config --cflags yac, the executables link against NetCDF (which YAC uses). However, pkg-config does not provide rpath to the libraries, requiring users to explicitly set LD_LIBRARY_PATH to run the executables.

Example compilation:

mpicc -o toy_land.exe -O0 -g ../code/src/toy_land.c `pkg-config --libs yac` `pkg-config --cflags yac`

Error meesage:

./toy_land.exe: error while loading shared libraries: libnetcdf.so.19: cannot open shared object file: No such file or directory

Proposed Workarounds:

1. Temporary solution:

Extend your compilation command with:

pkg-config --libs-only-L yac | sed 's/-L/-Wl,-rpath,/g'

2. Best practice recommendation:

If your application depends on NetCDF directly, do not rely on YAC's pkg-config file to provide NetCDF flags. Reasons:

  • NetCDF is an optional dependency of YAC
  • Your application might require a different NetCDF version or installation than YAC uses
  • Linking to NetCDF should be done explicitly to avoid ambiguity
  • If linking to NetCDF explicitly, provide RPATH flags explicitly

Using pkg-config --libs yac already provides -L and -l flags for NetCDF, which can conflict if the user also provides NetCDF library flags for a different installation. This can cause different symptoms depending on static vs. dynamic linking.

Long-term Solution Discussion:

Challenges and a potential implementation for adding RPATH support to yac.pc:

Challenges:

  • Must avoid RPATH flags for system directories (e.g., /usr/lib64) to prevent strange runtime symptoms
  • Ideally should not return RPATHs when linking statically
  • C and Fortran compilers may require different RPATH flag formats (e.g., NAG requires -Wl,-Wl,,-rpath,,/path while GCC needs -Wl,-rpath,/path)

Proposed implementation:

  • Detect correct flag format at configure time based on compiler vendor
  • Test flags when building YAC test programs
  • Introduce custom variables in yac.pc: crpaths and fcrpaths
  • Usage: pkg-config --variable=crpaths yac for C compiler, pkg-config --variable=fcrpaths yac for Fortran compiler
  • If both CC and FC require same format, could add to pkg-config --libs yac output

Recommended current usage:

  • pkg-config --cflags yac guaranteed to work for C compiler
  • Use pkg-config --libs-only-L --libs-only-l yac if you don't want RPATH flags at all
  • For Fortran: use pkg-config --variable=fcflags yac for compilation and pkg-config --libs-only-L --libs-only-l yac combined with pkg-config --variable=fcrpaths yac for linking (once implemented)

Known compiler issues

Compiling YAC with faulty Fortran compiler (incorrect intrinsic is_contiguous)

The error occurs during the ./configure step when testing the Fortran intrinsic is_contiguous(). Many Fortran compilers have faulty implementations of this intrinsic, which YAC uses to verify that arrays provided by the user to the Fortran interface can be passed to C. This is critical for YAC because it needs to pass data from Fortran to C (YAC is written in C).

Configure error message:

configure:5697: error: in `[..]/yac':
configure:5699: error: [..]/OpenMPI/4.1.1-GCC-10.3.0/bin/mpif90 cannot properly detect non-contiguous data

Known affected compilers:

  • AMD Optimizing C/C++ and Fortran Compilers (AOCC): PIK reported problems when building YAC to be used in PISM.
  • NVIDIA NVHPC 23.3: When compiling ICON-NWP with YAC enabled, the compilation fails with error:
    /usr/bin/ld: /usr/lib64/crt1.o: in function `_start':
    /home/abuild/rpmbuild/BUILD/glibc-2.31/csu/../sysdeps/x86_64/start.S:104:
    undefined reference to `main'
    configure:3977: $? = 2
    This is fixed in NVIDIA compiler versions > 23.7.

General Workarounds:

If your Fortran compiler is faulty but you are certain your arrays are always contiguous in memory, you can skip the configure check:

./configure yac_cv_fc_is_contiguous_works=yes [...]
Warning
When using the workarounds that bypass the is_contiguous check, be very careful when changing anything related to coupling. Since is_contiguous is effectively disabled, the compiler cannot verify memory layout correctness when passing data between Fortran and C.

Alternatively, since Version 3.6.1 (Mar 2025), you can disable the Fortran interface entirely:

./configure --disable-fortran-bindings [...]

This is particularly suitable for projects like PISM that only use YAC's C interface.

NVIDIA-specific workaround for ICON builds:

For ICON builds with NVIDIA 23.3, the following flags can be used:

EXTRA_CONFIG_ARGS='yac_cv_fc_is_contiguous_works=yes'
ICON_YAC_FCFLAGS="-D'is_contiguous(arg)=.TRUE.'"

This approach:

  • Bypasses the configure check that fails with the buggy compiler
  • Defines is_contiguous to always return .TRUE.
  • Is not specific to Levante; can be used with NVIDIA + CUDA + Cray-MPICH
Remarks
It is possible to build yaxt without Fortran interface by passing FC=no to its configure

Intel C Compiler Classic 2021.5.0 fails to compile area.c

Problem:

Intel C Compiler Classic 2021.5.0 fails to compile area.c with -O2 -march=native on Levante (and potentially other systems). The compiler crashes with an internal error:

": internal error: ** The compiler has encountered an unexpected problem.
Segmentation violation signal raised. **
Access violation or stack overflow. Please contact Intel Support for assistance.
double free or corruption (out)
icc: error #10106: Fatal error in /sw/spack-levante/intel-oneapi-compilers-2022.0.1-an2cbq/compiler/2022.0.1/linux/bin/intel64/../../bin/intel64/mcpcom, terminated by IOT instruction
compilation aborted for area.c (code 1)

Affected Configuration:

  • Compiler: Intel C Compiler Classic 2021.5.0
  • Optimization flags: -O2 -march=native
  • System: Levante (DKRZ)

Solution:

This is a compiler bug. Options:

  • Upgrade to a newer Intel compiler version
  • Use a different optimization level for this specific file
  • Avoid -march=native flag

NVHPC 23.5 test_interp_method_nnn_parallel failure

Problem:

When Version 2.6.1 (Sep 2022) (patch 3) is built with NVHPC 23.5 (against YAXT 0.9.3.1), the test test_interp_method_nnn_parallel fails with multiple "wrong interpolation result" messages. The same YAC version works correctly with NVHPC 22.5.

Affected Configuration:

  • Compiler: NVHPC 23.5
  • YAC version: 2.6.1_p3
  • YAXT version: 0.9.3.1
  • Test: test_interp_method_nnn_parallel

Status:

A fix was implemented and is included in YAC Version 2.6.2 (Dec 2022) and newer. This issue was particularly important for ICON integration, as upgrading to NVHPC 23.5 was desired for new compiler features and bugfixes.

Intel OneAPI test_instance_parallel1 failure

Problem:

When using Intel OneAPI compilers, test_instance_parallel1 fails with the following error message:

Fatal error in .../src/core/interpolation/methods/interp_method_spmap.c, line 1097:
ERROR(do_search_spmap): required target points already in use or not available
static size_t do_search_spmap(struct interp_method *method, struct yac_interp_grid *interp_grid, size_t *tgt_points, size_t count, struct yac_interp_weights *weights, int *interpolation_complete)
basic routine for the computation of the interpolation weights
Definition __init__.py:1

Affected Configuration:

  • Compiler: Intel OneAPI
  • YAC version: 3.17.0
  • Test: test_instance_parallel1

Solution:

The issue is caused by floating point optimisations performed by the compiler. Adding -fp-model=precise to the compiler flags passed to YAC avoids it.