# Portability of NEMO diagnostics to GPU

Study the portability NEMO diagnostics to GPU (using Power9 machine) and take them out of the critical execution path.

Earth  science  models  are  widely  used  in  meteorological  institutions  and  universitiesfor weather and climate prediction studies. The complexity of the chaotic equations used and theamount  of  data  needed  to  achieve  a  good  accuracy  on  the  simulation  demand  a  computationalpower only found in clusters.  One of these models is NEMO, which is the European framework forexcellence used for oceanic studies and running on MareNostrum 4. A prime focus in this context isthe computational performance of the model.  So much to reduce ”Time to solution” as for the costsassociated during the execution.  In NEMO, the execution time is extended due to the calculation ofsome diagnostics, which are used to prepare the output variables for the post-processing study.In this project, the performance of NEMO diagnostics is analyzed.  Afterward, the portability of themto new architectures based on GPUs through CUDA while removing this part from the critical path ofthe execution is discussed.

Files included:
*  File "cuda_dia_hsb.cuf" is a first approach to port Heat and Salt budgets diagnostic to GPU.
    * dia_hsb_kernel is the function to run the computation of the volume, volume variation and heat and salinity content of the ocean. 
    * CUDA_reduction is the function to compute the reduction of the mentioned results and give the global value as Output.
*  Document "final_report" is the final report (indeed) presented.
*  Final ppt


To compile the "cuda_dia_hsb.cuf" load pgi/18.4 and cuda/9.1 modules first

compile with:

```pgf90 cuda_dia_hsb.cuf```

You can get interesting CUDA metrics with:

```nvproof --print-gpu-trace ./a.out```