Ignore:
Timestamp:
Jun 20, 2024, 5:27:58 PM (6 months ago)
Author:
jbclement
Message:

PEM:

  • Correction of the way the PEM stops before it reaches the SLURM time limit.
  • Small correction for 1D related to r3386.
  • Improvement of launching script.

JBC

Location:
trunk/LMDZ.COMMON/libf/evolution/deftank
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.COMMON/libf/evolution/deftank/jobPEM.slurm

    r3386 r3387  
    3737read i_myear n_myear convert_years iPCM iPEM nPCM nPCM_ini < info_PEM.txt
    3838cp run_PEM.def run.def
    39 ./$exePEM > out_runPEM${iPEM} 2>&1
     39./$exePEM $SLURM_JOB_ID > out_runPEM${iPEM} 2>&1
    4040if [ ! -f "restartfi.nc" ] || ! (tail -n 1 out_runPEM${iPEM} | grep -iq "so far, so good!"); then # Check if it ended abnormally
    4141    echo "Error: the run PEM $iPEM crashed!"
  • trunk/LMDZ.COMMON/libf/evolution/deftank/lib_launchPEM.sh

    r3386 r3387  
    153153        echo "Run PCM $iPCM: call $ii/$1..."
    154154        cp jobPCM.slurm jobPCM${iPCM}.slurm
    155         sed -i "s/#SBATCH --job-name=jobPCM.*/#SBATCH --job-name=jobPCM${iPCM}/" jobPCM${iPCM}.slurm
     155        sed -i -E "s/(#SBATCH --job-name=[^0-9]*[0-9]*[^0-9]*)[0-9]+$/\1${iPCM}/" jobPCM${iPCM}.slurm
    156156        sed -i "s/^k=[0-9]\+$/k=$(echo "3 - $nPCM_ini" | bc -l)/" jobPCM${iPCM}.slurm
    157157        jobID=$(sbatch --parsable jobPCM${iPCM}.slurm)
     
    170170            echo "Run PCM $iPCM: call $i/$1..."
    171171            cp jobPCM.slurm jobPCM${iPCM}.slurm
    172             sed -i "s/#SBATCH --job-name=jobPCM.*/#SBATCH --job-name=jobPCM${iPCM}/" jobPCM${iPCM}.slurm
     172            sed -i -E "s/(#SBATCH --job-name=[^0-9]*[0-9]*[^0-9]*)[0-9]+$/\1${iPCM}/" jobPCM${iPCM}.slurm
    173173            sed -i "s/^k=[0-9]\+$/k=$(echo "$i + 2 - $nPCM_ini" | bc -l)/" jobPCM${iPCM}.slurm
    174174            jobID=$(sbatch --parsable --dependency=afterok:${jobID} jobPCM${iPCM}.slurm)
     
    186186    if [ $i_myear -lt $n_myear ]; then
    187187        echo "Run PEM $iPEM"
    188         sed -i "s/#SBATCH --job-name=jobPEM.*/#SBATCH --job-name=jobPEM${iPEM}/" jobPEM.slurm
     188        sed -i -E "s/(#SBATCH --job-name=[^0-9]*[0-9]*[^0-9]*)[0-9]+$/\1${iPEM}/" jobPEM.slurm
    189189        jobID=$(sbatch --parsable jobPEM.slurm)
    190190        # Create a file to cancel the dependent jobs of the cycle
     
    207207    if [ $i_myear -lt $n_myear ]; then
    208208        echo "Run PEM $iPEM"
    209         sed -i "s/#SBATCH --job-name=jobPEM.*/#SBATCH --job-name=jobPEM${iPEM}/" jobPEM.slurm
     209        sed -i -E "s/(#SBATCH --job-name=[^0-9]*[0-9]*[^0-9]*)[0-9]+$/\1${iPEM}/" jobPEM.slurm
    210210        jobID=$(sbatch --parsable --dependency=afterok:${jobID} jobPEM.slurm)
    211211        echo "scancel" $jobID >> kill_launchPEM.sh
Note: See TracChangeset for help on using the changeset viewer.