Index: BOL/LMDZ_Setup_amaury/setup.sh
===================================================================
--- BOL/LMDZ_Setup_amaury/setup.sh	(revision 5010)
+++ BOL/LMDZ_Setup_amaury/setup.sh	(revision 5013)
@@ -175,4 +175,14 @@
   if [[ $mpi -gt $NB_MPI_MAX ]]; then mpi=$NB_MPI_MAX; fi
   if [[ $omp -gt $NB_OMP_MAX ]]; then omp=$NB_OMP_MAX; fi
+
+  # Compute how many mpi per node (required e.g. for Adastra)
+  if [[ $NB_CORE_PER_NODE_MAX -gt 0 ]]; then
+    local N_omp_mt=1
+    if [[ $omp -gt 1 ]]; then (( N_omp_mt = omp / N_HYPERTHREADING )); fi  # take into account hyperthreading
+    (( mpi_per_node = NB_CORE_PER_NODE_MAX / N_omp_mt ))
+    if [[ mpi_per_node -gt mpi ]]; then mpi_per_node=$mpi; fi
+  fi
+
+  echo "Total MPI=$mpi (PER NODE=$mpi_per_node), OMP=$omp"
 }
 
@@ -430,4 +440,5 @@
   -e "s/time=.*.$/time=$cput/" \
   -e "s/ntasks=.*.$/ntasks=$mpi/" \
+  -e "s/ntasks=.*.$/ntasks-per-node=$mpi_per_node/" \
   -e "s/cpus-per-task=.*.$/cpus-per-task=$omp/" \
   -e "s/nthreads=.*./nthreads=$omp/" \
@@ -618,5 +629,5 @@
 #@ADS#SBATCH --ntasks=1
 #@ADS#SBATCH --cpus-per-task=1
-#@ADS#SBATCH --ntasks-per-node=8  # TODO check how to scale this
+#@ADS#SBATCH --nodes=1
 #@ADS#SBATCH --hint=nomultithread
 #@ADS#SBATCH --time=00:10:00
