# Highlights of the new preCICE release v2.4

**URL:** <https://precice.discourse.group/t/highlights-of-the-new-precice-release-v2-4/1047>\
**Category:** News\
**Tags:** precice-v2\
**Created:** [May 16, 2022, 10:39am UTC](https://precice.discourse.group/t/highlights-of-the-new-precice-release-v2-4/1047 "2022-05-16T10:39:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![uekerman](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/uekerman/32/2199_2.png) [@uekerman](https://precice.discourse.group/u/uekerman)\
**Post date:** [May 16, 2022, 10:39am UTC](https://precice.discourse.group/t/highlights-of-the-new-precice-release-v2-4/1047/1 "2022-05-16T10:39:55Z")

</div>

Just out: [Release v2.4.0 · precice/precice · GitHub](https://github.com/precice/precice/releases/tag/v2.4.0)

As usual, we fixed quite a few bugs. We mention an important fix below. This alone should already be incentive enough to upgrade 😁 … but, of course, we also have a few new handy features:

## New export variants

The [export functionality](https://precice.org/configuration-export.html) now supports many more data formats:

- `<export:csv />` ( **new** ) ([Add CSV exporter by fsimonis · Pull Request #1144 · precice/precice · GitHub](https://github.com/precice/precice/pull/1144))
- `<export:vtp />` ( **new** ) ([VTP exporter by fsimonis · Pull Request #1137 · precice/precice · GitHub](https://github.com/precice/precice/pull/1137))
- `<export:vtu />` ( **new** ) ([Add VTU exporter by fsimonis · Pull Request #1136 · precice/precice · GitHub](https://github.com/precice/precice/pull/1136))
- `<export:vtk />`

The csv data, you can for example import to any Python script with pandas: 👀

```python
def loadParallelCSV(name):
  import glob, pandas
  return pandas.concat([pandas.read_csv(name, sep=";") for name in glob.glob(f"{name}_*.csv")], ignore_index=True)

def loadParallelCSVSeries(name)
  import re, glob, pandas
  l = [(re.search("dt(\d+)_", s).group(1), s) for s in glob.glob(f"{name}.dt*_*.csv")]
  retrun pandas.concat([pandas.read_csv(file, sep=";").assign(dt=dt) for dt, file in l], ignore_index=True)

pointData = loadParallelCSV("A-ExporterTwo.dt1")
pointDataSeries = loadParallelCSVSeries("A-ExporterTwo")

```

## Introducing `precice-tools`

We renamed `binprecice` to `precice-tools` (the old name is still usable till preCICE v3.0) and added some additional functionality:

- `precice-tools check precice-config.xml` … lets you check the correctness of a given configuration file ([Configuration Checker by fsimonis · Pull Request #1132 · precice/precice · GitHub](https://github.com/precice/precice/pull/1132)).
- `precice-tools version` … prints the version of the used preCICE library. ([Add tooling API by fsimonis · Pull Request #1122 · precice/precice · GitHub](https://github.com/precice/precice/pull/1122))

## Building

We added a few small details that should make your and our lives easier:

- New CMake options `PRECICE_RELEASE_WITH_DEBUG_LOG`, `PRECICE_RELEASE_WITH_ASSERTIONS`, and `PRECICE_RELEASE_WITH_TRACE_LOG` to switch on Debug logging, assertions, and Trace logging, respectively when in Release mode ([all CMake options](https://precice.org/installation-source-configuration.html#options)). This is useful for debugging preCICE with larger test cases, especially when dealing with connectivity 🚀.
- A pkg-config file for using preCICE directly from the build directory. ([Add pkg-config file for binary directory by fsimonis · Pull Request #1238 · precice/precice · GitHub](https://github.com/precice/precice/pull/1238)) – very handy for adapter developers who rely on pkg-config and develop versions of preCICE. Simply add the build directory to the `PKG_CONFIG_PATH` environment variable after setting up `LD_LIBRARY_PATH`.

We also added tooling shortcuts to CMake, which simplify contributing:

- `make doxygen`: Generate doxygen documentation
- `make format`: Format the codebase (requires local install of the correct version of clang-format)
- `make soucesIndex`: Update the CMake source index
- `make changelog`: Add changelog entry using the GitHub PR number

## Dependencies

With the new Ubuntu LTS release 22.04, we drop the support of the oldest LTS, namely Ubuntu 18.04 LTS, making Ubuntu 20.04 LTS the new baseline. This means, preCICE now requires Boost version `1.71.0` and CMake version `3.16.3` ([Lift baseline from Ubuntu 18.04 LTS to 20.04 LTS by fsimonis · Pull Request #1259 · precice/precice · GitHub](https://github.com/precice/precice/pull/1259)). We are now actively investigating a possible move to C++17.

## Nearest-neighbor gradient mapping (still experimental)

We added a new mapping method `nearest-neighbor-gradient` ([https://github.com/precice/precice/pull/1169](https://github.com/precice/precice/pull/1169)), which was implemented, tested, and documented as part of the [bachelor’s thesis](http://dx.doi.org/10.18419/opus-12128) of [@ariguiba](https://github.com/ariguiba). Users can now give gradients of data to preCICE and get a second-order mapping method this way.

```cpp
writeScalarGradientData(int dataID, int valueIndex, const double* gradientValues)

```

Compared to the `nearest-projection` mapping, no connectivity is required (but gradient data). First tests with [ASTE](https://github.com/precice/aste) showed very promising results. [See all new API methods and a full code example](https://precice.org/couple-your-code-gradient-data.html).

## Time interpolation (still experimental)

Time interpolation is a topic we are working on since longer, see for example the paper on quasi-Newton waveform iteration from last year:

> Rüth, B., Uekermann, B., Mehl, M., Birken, P., Monge, A. and Bungartz, H.J., 2021. Quasi‐Newton waveform iteration for partitioned surface‐coupled multiphysics applications. International Journal for Numerical Methods in Engineering, 122(19), pp.5236-5257. [https://doi.org/10.1002/nme.6443](https://doi.org/10.1002/nme.6443)

We now merged and released a first larger chunk of functionality. We now have linear interpolation in time, but still restricted to parallel-implicit coupling.

Switch it on:

```xml
<solver-interface experimental="true" ... >
...
    <participant name="FluidSolver">
        <use-mesh name="FluidMesh" provide="yes"/>
        <write-data name="Forces" mesh="MyMesh"/>
        <read-data name="Displacements" mesh="FluidMesh" waveform-order="1"/>
    </participant>
...
</solver-interface>

```

… and then read data whereever (in time) you want:

```cpp
void readBlockVectorData(int dataID, int size, const int* valueIndices, 
                         double relativeReadTime, double* values) const;

```

Everything is still experimental – use with care. To find out more and stay up to date, have a look at the [full documentation](https://precice.org/couple-your-code-waveform.html)

## Julia bindings

Probably worth mentioning, we recently also added bindings for Julia: [GitHub - precice/PreCICE.jl: Julia language bindings for preCICE](https://github.com/precice/PreCICE.jl) 😄 . We also added them to the [Julia General Package Registry](https://github.com/JuliaRegistries/General/tree/master/P/PreCICE) so that they should be easy to install. To test the bindings, you could then run the example [solverdummy](https://github.com/precice/PreCICE.jl/tree/0bb627614c95e4707ce3b69cf751bc83c758a660/solverdummy) code.

## Bug in socket communication

We finally discovered the root course of a rare and difficult to reproduce bug in the sockets communication back-end. A race condition in the send queue led to crashes in send-intensive situations. This was observed in cases that explicitly enable the gather-scatter algorithm in communications using: `<m2n:sockets enforce-gather-scatter="true" ... />`. Furthermore, this could be observable in uni-directional coupling, especially if the sending participant finishes time-windows faster than the receiving participant.

## Even more

- We added `support-radius` as additional configuration option for Gaussian RBF mapping configuration ([https://github.com/precice/precice/pull/1163](https://github.com/precice/precice/pull/1163)).

- We are slowly working towards supporting multiple instances of `SolverInterface` at the same time. We are not there yet, but fixed many relevant problems. [See project overview](https://github.com/precice/precice/projects/8).

- We, finally, got rid of the _master_ and _slave_ nomenclature. In the code base, we now distinguish between one primary and many secondary ranks. The geometric filters accordingly are called `on-primary-rank` and `on-secondary-ranks`. The _intra-participant communication_ (previously _master communication_) can now be configured like this:

- Retirement: We deprecated the API functions `mapWriteDataFrom` and `mapReadDataTo` and will retire them with preCICE v3.0. More deprecations are currently discussed. Feel free to comment under:

We definitely forgot something in this list, but anyway, enough reasons to upgrade right now! 😄

---

<div class="post-metadata">

**Author:** ![uekerman](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/uekerman/32/2199_2.png) [@uekerman](https://precice.discourse.group/u/uekerman)\
**Post date:** [May 16, 2022, 10:41am UTC](https://precice.discourse.group/t/highlights-of-the-new-precice-release-v2-4/1047/2 "2022-05-16T10:41:14Z")

</div>



---

<div class="post-metadata">

**Author:** ![sandersbud4](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/sandersbud4/32/649_2.png) [@sandersbud4](https://precice.discourse.group/u/sandersbud4)\
**Post date:** [June 2, 2022, 8:07am UTC](https://precice.discourse.group/t/highlights-of-the-new-precice-release-v2-4/1047/3 "2022-06-02T08:07:44Z")

</div>

Well, I am happy to read about new changes that are being introduced in the latest version.
