Changeset 5000


Ignore:
Timestamp:
Jul 1, 2024, 10:09:23 AM (5 months ago)
Author:
abarral
Message:

update lmdz_env.sh to separate bash run and srun

Location:
BOL/LMDZ_Setup_amaury
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • BOL/LMDZ_Setup_amaury/lmdz_env.sh

    r4995 r5000  
    4444      NB_MPI_MAX=2000
    4545      NB_OMP_MAX=20
    46       RUNCMD="srun --label -n"
     46      MPICMD="srun -n"
     47      RUNBASHCMD="srun -A $account@cpu --label -n 1 -c"
    4748      SUBMITCMD="sbatch -A $account@cpu"
    4849      ;;
     
    5455      module load cdo/2.3.0
    5556
    56       root_dir=~/"LMDZ_SETUP_ROOT/LMDZ_Setup";
     57      root_dir="/data/abarral/LMDZ_SETUP_ROOT/LMDZ_Setup";
    5758      ARCH="X64_MESOIPSL-GNU"
    5859      SIMRUNBASEDIR="$SCRATCH/"
    5960      LMDZD="$root_dir/LMDZD"
    6061      LMDZ_INIT="$root_dir/LMDZ_Init"
    61       NB_MPI_MAX=20
     62      NB_MPI_MAX=5
    6263      NB_OMP_MAX=1
    63       RUNCMD="mpirun -n"  # on spirit, we can't run MPI using srun from within sbatch
     64      MPICMD="mpirun -np"  # on spirit, we can't run MPI using srun from within sbatch
     65      RUNBASHCMD="bash"
    6466      SUBMITCMD="sbatch"
    6567      ;;
     
    9496      NB_MPI_MAX=1  # TODO 2000 in JZ
    9597      NB_OMP_MAX=1  # TODO 20 in JZ
    96       RUNCMD="srun --label --account=$account --constraint=GENOA -n"
     98      MPICMD="srun -n"
     99      RUNBASHCMD="srun --label --account=$account --constraint=GENOA --ntasks-per-node=1 -n 1 --time=00:10:00 -c"
    97100      SUBMITCMD="sbatch --constraint=GENOA --account=$account"
    98101      ;;
     
    105108      NB_MPI_MAX=2  # Max number of MPI cores (only for running simulations)
    106109      NB_OMP_MAX=1  # Max number of OMP threads (only for running simulations)
    107       RUNCMD="mpirun -np" # command to run a job, as $runcmd <nprocs> <script>
     110      MPICMD="mpirun -np" # command to run an mpi executable, as $MPICMD <nprocs> <script>
     111      RUNBASHCMD="bash" # command to run a bash job, as $runbashcmd (nthreads) <script> [nthreads only supplied if =/="bash"]
    108112      SUBMITCMD="."  # command to sumbit a job, as $submitcmd <script>
    109113      ;;
  • BOL/LMDZ_Setup_amaury/script_SIMU

    r4995 r5000  
    322322echo '##################################################################'
    323323
    324 time $RUNCMD $ntasks ./gcm.e > listing
     324time $MPICMD $ntasks ./gcm.e > listing
    325325if [ ! -f restartphy.nc ] ; then
    326326echo PROBLEME PAS DE FICHIER RESTARTPHY
  • BOL/LMDZ_Setup_amaury/setup.sh

    r4995 r5000  
    222222  chmod +x install_lmdz.sh
    223223  local make_j=8
    224   echo "./install_lmdz.sh -noclean $optim -v $version $svnopt -d $resol -rad $rad -bench 0 -parallel mpi_omp $ins_cosp $ins_xios $ins_aero $ins_inlandsis -name $LMDZname -veget $veget -netcdf $netcdf -arch $ARCH -make_j $make_j" >> install_lmdz_options.$$.sh
     224  # We launch using $MPICMD, except if it's using mpirun (no srun equivalent for bash script) => if supported, the compilation runs in a cluster job
     225  jobcmd="\"$RUNBASHCMD $make_j\""
     226  if [[ ${hostname:0:5} = "jean-" ]]; then jobcmd="\"$RUNBASHCMD $make_j --partition=compil\""; fi  # On JeanZay: compile on the <compil> partition
     227  if [[ $(echo "$RUNBASHCMD" | cut -c -4) = "bash" ]]; then
     228     jobcmd="bash"
     229  fi
     230  echo "./install_lmdz.sh -noclean $optim -v $version $svnopt -d $resol -rad $rad -bench 0 -parallel mpi_omp $ins_cosp $ins_xios $ins_aero $ins_inlandsis -name $LMDZname -veget $veget -netcdf $netcdf -arch $ARCH -make_j $make_j -jobcmd $jobcmd" >> install_lmdz_options.$$.sh
    225231  chmod +x install_lmdz_options.$$.sh
    226232  echo "Running install_lmdz_options.$$.sh"
    227233  set -o pipefail
    228   # We launch using $RUNCMD, except if it's using mpirun (no srun equivalent for bash script) => if supported, the compilation runs in a cluster job
    229   local install_cmd="$RUNCMD $make_j"
    230   if [[ $(echo "$RUNCMD" | cut -c -6) = "mpirun" ]]; then
    231      install_cmd=""
    232   fi
    233    gcm=$MODEL/$($install_cmd ./install_lmdz_options.$$.sh | tee /dev/tty | tail -n 1 | sed -n "s:.* executable is \(.*\.e\).*:\1:p")
    234 #    gcm=$MODEL/$(./install_lmdz_options.$$.sh | tee /dev/tty | tail -n 1 | sed -n "s:.* executable is \(.*\.e\).*:\1:p")
     234    gcm=$MODEL/$(./install_lmdz_options.$$.sh | tee /dev/tty | tail -n 1 | sed -n "s:.* executable is \(.*\.e\).*:\1:p")
    235235  set +o pipefail
    236236  mv install_lmdz.sh install_lmdz.$$.sh
     
    433433  -e "s/nthreads=.*./nthreads=$omp/" \
    434434  -e "s/MAINDIR=.*.$/MAINDIR=$(basename "$local")/" \
    435   -e "s:STORED=.*.*:STORED=$(dirname $local):" \
     435  -e "s:STORED=.*.*:STORED=$(dirname "$local"):" \
    436436  -e "s:SCRATCHD=.*.*:SCRATCHD=$SIMRUNBASEDIR:" \
    437437  -e "s/stopsim=.*.$/stopsim=$stopsim/" \
     
    640640  sed -e 's/anneeref=.*.$/anneeref='\$yr'/' DEF/run.def >| run.def
    641641  echo Starting initialisation
    642   OMP_NUM_THREADS=1 $RUNCMD 1 $ce0l  # ce0l requires MPI=OMP=1
     642  OMP_NUM_THREADS=1 $MPICMD 1 $ce0l  # ce0l requires MPI=OMP=1
    643643  if [ $climato = 0 ]; then mv limit.nc limit.\$yr.nc; fi
    644644done
Note: See TracChangeset for help on using the changeset viewer.