source: BOL/LMDZ_Setup_amaury/lmdz_env.sh @ 4978

Last change on this file since 4978 was 4978, checked in by abarral, 4 months ago

(WIP) update spirit and adastra-specific params
detect gcm.e compile fail

File size: 3.6 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
54    root_dir=~/"LMDZ_SETUP_ROOT/LMDZ_Setup";
55    ARCH="X64_MESOIPSL-GNU"
56    SIMRUNBASEDIR="$SCRATCH/"
57    LMDZD="$root_dir/LMDZD"
58    LMDZ_INIT="$root_dir/LMDZ_Init"
59    NB_MPI_MAX=20
60    NB_OMP_MAX=1
61    RUNCMD="srun --label -n"
62    SUBMITCMD="sbatch"
63    ;;
64  adast)
65    module purge
66#    module load PrgEnv-gnu
67#    module load cray-hdf5-parallel
68#    module load netcdf-hdf5parallel/gnu/10.3
69
70    account=$(/usr/sbin/my_project.py -l 2>&1 | head -1 | cut -d " " -f 3- | cut -c 5-)
71    root_dir="$WORKDIR/LMDZ_Setup";
72    ARCH="X64_ADASTRA-GNU"
73    SIMRUNBASEDIR="$SCRATCHDIR/"
74    LMDZD="$root_dir/LMDZD"
75    LMDZ_INIT="$root_dir/LMDZ_Init"
76    NB_MPI_MAX=20  # TODO 2000 in JZ
77    NB_OMP_MAX=2  # TODO 20 in JZ
78    RUNCMD="srun --label --account=$account -n"
79    SUBMITCMD="sbatch --account=$account"
80    ;;
81  *) echo "WARNING: RUNNING THIS SCRIPT ON A LOCAL COMPUTER IS DISCOURAGED (lacklusted cpus and memory)"
82    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
83    ARCH="local-gfortran-parallel"
84    SIMRUNBASEDIR="/tmp/SCRATCH/"  # Where the simulations will be executed ($SIMRUNBASEDIR/LMDZ_Setup/...)
85    LMDZD="$root_dir/LMDZD"  # Where the sources will be downloaded and compiled
86    LMDZ_INIT="$root_dir/LMDZ_Init"  # Where to store shared files used for initialisation
87    NB_MPI_MAX=2  # Max number of MPI cores
88    NB_OMP_MAX=1  # Max number of OMP threads
89    RUNCMD="mpirun -np" # command to run a job, as $runcmd <nprocs> <script>
90    SUBMITCMD="."  # command to sumbit a job, as $submitcmd <script>
91    ;;
92esac
93
94if [[ ! (-d $root_dir && -f $root_dir/lmdz_env.sh) ]]; then
95  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
96fi
Note: See TracBrowser for help on using the repository browser.