source: trunk/LMDZ.COMMON/libf/evolution/deftank/launchPEM.sh @ 3351

Last change on this file since 3351 was 3349, checked in by jbclement, 23 months ago

PEM:
New script called "launchPEM.sh" to launch a chained simulation of PCM/PEM runs:

  • It is far more efficient since it submits a cycle of PCM/PEM dependent jobs waiting in the SLURM queue. Plus, it does not involve a endless running master script;
  • It is more robust and user-friendly since it holds lots of warning/error messages handling different situations. It can take arguments to adapt to the needs of the user. It also creates automotically a script called "kill_launchPEM.sh" to cancel all the current dependent jobs.

There are 3 other files to make it work:

  • "lib_launchPEM.sh" which is the library containing the bash functions used by the script;
  • "jobPCM.slurm" which is the SLURM job script for the PCM used as a template by the script;
  • "jobPEM.slurm" which is the SLURM job script for the PEM used as a template by the script.

More info in the "README" of the deftank.
JBC

  • Property svn:executable set to *
File size: 2.0 KB
Line 
1#!/bin/bash
2########################################################################
3#### Launching script for a chained simulation of PEM and PCM runs  ####
4########################################################################
5# This script can take an argument:
6#   - If there is no argument, then the script initiates a PEM simulation from scratch.
7#   - If the argument is 're', then the script relaunches an existing PEM simulation.
8#     It will ask for parameters to know the starting point that you want to.
9########################################################################
10
11
12########################################################################
13# Modify here the parameters for the simulation
14###############################################
15# Set the number of years to be simulated, either Martian or Earth years:
16n_mars_years=100
17#n_earth_years=300
18
19# Set the number of initial PCM runs:
20nPCM_ini=3
21
22# Set the number of PCM runs between each PEM run:
23nPCM=2
24########################################################################
25
26
27dir=`pwd`
28machine=`hostname`
29user=`whoami`
30if [ ! -f "lib_launchPEM.sh" ]; then
31    echo "Error: file \"lib_launchPEM.sh\" does not exist in $dir!"
32    echo "It can be found in the PEM deftank."
33    exit 1
34fi
35
36source lib_launchPEM.sh
37
38if [ $# -eq 0 ]; then # From scratch
39    echo "The launching script is starting!"
40    echo "The output file is \"log_launchPEM.txt\"."
41    exec > log_launchPEM.txt 2>&1
42    echo "Beginning of the launching script for the PEM simulation."
43    date
44    checklaunch
45    initlaunch
46    cyclelaunch $nPCM_ini
47else
48    if [ $1 = "new" ]; then # New cycle
49        exec >> log_launchPEM.txt 2>&1
50        echo "This is a new cycle for the PEM simulation."
51        date
52        read i_myear n_myear convert_years iPCM iPEM nPCM nPCM_ini < info_PEM.txt
53        cyclelaunch $nPCM
54    elif [ $1 = "re" ]; then # Relaunch
55        echo "Case not coded yet!"
56        errlaunch
57    else
58        echo "Error: given argument '$1' for the launching script is unknown!"
59        errlaunch
60    fi
61fi
Note: See TracBrowser for help on using the repository browser.