# Fortran to Python OASIS conversion <!-- omit in toc -->

This branch serves as an example on the performance difference between pyOASIS and OASIS, as well as OASIS performance analysis itself when sending two coupling fields at the same time. For more info, check the master branch of this repository.

## Running the benchmark

The toy model has been modified from the master branch. It consists of two components ('ocean' and 'atmos') and implements coupling exchanges **only** from 'ocean' to 'atmos' at the same time on every iteration of two coupling fields of the same size. 'ocean' runs first in Fortran and then in Python, always communicating with 'atmos' running in Fortran.

For running the example, you must have followed the instructions posted on the master branch of this repository. For running both implementations, issue the following command from the root folder of this repository:
```bash
bash run_tests.sh
```

To obtain a visualization of the results, run the following script from the root folder of this repository:
```bash
python3 analyze_results.py
```

This Python script will create a file called `results.png` with the performance output hich should look approximately like this:

![reference_results](reference_results.png)

In the subplots, `Python_var0` references the time it took to execute OASIS' `put()` in the Python implementation of the first coupling field (`var0`).
