Changeset 5422 for BOL/LMDZ_Setup


Ignore:
Timestamp:
Dec 18, 2024, 9:29:49 AM (11 hours ago)
Author:
fhourdin
Message:

Changing $SUBMITCMD to a function submitcmd

Need for local use of LMDZ

Location:
BOL/LMDZ_Setup
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • BOL/LMDZ_Setup/lmdz_env.sh

    r5420 r5422  
    1212
    1313function get_hostname {
    14   if grep -q "Adastra" /etc/motd; then
     14  if grep -q "Adastra" /etc/motd 2>/dev/null ; then
    1515    hostname="adastra"
    1616  elif which idrquota &> /dev/null; then
     
    2323function set_env {  # Platform-specific
    2424  case ${hostname:0:5} in
    25     jean-)
     25#-------------------------------------------------------------------------
     26    jean-) # Jean-zay, Idris-CNRS super computer
     27#-------------------------------------------------------------------------
    2628      module purge
    2729      compilo=19.0.4 # available 2013.0, 2017.2
     
    5153      MPICMD="srun -n"
    5254      RUNBASHCMD="srun -A $account@cpu --label -n 1 -c"
    53       SUBMITCMD="sbatch -A $account@cpu"
     55      #SUBMITCMD="sbatch -A $account@cpu"
     56      submitcmd() {
     57         sbatch -A $account@cpu $1
     58      }
    5459      ;;
    55     spiri)
     60#-------------------------------------------------------------------------
     61    spiri) # Spirit : IPSL cluster
     62#-------------------------------------------------------------------------
    5663      module purge
    5764      module load subversion/1.13.0
     
    7077      MPICMD="mpirun -np"  # on spirit, we can't run MPI using srun from within sbatch
    7178      RUNBASHCMD="bash"
    72       SUBMITCMD="sbatch"
     79      #SUBMITCMD="sbatch"
     80      submitcmd() {
     81         sbatch $1
     82      }
    7383      ;;
    74     adast)
     84#-------------------------------------------------------------------------
     85    adast) # Adastra, Cines computing center
     86#-------------------------------------------------------------------------
    7587      module purge
    7688      module load PrgEnv-gnu  # we need to load the env because lmdz links some shared libraries
     
    108120#      RUNBASHCMD="srun --label --account=$account --constraint=GENOA --ntasks-per-node=1 -n 1 --time=00:15:00 -c"
    109121      RUNBASHCMD="bash"  # On Adastra the docs says we can use login nodes for compilation
    110       SUBMITCMD="env $(env | grep -E "SLURM_|SBATCH_|SRUN_" | cut -d= -f1 | awk '{print "-u " $0}' | tr '\n' ' ' ) sbatch --constraint=GENOA --account=$account"  # we need to remove the existing SLURM variables otherwise they may be unexpectedly inherited by the submitted script
     122      #SUBMITCMD="env $(env | grep -E "SLURM_|SBATCH_|SRUN_" | cut -d= -f1 | awk '{print "-u " $0}' | tr '\n' ' ' ) sbatch --constraint=GENOA --account=$account"  # we need to remove the existing SLURM variables otherwise they may be unexpectedly inherited by the submitted script
     123      submitcmd() {
     124        env $(env | grep -E "SLURM_|SBATCH_|SRUN_" | cut -d= -f1 | awk '{print "-u " $0}' | tr '\n' ' ' ) sbatch --constraint=GENOA --account=$account
     125      }  # we need to remove the existing SLURM variables otherwise they may be unexpectedly inherited by the submitted script
    111126      ;;
    112     *) echo "WARNING: RUNNING THIS SCRIPT ON A LOCAL COMPUTER IS DISCOURAGED (lackluster cpus and memory)"
     127#-------------------------------------------------------------------------
     128    *)  # Local machine.
     129#-------------------------------------------------------------------------
    113130      ARCH="local-gfortran-parallel"  # The arch file to use
    114131      SIMRUNBASEDIR="$root_dir/SCRATCH/"  # Where the simulations will be executed ($SIMRUNBASEDIR/LMDZ_Setup/...)
     
    121138      MPICMD="mpirun -np" # command to run an mpi executable, as $MPICMD <nprocs> <script>
    122139      RUNBASHCMD="bash" # command to run a bash job, as $runbashcmd (nthreads) <script> [nthreads only supplied if =/="bash"]
    123       SUBMITCMD="."  # command to sumbit a job, as $submitcmd <script>
     140      #SUBMITCMD="."  # command to sumbit a job, as $submitcmd <script>
     141      submitcmd() {
     142         nohup bash $1 > out.$$ 2>err.$$ &
     143      }
    124144      ;;
    125145  esac
  • BOL/LMDZ_Setup/reb.sh

    r5415 r5422  
    5454ulimit -s unlimited
    5555if [[ -f ${type}_0000.nc ]]; then
    56   $rebuild -o ${type}.$ym.nc ${type}_[0-9][0-9][0-9][0-9].nc
     56  $RUNBASHCMD $rebuild -o ${type}.$ym.nc ${type}_[0-9][0-9][0-9][0-9].nc
    5757else
    5858  echo "${type}_0000.nc absent"
     
    6666eod
    6767
    68   echo "Submitting the rebuild job $job using <$SUBMITCMD \"$job\">"
    69   $SUBMITCMD "$job"
     68  #echo "Submitting the rebuild job $job using <$SUBMITCMD \"$job\">"
     69  #$SUBMITCMD "$job"
     70  echo "Submitting the rebuild job $job using <submitcmd \"$job\">"
     71  submitcmd "$job"
    7072done
  • BOL/LMDZ_Setup/script_SIMU

    r5421 r5422  
    172172   else
    173173      nday=360 ; ndayh=30
     174      # nday=3 ; ndayh=1 # Pratique pour des tests rapides
    174175   fi
    175176fi
     
    403404      if [ $num -le 250 ] ; then
    404405         sed -e 's/^simul=.*.$/simul='$simul_new'/' -e 's/^\# @ job_nam.*.=.*.$/\# @ job_name = '$simul_new'/' tmp_$simul >| tmp_$simul_new
    405          $SUBMITCMD tmp_$simul_new
     406         submitcmd tmp_$simul_new
    406407      fi
    407408   fi
     
    417418
    418419cd $SCRIPTDIR
    419 $SUBMITCMD tmp_$simul
     420submitcmd tmp_$simul
     421#$SUBMITCMD tmp_$simul
  • BOL/LMDZ_Setup/setup.sh

    r5420 r5422  
    1717  # Radiative code: "oldrad" / "rrtm" / "ecrad"
    1818  rad="rrtm"
     19  rad="oldrad"
    1920
    2021  #   !!! STRONG recommendation : experiments with DIFFERENT Orchidee or aerosol options should be performed in DIFFERENT LMDZ_Setup folders
     
    2627  #   in order to re-run the initialisation job, which downloads the aerosol files and interpolates them)
    2728  aerosols="clim"
     29  aerosols="n"
    2830
    2931  # SURFACE/VEGETATION SCHEME
     
    3840  # netcdf: 0 (use existing library) / 1 (recompile netcdf, slow)
    3941  netcdf=0
     42  netcdf=1
    4043
    4144  # --->>> ALSO PAY ATTENTION TO OUTPUT files, frequency, level -------------
     
    692695      cat << ...eod >> tmp
    693696      echo "Submitting job tmp_$SIM"
    694       echo "\$SUBMITCMD tmp_$SIM"
    695       \$SUBMITCMD tmp_$SIM
     697      #echo "\$SUBMITCMD tmp_$SIM"
     698      #\$SUBMITCMD tmp_$SIM
     699      echo submitcmd tmp_$SIM"
     700      submitcmd tmp_$SIM
    696701...eod
    697702    fi
     
    701706    enable_platform tmp
    702707    echo "###############################################################################"
    703     echo "Submitting initialisation job <$SUBMITCMD tmp> from $(pwd)"
     708    #echo "Submitting initialisation job <$SUBMITCMD tmp> from $(pwd)"
     709    echo "Submitting initialisation job <submitcmd tmp> from $(pwd)"
    704710    chmod +x tmp
    705     $SUBMITCMD tmp
     711    #$SUBMITCMD tmp
     712    submitcmd tmp
    706713    echo "###############################################################################"
    707714
     
    710717     echo "###############################################################################"
    711718     echo "Submitting job tmp_$SIM"
    712      echo "$SUBMITCMD tmp_$SIM"
    713      $SUBMITCMD "tmp_$SIM"
     719     #echo "$SUBMITCMD tmp_$SIM"
     720     #$SUBMITCMD "tmp_$SIM"
     721     echo "submitcmd tmp_$SIM"
     722     submitcmd "tmp_$SIM"
    714723     echo '###############################################################################'
    715724  fi
Note: See TracChangeset for help on using the changeset viewer.