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

Changing $SUBMITCMD to a function submitcmd

Need for local use of LMDZ

File:
1 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
Note: See TracChangeset for help on using the changeset viewer.