From 6057ac55227a33d720e0f298f091f7deaf4256ec Mon Sep 17 00:00:00 2001 From: Paul Gierz Date: Mon, 31 Jul 2023 13:53:39 +0200 Subject: [PATCH] no more ollie --- work/job_ini_ollie | 31 ----- work/job_ollie | 34 ----- work/job_ollie_chain | 317 ------------------------------------------- 3 files changed, 382 deletions(-) delete mode 100755 work/job_ini_ollie delete mode 100755 work/job_ollie delete mode 100755 work/job_ollie_chain diff --git a/work/job_ini_ollie b/work/job_ini_ollie deleted file mode 100755 index 693296bad..000000000 --- a/work/job_ini_ollie +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash -#SBATCH --job-name=fesom2.0_INI -#SBATCH -p mpp -#SBATCH --ntasks=32 -#SBATCH --time=12:00:00 -#SBATCH -o slurm-out.out -#SBATCH -e slurm-err.out - -set -x - -ulimit -s unlimited - -module purge -module load intel.compiler -module load intel.mpi -module load netcdf/4.4.0_intel - -ln -s ../bin/fesom_ini.x . # cp -n ../bin/fvom_ini.x -cp -n ../config/namelist.config . -cp -n ../config/namelist.forcing . -cp -n ../config/namelist.oce . -cp -n ../config/namelist.ice . - - -# determine JOBID -JOBID=`echo $SLURM_JOB_ID |cut -d"." -f1` - -date -srun --mpi=pmi2 --ntasks=1 ./fesom_ini.x > "fvom_ini.out" -date - diff --git a/work/job_ollie b/work/job_ollie deleted file mode 100755 index ac2516115..000000000 --- a/work/job_ollie +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -#SBATCH --job-name=fesom2.0 -#SBATCH -p mpp -#SBATCH --ntasks=288 -#SBATCH --time=00:05:00 -#SBATCH -o slurm-out.out -#SBATCH -e slurm-err.out -module load intel.compiler intel.mpi netcdf/4.4.0_intel -module load centoslibs - -set -x - -ulimit -s unlimited - -# determine JOBID -JOBID=`echo $SLURM_JOB_ID |cut -d"." -f1` - -ln -s ../bin/fesom.x . # cp -n ../bin/fesom.x -cp -n ../config/namelist.config . -cp -n ../config/namelist.forcing . -cp -n ../config/namelist.oce . -cp -n ../config/namelist.ice . -cp -n ../config/namelist.io . -cp -n ../config/namelist.icepack . - -date -srun --mpi=pmi2 ./fesom.x > "fesom2.0.out" -date - -#qstat -f $PBS_JOBID -#export EXITSTATUS=$? -#if [ ${EXITSTATUS} -eq 0 ] || [ ${EXITSTATUS} -eq 127 ] ; then -#sbatch job_ollie -#fi diff --git a/work/job_ollie_chain b/work/job_ollie_chain deleted file mode 100755 index 8f98f1515..000000000 --- a/work/job_ollie_chain +++ /dev/null @@ -1,317 +0,0 @@ -#!/bin/bash -#___SET SLURM OPTIONS___________________________________________________________ -#SBATCH -J chain -#SBATCH -p mpp -#SBATCH --ntasks=432 -#SBATCH --time=10:00:00 -#SBATCH --mail-type=END -#SBATCH --mail-user=Patrick.Scholz@awi.de -#SBATCH -o fesom2.0_%x_%j.out -#SBATCH -e fesom2.0_%x_%j.out - -## module load intel.compiler intel.mpi netcdf centoslibs - -#___DEFAULT INPUT_______________________________________________________________ -# how many job chains should be applied -chain_n=3 # number chain cycles -chain_s=1 # starting chain id - -# time frame of model simulation -# ___COREv2___ -year_s=1948 -year_e=2009 -# ___JRA55____ -#year_s=1958 -#year_e=2018 - -prescribe_rlen=0 # run length in namelist.config --> if 0 value from namelist.config is taken -fedit=1 - -#___HELP OUTPUT_________________________________________________________________ -script_name=job_ollie_chain -function usage { - echo "usage: $script_name [-cn ...] [-cs ...] [-ys ...] [-ye ...] [-wcl ...]" - echo " -cn number of chain cylces (default: 3)" - echo " -cs starting chain id (default: 1)" - echo " -ys starting year of model simulation (default: 1948)" - echo " -ye ending year of model simulation (default: 2009)" - echo " -h display help" - echo " -rl prescribe used run_length" - echo " -noedit no automatic editing of namelist.config" - echo - echo " --> for changing the wall-clock-time interactively use " - echo " sbatch --time=00:10:00 job_ollie_chain ..." - echo " --> for changing the number of task interactively use " - echo " sbatch --ntask=288 job_ollie_chain ..." - echo " --> for changing the job name interactively use " - echo " sbatch --job-name=whatever job_ollie_chain ..." - exit 1 -} - -#___OVERRIDE DEFAULT INPUT BY COMMANDLINE INPUT_________________________________ -while [ "$1" != "" ]; do - case $1 in - -cn | -chain_n ) shift ; chain_n=$1 ;; - -cs | -chain_s ) shift ; chain_s=$1 ;; - -ys | -year_s ) shift ; year_s=$1 ;; - -ye | -year_e ) shift ; year_e=$1 ;; - -rl | --run_length ) shift ; prescribe_rlen=$1 ;; - -noedit | --noedit ) fedit=0 ;; - -h | --help ) usage ; exit ;; - esac - shift -done - -#___EXTRACT WALL-CLOCK-TIME FROM JOBINFO________________________________________ -# either setted via #SBATCH time=... or at command line sbatch --time=... job_ollie_chain -# need here to extract to give the next job chain cycle as input -jobinfo=$(scontrol show job $SLURM_JOB_ID) -wcl=$( echo ${jobinfo##*"TimeLimit="} | cut -d " " -f 1 ) -ntasks=$( echo ${jobinfo##*"NumTasks="} | cut -d " " -f 1 ) - - -#___SET NAMELIST'S & EXECUTABLE IF NOT ALREADY EXIST____________________________ -set -x -ulimit -s unlimited -ln -s ../bin/fesom.x . # cp -n ../bin/fvom_ini.x -cp -n ../config/namelist.config . -cp -n ../config/namelist.forcing . -cp -n ../config/namelist.oce . -cp -n ../config/namelist.ice . - -#___SET CHAIN_ID________________________________________________________________ -if [ -f "file_chain_id" ]; then - chain_id=$( file_chain_id -fi - -#___PRINT INPUT INFO____________________________________________________________ -echo -e "\033[1;7;33m_____JOB CHAIN INFO_____________________________________\033[0m" -echo -e "\033[1;33m --> actual chain cycle: $chain_id \033[0m" -echo -e "\033[1;33m --> max. number of chain cycles: $chain_n \033[0m" -echo -e "\033[1;33m --> simulated time range: [ $year_s $year_e] \033[0m" -echo -e "\033[1;33m --> slurm: wall-clock-time = $wcl \033[0m" -echo -e "\033[1;33m --> slurm: ntask = $ntasks \033[0m" -if [ $prescribe_rlen -ne 0 ]; then - echo -e "\033[1;33m -->change run_length = $prescribe_rlen \033[0m" -fi - -#___CREATE SAVE DIR INFRASTRUCTURE______________________________________________ -# extract resultpath from namelist.config -dname_result_link_orig=$(grep "ResultPath=" namelist.config | grep -v '^!' | \ - cut -d "=" -f 2 | \ - cut -d "'" -f 2) -dname_result_link=$(echo ${dname_result_link_orig::-1}) - -# identify higher directory --> ResultPath -dname_result="$(dirname "$dname_result_link")/" - -# if ResultPath directory doesn't exist --> create it -if [ ! -d "${dname_result}" ]; then - echo -e "\033[33m --> ResultPath directory does not exist --> will create it \033[0m" - mkdir "${dname_result}" -fi - -# check if in namelist.config a chain path is given (that mean -# ResultPath=.../ResultDir/chain/) if not change namelist.config accordingly -check=${dname_result_link##*${dname_result}} -if [ $fedit -eq 1 ] && [ $check != "chain" ]; then - echo -e "\033[33m --> replace in namelist.config ResultPath with chain path \033[0m" - dname_result_link="${dname_result}chain" - sed -i "s|${dname_result_link_orig}|${dname_result_link}/|g" namelist.config -fi - -# identify real path in case a link is used -dname_result="$(realpath "$dname_result")/" - -# if directory for chain_id doesn't exist --> create it -if [ ! -d "${dname_result}/${chain_id}" ]; then - echo -e "\033[33m --> chain_id directory does not exist --> will create it \033[0m" - mkdir "${dname_result}/${chain_id}" -fi - -# link directory of chain_id with original linkdirectory from namelist.config -ln -sfn ${dname_result}${chain_id} $dname_result_link - -#___CHECK IF SIMULATION NEEDS TO BE INITIALISED OR CONTINUED____________________ -is_newsimul=1 -if [ -f "$dname_result_link/fesom.clock" ] ; then - aux_yr_clock=$(<${dname_result_link}/fesom.clock) - aux_yr_clock=$(echo ${aux_yr_clock} | cut -d" " -f 6) - if [ $aux_yr_clock -le $year_e ]; then is_newsimul=0 ; fi - - #___________________________________________________________________________ - if [ $fedit -eq 1 ] ; then - if [ $is_newsimul -eq 0 ] ; then - year_d=$(( $year_e - $aux_yr_clock + 1 )) - rlen=$(grep "run_length=" namelist.config | cut -d "=" -f 2 | cut -d " " -f 1) - # do not prescribe run length in job fle - if [ $prescribe_rlen -eq 0 ] ; then - if [ $rlen -ne $year_d ] ; then - sed -i " s/run_length=$rlen/run_length=$year_d/" namelist.config - echo -e "\033[1;33m --> change run_length to: $year_d \033[0m" - fi - # prescribe run length in job fle - else - aux_year_d=$prescribe_rlen - if [ $year_d -lt $aux_year_d ] ; then aux_year_d=$year_d ; fi - if [ $rlen -ne $year_d ] ; then - sed -i " s/run_length=$rlen/run_length=$aux_year_d/" namelist.config - echo -e "\033[1;33m --> change run_length to: $aux_year_d \033[0m" - fi - fi - fi - fi -else - #___________________________________________________________________________ - # set model run length in job_script and change namelist.config accordingly - # to match - if [ $fedit -eq 1 ] ; then - year_d=$(( $year_e - $year_s + 1 )) - rlen=$(grep "run_length=" namelist.config | cut -d "=" -f 2 | cut -d " " -f 1) - # do not prescribe run length in job fle - if [ $prescribe_rlen -eq 0 ] ; then - if [ $rlen -ne $year_d ] ; then - sed -i " s/run_length=$rlen/run_length=$year_d/" namelist.config - echo -e "\033[1;33m --> change run_length to: $year_d \033[0m" - fi - # prescribe run length in job file - else - aux_year_d=$prescribe_rlen - if [ $year_d -lt $aux_year_d ] ; then aux_year_d=$year_d ; fi - if [ $rlen -ne $year_d ] ; then - sed -i " s/run_length=$rlen/run_length=$aux_year_d/" namelist.config - echo -e "\033[1;33m --> change run_length to: $aux_year_d \033[0m" - fi - fi - fi -fi - -#___CREATE CLOCK & RESTART INFRASTRUCTURE FOR COLD/WARM START___________________ -# only touch clock file when a new simulation is supposed to start, if an old one -# should be continued dont touch it -if [ $is_newsimul -eq 1 ] ; then - - # --> make cold start - if [ $chain_id -eq 1 ] ; then - #_______________________________________________________________________ - # create cold start clock file - echo -e "\033[33m --> create cold start clock file \033[0m" - printf "0 1 ${year_s}\n0 1 ${year_s}" > $dname_result_link/fesom.clock - - #_______________________________________________________________________ - # in case yearnew in namelist.config was changed from 1948 - yearnew=$(grep "yearnew=" namelist.config | cut -d "=" -f 2) - if [ $yearnew -ne $year_s ]; then - sed -i " s/yearnew=$yearnew/yearnew=$year_s/" namelist.config - fi - - #___BACKUP NAMELIST.* FILES INTO RESULT DIRECTORY_______________________ - cp namelist.config namelist.oce namelist.ice namelist.forcing namelist.io \ - namelist.cvmix namelist.tra namelist.dyn ${dname_result}/. - cp fesom.x ${dname_result}/. - - #___BACKUP SRC FILES INTO RESULT DIRECTORY______________________________ - if [ ! -d "${dname_result}/src" ]; then mkdir "${dname_result}/src" ; fi - cp ../src/*.F90 ${dname_result}/src/. - - - # --> make warm start - else - #_______________________________________________________________________ - # create warm start clock file - stepperday=$(grep "step_per_day=" namelist.config | cut -d "=" -f 2 | cut -d " " -f 1 ) - aux_sec=$(( 86400 - 86400 / $stepperday )) - aux_day=365 - aux_yr=$(( $year_s - 1 )) - echo -e "\033[33m --> create warm start clock file \033[0m" - printf "${aux_sec} ${aux_day} ${aux_yr}\n0 1 ${year_s}" > $dname_result_link/fesom.clock - - #_______________________________________________________________________ - # chain id from previous spinup cycle - prev_chain_id=$(( $chain_id - 1 )) - - #_______________________________________________________________________ - # copy restart ocean files/directories from previous spinup cycle - prev_rfile=${dname_result}${prev_chain_id}/fesom.${year_e}.oce.restart - if [ -d "${prev_rfile}" ]; then - cp -r ${prev_rfile} ${dname_result_link}/fesom.${aux_yr}.oce.restart - elif [ -f "${prev_rfile}.nc" ]; then - cp ${prev_rfile}.nc ${dname_result_link}/fesom.${aux_yr}.oce.restart.nc - else - echo -e "\033[1;31m --> ERROR: could not find ocean restart file \033[0m" - exit - fi - - # copy restart ice files/files/directories from previous spinup cycle - prev_rfile=${dname_result}${prev_chain_id}/fesom.${year_e}.ice.restart - if [ -d "${prev_rfile}" ]; then - cp -r ${prev_rfile} ${dname_result_link}/fesom.${aux_yr}.ice.restart - elif [ -f "${prev_rfile}.nc" ]; then - cp ${prev_rfile}.nc ${dname_result_link}/fesom.${aux_yr}.ice.restart.nc - else - echo -e "\033[1;31m --> ERROR: could not find ice restart file \033[0m" - exit - fi - - #_______________________________________________________________________ - # adapt year new in namelist.config otherwise fesom is not doing a - # restart - aux=$(grep "yearnew=" namelist.config | cut -d "=" -f 2 | cut -d " " -f 1 ) - sed -i " s/yearnew=$aux/yearnew=$aux_yr/" namelist.config - - #_______________________________________________________________________ - # backup namelist.* & fesom.x in case they dont exist - if [ ! -f "${dname_result}/namelist.config" ]; then - cp namelist.config namelist.oce namelist.ice namelist.forcing namelist.io \ - namelist.cvmix namelist.tra namelist.dyn ${dname_result}/. - fi - if [ ! -f "${dname_result}/fesom.x" ]; then - cp fesom.x ${dname_result}/. - fi - #___BACKUP SRC FILES INTO RESULT DIRECTORY______________________________ - if [ ! -d "${dname_result}/src" ]; then mkdir "${dname_result}/src" ; fi - cp ../src/*.F90 ${dname_result}/src/. - fi -fi - -#___DETERMINE SLURM JOBID+OUTPUTFILE____________________________________________ -jobid=$(echo $SLURM_JOB_ID | cut -d"." -f1) -fname="fesom2.0_${SLURM_JOB_NAME}_${jobid}.out" - -#___PUT JOB IN QUEUE____________________________________________________________ -date -srun --mpi=pmi2 ./fesom.x >> ${fname} -err_srun=$? -echo -e "\033[33m --> err_srun=${err_srun} \033[0m" -date - -#___SHOW JOB INFORMATION________________________________________________________ -scontrol show job $SLURM_JOB_ID - -#___SETUP JOBCHAIN______________________________________________________________ -# check if complete cycle is finished only than increase chain_id -aux_yr_clock=$(<${dname_result_link}/fesom.clock) -aux_yr_clock=$(echo ${aux_yr_clock} | cut -d" " -f 6) - -# setup next chain job via dependence -if [ ${err_srun} -eq 0 ]; then - if [ $aux_yr_clock -lt $year_e ] || [ ${chain_id} -lt ${chain_n} ]; then - # aftercorr:job_id --> A task of this job array can begin execution after - # the corresponding task ID in the specified job has completed successfully - # (ran to completion with an exit code of zero). - echo -e "\033[33m --> setup next chain cycle \033[0m" - sbatch --time=$wcl --ntasks=$ntasks --job-name=${SLURM_JOB_NAME} --dependency=aftercorr:$SLURM_JOB_ID $script_name \ - -cn $chain_n -cs $chain_s -ys $year_s -ye $year_e -rl $prescribe_rlen - fi -fi - -#___CHECK FOR COMPLETNES________________________________________________________ -# check if complete cycle is finished only than increase chain_id -if [ $aux_yr_clock -gt $year_e ] && [ ${chain_id} -lt ${chain_n} ] ; then - chain_id=$(( $chain_id + 1 )) - echo $chain_id > file_chain_id -fi -