source: trunk/LMDZ.COMMON/libf/evolution/deftank/PCMrun.job @ 3865

Last change on this file since 3865 was 3861, checked in by jbclement, 6 months ago

PEM:

  • Big update of "README" file in the "deftank" folder.
  • Renaming the log files "out_run*" into "run.log".
  • Merging the folders "out_PCM" and "out_PEM" into "logs" where the log files are gathered with convenient renaming.
  • Update of job files.
  • More robust tests in "lib_launchPEM.sh".

JBC

  • Property svn:executable set to *
File size: 2.5 KB
Line 
1#!/bin/bash
2#SBATCH --job-name=jobPCM0
3#SBATCH --account=cin0391
4#SBATCH --constraint=GENOA
5### Number of nodes/cores to use
6#SBATCH --nodes=1
7#SBATCH --ntasks-per-node=24
8#SBATCH --cpus-per-task=8
9#SBATCH --threads-per-core=1 # --hint=nomultithread
10###SBATCH --exclusive
11#SBATCH --output=jobPCM_%j.out
12#SBATCH --time=4:00:00
13
14########################################################################
15# Modify here the parameters depending on your setup
16####################################################
17# Path to the arch.env to source:
18source ../trunk/LMDZ.COMMON/arch.env
19
20# Number of threads to use (must be the same as "#SBATCH --cpus-per-task=" above)
21export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK
22export OMP_STACKSIZE=400M
23
24# Name of executable for the PCM:
25exePCM="gcm_64x48x32_phymars_para.e"
26
27# Execution command:
28exe_cmd="srun --ntasks-per-node=${SLURM_NTASKS_PER_NODE} --cpu-bind=none --mem-bind=none --label -- ./adastra_cpu_binding.sh ./$exePCM"
29########################################################################
30
31
32ulimit -s unlimited
33
34# Running the PCM
35read i_myear n_myear convert_years iPCM iPEM nPCM nPCM_ini < info_PEM.txt
36echo "Run \"PCM $iPCM\" is starting."
37cp run_PCM.def run.def
38eval "$exe_cmd > run.log 2>&1"
39if [ ! -f "restartfi.nc" ] || ! (tail -n 100 run.log | grep -iq "everything is cool!"); then # Check if it ended abnormally
40    echo "Error: the run \"PCM $iPCM\" crashed!"
41    if [ $mode -ne 0 ]; then
42        echo "Be careful: there may be dependent jobs remaining in the queue! You can cancel them by executing the script \"kill_launchPEM.sh\"."
43    fi
44    exit 1
45fi
46
47# Copy data files and prepare the next run
48mv run.log logs/runPCM${iPCM}.log
49if [ -f "diagfi.nc" ]; then
50    mv diagfi.nc diags/diagfi${iPCM}.nc
51fi
52if [ -f "diagsoil.nc" ]; then
53    mv diagsoil.nc diags/diagsoil${iPCM}.nc
54fi
55if [ -f "stats.nc" ]; then
56    mv stats.nc diags/stats${iPCM}.nc
57fi
58k=0
59if [ $(echo "$k > 0" | bc) -eq 1 ]; then # Only the last 2 years are taken for the PEM
60    cp Xdiurnalave.nc data2reshape_Y${k}.nc
61fi
62mv Xdiurnalave.nc diags/data2reshape${iPCM}.nc
63cp restartfi.nc starts/restartfi${iPCM}.nc
64mv restartfi.nc startfi.nc
65if [ -f "restart.nc" ]; then
66    cp restart.nc starts/restart${iPCM}.nc
67    mv restart.nc start.nc
68elif [ -f "restart1D.txt" ]; then
69    cp restart1D.txt starts/restart1D${iPCM}.txt
70    mv restart1D.txt start1D.txt
71fi
72((iPCM++))
73if [ $counting -ne 0 ]; then
74    i_myear=$(echo "$i_myear + 1." | bc -l)
75fi
76sed -i "1s/.*/$i_myear $n_myear $convert_years $iPCM $iPEM $nPCM $nPCM_ini/" info_PEM.txt
Note: See TracBrowser for help on using the repository browser.