---
# System prepended metadata

title: Halo exchanges
tags: [cycle 15]

---

# Halo exchanges

###### tags: `cycle 15`

- Shaped by: Magdalena
- Developers: Fabian (GHEX bindings), Magdalena (icon4py)
- Appetite: Full cycle?


## Problem
Follow up of [project](https://hackmd.io/4S4HG843RHKQ-7VQmDC-3A) from last cycle. 
There, mostly exploratory work was done. The work on the python bindings for GHEX was started. 

We want to gain experience of a python module including halo exchanges. We use the diffusion module as an example because it contains halo exchanges still being quite succinct.





## Appetite
<!-- How much time we want to spend and how that constrains the solution -->


## Solution
<!-- The core elements we came up with, presented in a form that’s easy for people to immediately understand -->
- [x] Complete GHEX python bindings. 
- [ ] Pip build for GHEX

Set up an experiment along the following lines:
- [x] Do a parallel run of ICON and serialize all necessary data:
    - [x] decomposition information
    - [x] decomposed grids
    - [x] decomposed input fields for diffusion
    - [x] decomposed output fields for diffusion
    
- [x] add halo exchange calls to diffusion module

- [ ] setup the experiment itself: 
    - [x] initialize a parallel runtime (MPI4Py?) 
    - [x] read in the decomposed data from python
    - [x] initialize the diffusion on the parallel setup
    - [x] run diffusion
    - [ ] verify against serialized output data.
    
The input and output fields of diffusion for a decomposed grid can be serialized using `f2ser`from the Fortran diffusion granule.

A simple way of getting the decomposition information would be to add those fields to the diffusion granule interface.



## Rabbit holes
<!-- Details about the solution worth calling out to avoid problems -->
* I/O (serialization) for multinode runs. Possibly works out of the box.
* verification and debugging due to parallel nature.
*  

## No-gos
<!-- Anything specifically excluded from the concept: functionality or use cases we intentionally aren’t covering to fit the ## appetite or make the problem tractable -->
* DONT do decomposition itself.