1 | |
---|
2 | ############################################################## |
---|
3 | # Gestion des modules |
---|
4 | ############################################################## |
---|
5 | |
---|
6 | if grep -q "Adastra" /etc/motd; then |
---|
7 | hostname="adastra" |
---|
8 | else |
---|
9 | hostname=$(hostname) |
---|
10 | fi |
---|
11 | echo "Setting up lmdz_env on $hostname" |
---|
12 | |
---|
13 | # Platform-specific |
---|
14 | case ${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 | adast) |
---|
49 | # module purge |
---|
50 | # module load PrgEnv-gnu |
---|
51 | # module load cray-hdf5-parallel |
---|
52 | # module load netcdf-hdf5parallel/gnu/10.3 |
---|
53 | |
---|
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" |
---|
64 | ;; |
---|
65 | *) echo "WARNING: RUNNING THIS SCRIPT ON A LOCAL COMPUTER IS DISCOURAGED (lacklusted cpus and memory)" |
---|
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 |
---|
67 | ARCH="local-gfortran-parallel" |
---|
68 | SIMRUNBASEDIR="/tmp/SCRATCH/" # Where the simulations will be executed ($SIMRUNBASEDIR/LMDZ_Setup/...) |
---|
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 |
---|
71 | NB_MPI_MAX=2 # Max number of MPI cores |
---|
72 | NB_OMP_MAX=1 # Max number of OMP threads |
---|
73 | RUNCMD="mpirun -np" # command to run a job, as $runcmd <nprocs> <script> |
---|
74 | SUBMITCMD="." # command to sumbit a job, as $submitcmd <script> |
---|
75 | ;; |
---|
76 | esac |
---|
77 | |
---|
78 | if [[ ! (-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 |
---|
80 | fi |
---|