---
# System prepended metadata

title: '[Greenline] Halo construction Follow up'
tags: [cycle 24 - 08/24]

---

# [Greenline] halo construction 

<!-- Add the tag for the current cycle number in the top bar -->

- Shaped by: Magdalena
- Appetite (FTEs, weeks):
- Developers: <!-- Filled in at the betting table unless someone is specifically required here -->

## Problem
<!-- The raw idea, a use case, or something we’ve seen that motivates us to work on this -->
During the last cycle, progress was made towards being able to decompose a icon grid in python with [this project](https://hackmd.io/ophk8gJ2S9KGFgNpuAMzyg).
What has been achieved:
- Starting from a global grid we can 
    - decompose cells, vertices and edges 
    - construct halos
    - construct node local connectivities arrays
- some simple tests are in place that
    - read a field locally after the distribution gather the data from all nodes and compare to the global field. 

This is a follow up project that should add the missing features in order to be able to run **global** simulations in multinodes.



## Appetite
<!-- Explain 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 -->
- compute start/end index arrays for the local grid
- refactor grid_manager.py to 
    - call the decomposition
    - return local topologies.
- enlarge test set
    - compute  geofac_rot, geofac_div, geofac_n2s in distributed way and compare with 1 node serialized results
    - use grid_manager to provide the topology for single and multi node diffusion tests
- add CI action for parallel (MPI) tests 

## Rabbit holes
<!-- Details about the solution worth calling out to avoid problems -->

## 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 -->

## Progress
<!-- Don't fill during shaping. This area is for collecting TODOs during building. As first task during building add a preliminary list of coarse-grained tasks for the project and refine them with finer-grained items when it makes sense as you work on them. -->
- [ ] CI action for mpi tests
- [ ] Integrate in grid_manager.py
    - [ ] refactor and simplify
    - [x] add decompose
    - [ ] return local grid for decomposed setup
- [x] construct start, end indices
    
- [ ] tests for halo access
    - [ ] geofac_rot
    - [ ] geofac_div
    - [ ] geofac_n2s
- [ ] run diffusion with grid manager

