source: trunk/LMDZ.COMMON/libf/evolution/deftank/PEMrun.job @ 3554

Last change on this file since 3554 was 3495, checked in by jbclement, 7 weeks ago

PEM:
Modifications related to the launching script:

  • There is actually no launching difference between the 1D and 3D models. It is more about how and where you want to execute. So now, the user can choose between two launching modes with the parameter "mode" (0 = "processing scripts"; any other values = "submitting jobs"). The former option is usually used to process the script on a local machine while the latter is used to submit jobs on supercomputer;
  • The execution command line in the job scripts that should be modified by the user according to the set-up is now given as an argument at the beginning to be more identifiable and adaptable;
  • Making the job scripts more robust to detect a successful end.

JBC

  • Property svn:executable set to *
File size: 2.4 KB
RevLine 
[3349]1#!/bin/bash
[3351]2#SBATCH --job-name=jobPEM1
[3349]3#SBATCH --account=cin0391
4### GENOA nodes accommodate 96 cores
5#SBATCH --constraint=GENOA
6### Number of Nodes to use
[3417]7#SBATCH --nodes=1
[3416]8#SBATCH --ntasks=1
[3417]9#SBATCH --cpus-per-task=1
[3349]10###SBATCH --exclusive
[3403]11#SBATCH --output=jobPEM_%j.out
[3351]12#SBATCH --time=24:00:00
[3416]13#SBATCH --mem=29000M
[3349]14
[3351]15# A few parameters that might need to be changed depending on your setup
16# Path to the arch.env to source:
[3349]17source ../trunk/LMDZ.COMMON/arch.env
18
[3351]19# Name of executable for the PEM:
20exePEM="pem_64x48x32_phymars_seq.e"
[3349]21
[3351]22# Name of executable for reshaping PCM data with XIOS:
23exeReshape="reshape_XIOS_output_64x48x32_phymars_seq.e"
[3495]24
25# Argument for the PEM execution (for SLURM: "$SLURM_JOB_ID" | for PBD/TORQUE: "$PBS_JOBID" | "" when the script is not run as a job):
26arg_pem="$SLURM_JOB_ID"
[3349]27########################################################################
28
[3351]29
[3403]30ulimit -s unlimited
31
[3354]32# Reshaping PCM data with XIOS
[3351]33echo "Reshaping PCM data with XIOS is starting."
34./$exeReshape
[3349]35if [ ! -f "data_PCM_Y1.nc" ] || [ ! -f "data_PCM_Y2.nc" ]; then # Check if it ended abnormally
36    echo "Error: the reshaping executable crashed!"
37    exit 1
38fi
[3351]39
[3354]40# Running the PEM
[3416]41read i_myear n_myear convert_years iPCM iPEM nPCM nPCM_ini < info_PEM.txt
[3349]42echo "Run PEM $iPEM is starting."
[3351]43cp run_PEM.def run.def
[3495]44eval "./$exePEM $arg_pem > out_runPEM${iPEM} 2>&1"
45if [ ! -f "restartfi.nc" ] || ! (tail -n 100 out_runPEM${iPEM} | grep -iq "so far, so good!"); then # Check if it ended abnormally
[3349]46    echo "Error: the run PEM $iPEM crashed!"
47    exit 1
48fi
[3354]49
[3349]50# Copy data files and prepare the next run
51mv out_runPEM${iPEM} out_PEM/run${iPEM}
[3386]52if [ -f "diagpem.nc" ]; then
53    mv diagpem.nc diags/diagpem${iPEM}.nc
54fi
[3349]55if [ -f "diagsoilpem.nc" ]; then
56    mv diagsoilpem.nc diags/diagsoilpem${iPEM}.nc
57fi
58cp restartpem.nc starts/restartpem${iPEM}.nc
59mv restartpem.nc startpem.nc
60cp restartfi.nc starts/restartfi_postPEM${iPEM}.nc
61mv restartfi.nc startfi.nc
62if [ -f "restart.nc" ]; then
63    cp restart.nc starts/restart_postPEM${iPEM}.nc
64    mv restart.nc start.nc
65elif [ -f "restart1D.txt" ]; then
66    cp restart1D.txt starts/restart1D_postPEM${iPEM}.txt
67    mv restart1D.txt start1D.txt
68fi
69
[3363]70# Launch the next cycle
71#if [ "$(awk 'END{print $NF}' info_PEM.txt)" -eq 7 ]; then
72#    read i_myear n_myear convert_years iPCM iPEM nPCM nPCM_ini < info_PEM.txt
73#    ./launchPEM.sh cont # Continue the PEM run if it stopped because of job time limit
74#else
75    ./launchPEM.sh new
76#fi
Note: See TracBrowser for help on using the repository browser.