HYbrid OpenMP/MPI parallelization in Croco

Hello,

For those interested i just fixed the implementation of hybrid parallelization with MPI and OpenMP in Croco
I created a branch from croco-V2.1.3 in my own gihub repo (for now i have no access to Croco Gitlab). i attached some metrics from Benguela VHR config with 10 tracers.

How to use it :

  • You can downlaod the source code here https://github.com/Matt29/croco/tree/feature/mpi-openmp-hybrid

  • define these 2 keys in cppdefs.h

    #define OPENMP
    
    #define MPI
    
  • param.h

    parameter (NP_XI=2,  NP_ETA=4,  NNODES=NP_XI*NP_ETA)
    parameter (NPP=2)
    parameter (NSUB_X=1, NSUB_E=2)
    
  • Compil with your jobcomp :
    ./jobcomp
    --src "${CROCO_SOURCE_DIR}/OCEAN"
    --fc ifx
    --mpif90 mpiifx
    --fflags '-O2 -mcmodel=medium -i4 -r8 -fp-model precise'
    --jobs 4

  • Then it must match your slurm config :
    SLURM_NTASKS = NP_XI × NP_ETA = 8
    SLURM_CPUS_PER_TASK = NSUB_X × NSUB_E = 2
    OMP_NUM_THREADS = SLURM_CPUS_PER_TASK = 2

Matthieu

1 Like

@Matt29
I hope you are doing well.
It’s very interesting here. but memory point of view.
Have you take care of it? dynamic +shared
I will go through it. good work.
Thank you.
Best regards