Changeset 4958 for BOL/LMDZ_Setup_amaury


Ignore:
Timestamp:
Jun 3, 2024, 2:30:11 PM (6 months ago)
Author:
abarral
Message:

(WIP) remove $GROUPE & prepare adastra env

Location:
BOL/LMDZ_Setup_amaury
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • BOL/LMDZ_Setup_amaury/lmdz_env.sh

    r4956 r4958  
    44##############################################################
    55
    6 hostname=$(hostname)
     6if grep -q "Adastra" /etc/motd; then
     7  hostname="adastra"
     8else
     9  hostname=$(hostname)
     10fi
    711echo "Setting up lmdz_env on $hostname"
    812
     
    2832    #   idrproj -d newproj   redefinit "newproj" en tant que  projet actif,
    2933    #        alors $STORE, $WORK etc vont designer les espaces de "newproj")
    30     GROUPE=$(idrproj | grep active | awk '{ print $1}')
    31     SUBMITCMD="sbatch -A $GROUPE@cpu "
     34    account=$(idrproj | grep active | awk '{ print $1}')
     35    SUBMITCMD="sbatch -A $account@cpu "
    3236    RUNCMD="srun --label -n"
    3337    # Espaces suivants definis par defaut en fonction du groupe actif,
     
    4145    #LMDZ_Init sur le $STORE du $groupe
    4246    LMDZ_INIT=$STORE/LMDZ_Init
     47    ;;
     48  adast)
     49#    module purge
     50#    module load PrgEnv-gnu
     51#    module load cray-hdf5-parallel
     52#    module load netcdf-hdf5parallel/gnu/10.3
    4353
    44     JOB_HEADER="#SBATCH -A $groupe@cpu
    45     #@TESTQ#SBATCH --qos=qos_cpu-dev"
    46 
     54    account=$(/usr/sbin/my_project.py -l 2>&1 | head -1 | cut -d " " -f 3- | cut -c 5-)
     55    root_dir="$WORKDIR/LMDZ_Setup";
     56    ARCH="X64_ADASTRA-GNU"
     57    SIMRUNBASEDIR="$SCRATCHDIR/"
     58    LMDZD="$root_dir/LMDZD"
     59    LMDZ_INIT="$root_dir/LMDZ_Init"
     60    NB_MPI_MAX=2000
     61    NB_OMP_MAX=20
     62    RUNCMD="srun --label --account=$account -n"
     63    SUBMITCMD="sbatch --account=$account"
    4764    ;;
    4865  *) echo "WARNING: RUNNING THIS SCRIPT ON A LOCAL COMPUTER IS DISCOURAGED (lacklusted cpus and memory)"
    49     local_env_dir="/home/abarral/PycharmProjects/installLMDZ/LMDZ_Setup"; if [[ ! -d $local_env_dir ]]; then echo "STOP: local_env_dir $local_env_dir not found, either you are running on an unsupported cluster, or you haven't edited lmdz_env.sh properly"; exit 1; fi  # Can't use $(pwd) since this script gets copied and ran from several locations
     66    root_dir="/home/abarral/PycharmProjects/installLMDZ/LMDZ_Setup"; # Where LMDZ_Setup is extracted. Can't use $(pwd) since this script gets copied and ran from several locations
    5067    ARCH="local-gfortran-parallel"
    5168    SIMRUNBASEDIR="/tmp/SCRATCH/"  # Where the simulations will be executed ($SIMRUNBASEDIR/LMDZ_Setup/...)
    52     LMDZD="$local_env_dir/LMDZD"  # Where the sources will be downloaded and compiled
    53     LMDZ_INIT="$local_env_dir/LMDZ_Init"  # Where to store shared files used for initialisation
     69    LMDZD="$root_dir/LMDZD"  # Where the sources will be downloaded and compiled
     70    LMDZ_INIT="$root_dir/LMDZ_Init"  # Where to store shared files used for initialisation
    5471    NB_MPI_MAX=2  # Max number of MPI cores
    5572    NB_OMP_MAX=1  # Max number of OMP threads
    56     GROUPE=""  # the group to execute the job as
    5773    RUNCMD="mpirun -np" # command to run a job, as $runcmd <nprocs> <script>
    5874    SUBMITCMD="."  # command to sumbit a job, as $submitcmd <script>
    5975    ;;
    6076esac
     77
     78if [[ ! (-d $root_dir && -f $root_dir/lmdz_env.sh) ]]; then
     79  echo "STOP: root_dir $root_dir not found, either you are running on an unsupported cluster, or you haven't edited lmdz_env.sh properly"; exit 1
     80fi
  • BOL/LMDZ_Setup_amaury/reb.sh

    r4955 r4958  
    2525## Headers managed by sed
    2626#@JZ#JeanZay
    27 #@JZ#SBATCH -A @@groupe@cpu
    2827#@JZ#SBATCH --job-name=Seq              # nom du job
    2928#@JZ#SBATCH --nodes=1                   # nombre de noeuds
     
    5453
    5554  echo "Submitting the rebuild job $job"
    56   sbatch "$job"
     55  $RUNCMD "$job"
    5756done
  • BOL/LMDZ_Setup_amaury/script_SIMU

    r4956 r4958  
    33#@JZ#JeanZay
    44#@JZ#SBATCH --job-name=NOM_SIMU         # nom du job
    5 #@JZ#SBATCH -A @@groupe@cpu
    65#@JZ# Nombre de processus MPI :
    76#@JZ#SBATCH --ntasks=8
  • BOL/LMDZ_Setup_amaury/setup.sh

    r4956 r4958  
    389389    # Edit reb.sh
    390390    cp reb.sh "$local/$SIM/reb.sh"; chmod +x "$local/$SIM/reb.sh"
    391     sed -i'' -e "s:^rebuild=.*.$:rebuild=$LMDZD/$LMDZname/modipsl/bin/rebuild:" \
    392     -e "s/@@groupe/$GROUPE/" "$local/$SIM/reb.sh"
     391    sed -i'' -e "s:^rebuild=.*.$:rebuild=$LMDZD/$LMDZname/modipsl/bin/rebuild:" "$local/$SIM/reb.sh"
    393392    enable_groupe "$local/$SIM/reb.sh"
    394393
     
    432431  local isotopes="n"
    433432  if [[ $phylmd = "lmdiso" ]]; then isotopes="y"; fi
    434   sed -e "s/@@groupe/$GROUPE/" \
    435   -e "s/NOM_SIMU/$SIM/" \
     433  sed -e "s/NOM_SIMU/$SIM/" \
    436434  -e "s/time=.*.$/time=$cput/" \
    437435  -e "s/ntasks=.*.$/ntasks=$mpi/" \
     
    601599#@JZ#JeanZay
    602600#@JZ#SBATCH --job-name=Init         # nom du job
    603 #@JZ#SBATCH -A "$GROUPE"@cpu
    604601#@JZ#SBATCH --ntasks=1             # Nombre de processus MPI
    605602#@JZ#SBATCH --cpus-per-task=16     # nombre de threads OpenMP
Note: See TracChangeset for help on using the changeset viewer.