source: BOL/LMDZ_Setup_amaury/lmdz_env.sh @ 4989

Last change on this file since 4989 was 4980, checked in by abarral, 18 months ago

(WIP) update spirit arch
update script_SIMU env
fix setup.sh, add netcdf option
fix aerosols detection

File size: 3.7 KB
Line 
1
2##############################################################
3# Gestion des modules
4##############################################################
5
6if grep -q "Adastra" /etc/motd; then
7  hostname="adastra"
8else
9  hostname=$(hostname)
10fi
11echo "Setting up lmdz_env on $hostname"
12
13# Platform-specific
14case ${hostname:0:5} in
15  jean-)
16    ARCH="X64_JEANZAY"
17    module purge
18    compilo=19.0.4 # available 2013.0, 2017.2
19    module load intel-compilers/$compilo
20    #module load intel-mpi/$compilo
21    module load intel-mkl/$compilo
22    module load hdf5/1.10.5-mpi
23    module load netcdf/4.7.2-mpi
24    module load netcdf-fortran/4.5.2-mpi
25    module load subversion/1.9.7
26    #Pour module gcc, voir : https://trac.lmd.jussieu.fr/LMDZ/wiki/PortageJeanZay
27    #module load gcc/6.5.0
28    module load nco
29    module load cdo
30    # Imputation de la consommation sur le groupe (projet) actif par defaut,
31    #   idrproj indique le groupe (projet) actif par defaut
32    #   idrproj -d newproj   redefinit "newproj" en tant que  projet actif,
33    #        alors $STORE, $WORK etc vont designer les espaces de "newproj")
34    account=$(idrproj | grep active | awk '{ print $1}')
35    SUBMITCMD="sbatch -A $account@cpu "
36    RUNCMD="srun --label -n"
37    # Espaces suivants definis par defaut en fonction du groupe actif,
38    #  par exemple : SCRATCHD=$SCRATCH is /gpfsstore/rech/$groupe/$login
39                #    * On peut aussi ne pas installer les scripts a la racine de STORE,
40                #        mais dans STORED=$STORE/your_folder
41    SIMRUNBASEDIR="$SCRATCH/LMDZ_Setup"
42    LMDZD=$WORK
43    NB_MPI_MAX=2000
44    NB_OMP_MAX=20
45    #LMDZ_Init sur le $STORE du $groupe
46    LMDZ_INIT=$STORE/LMDZ_Init
47    ;;
48  spiri)
49    module purge
50    module load subversion/1.13.0
51    module load gcc/11.2.0
52    module load openmpi/4.0.7
53    module load cdo/2.3.0
54
55    root_dir=~/"LMDZ_SETUP_ROOT/LMDZ_Setup";
56    ARCH="X64_MESOIPSL-GNU"
57    SIMRUNBASEDIR="$SCRATCH/"
58    LMDZD="$root_dir/LMDZD"
59    LMDZ_INIT="$root_dir/LMDZ_Init"
60    NB_MPI_MAX=20
61    NB_OMP_MAX=1
62    RUNCMD="mpirun -n"  # on spirit, we can't run MPI using srun from within sbatch
63    SUBMITCMD="sbatch"
64    ;;
65  adast)
66    module purge
67#    module load PrgEnv-gnu
68#    module load cray-hdf5-parallel
69#    module load netcdf-hdf5parallel/gnu/10.3
70
71    account=$(/usr/sbin/my_project.py -l 2>&1 | head -1 | cut -d " " -f 3- | cut -c 5-)
72    root_dir="$WORKDIR/LMDZ_Setup";
73    ARCH="X64_ADASTRA-GNU"
74    SIMRUNBASEDIR="$SCRATCHDIR/"
75    LMDZD="$root_dir/LMDZD"
76    LMDZ_INIT="$root_dir/LMDZ_Init"
77    NB_MPI_MAX=20  # TODO 2000 in JZ
78    NB_OMP_MAX=2  # TODO 20 in JZ
79    RUNCMD="srun --label --account=$account -n"
80    SUBMITCMD="sbatch --account=$account"
81    ;;
82  *) echo "WARNING: RUNNING THIS SCRIPT ON A LOCAL COMPUTER IS DISCOURAGED (lackluster cpus and memory)"
83    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
84    ARCH="local-gfortran-parallel"
85    SIMRUNBASEDIR="/tmp/SCRATCH/"  # Where the simulations will be executed ($SIMRUNBASEDIR/LMDZ_Setup/...)
86    LMDZD="$root_dir/LMDZD"  # Where the sources will be downloaded and compiled
87    LMDZ_INIT="$root_dir/LMDZ_Init"  # Where to store shared files used for initialisation
88    NB_MPI_MAX=2  # Max number of MPI cores
89    NB_OMP_MAX=1  # Max number of OMP threads
90    RUNCMD="mpirun -np" # command to run a job, as $runcmd <nprocs> <script>
91    SUBMITCMD="."  # command to sumbit a job, as $submitcmd <script>
92    ;;
93esac
94
95if [[ ! (-d $root_dir && -f $root_dir/lmdz_env.sh) ]]; then
96  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
97fi
Note: See TracBrowser for help on using the repository browser.