- 1AIRSEA - Laboratoire Jean Kuntzmann, Université Grenoble Alpes and Inria Grenoble Rhône Alpes, Saint-Martin-d'Hères, France
- 2Hartree Centre, Science and Technology Facilities Council (STFC), Warrington, United Kingdom
- 3Bureau of Meteorology, Melbourne, Australia
- 4TUM School of Computation, Information and Technology, Technical University of Munich, Munich, Germany
To address these challenges, we introduce Poseidon, an HPC-oriented source-to-source compiler designed for Fortran-based fluid dynamics solvers used in ocean and weather models with regular grid structures. Poseidon employs a novel process called uplifting, which treats existing models and their coding standards as Fortran-embedded DSLs and requires minimal source code changes. This approach, which relies on co-design with model developers, allows Poseidon to robustly recover high-level information and semantics that are typically lost during the conversion of numerical algorithms to source code. By doing so, Poseidon can perform safe and holistic optimizations for specific HPC architectures using a data flow graph intermediate representation. It then generates Fortran source code augmented with parallel programming model directives, which can be further optimized by vendor or open source compilers.
We detail Poseidon's methodology and present initial results by performing architecture-specific auto-tuned kernel fusion and automatic parallelization on both CPUs and GPUs using OpenMP or OpenACC on a research code that implements the 2D fast barotropic solver of the CROCO 3D ocean simulation model. Our results demonstrate significant performance improvements and validate the effectiveness of Poseidon's optimization strategies.
Additionally, we discuss our ongoing research efforts for the automatic injection of communications, e.g., MPI, for latency hiding, and the implementation of automatic differentiation at the data flow graph level for data assimilation. These advancements are crucial for further improving the performance and scalability of ocean simulation models.
Furthermore, we outline our current progress and future plans for integrating Poseidon with the NEMO ocean model using an elegant annotations-based uplifter, and leveraging its optimization techniques.
How to cite: Rémy, J., Brémond, M., Brunie, H., Debreu, L., Ford, R. W., Henrichs, J., Lemarié, F., Mittermair, A., Porter, A. R., Schreiber, M., Schulz, M., Siso, S., and Vidard, A.: Poseidon: A Source-to-Source Compiler for Optimizing Ocean Simulation Models on Modern HPC Architectures, EGU General Assembly 2025, Vienna, Austria, 27 Apr–2 May 2025, EGU25-12230, https://doi.org/10.5194/egusphere-egu25-12230, 2025.