File tree Expand file tree Collapse file tree 8 files changed +45
-3
lines changed Expand file tree Collapse file tree 8 files changed +45
-3
lines changed Original file line number Diff line number Diff line change 11# logs
22ctl /logs
3+ ctl /job_status.log
34# run directories
45run /
56# data directories
Original file line number Diff line number Diff line change @@ -62,6 +62,9 @@ pfl_node=2
6262# DebugMode: No job submission. Just config
6363debugmode=false
6464
65+ # log job status
66+ joblog=true
67+
6568# ##########################################
6669
6770# ##
182185 source ${ctl_dir} /pre_ctl/pre.job
183186fi
184187
185- echo $submit_pre " for preprocessing"
186-
187188# get jobid
188189pre_id=$( echo $submit_pre | awk ' END{print $(NF)}' )
189190
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ IFS=' ' read -r -a lvis <<< "$lvisstr"
1818# ##
1919# source environment
2020# ##
21+ timestart=$( date +%s)
2122source ${tsmp2_env} # should be changed to post-processing env.
2223
2324# ##
@@ -57,4 +58,10 @@ pos_cleanup
5758
5859fi # cleanup
5960
61+ # ##
62+ # Log job
63+ # ##
64+ timeend=$( date +%s)
65+ logging_job_status " pos"
66+
6067exit 0
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ IFS=' ' read -r -a lvis <<< "$lvisstr"
1818# ##
1919# source environment
2020# ##
21+ timestart=$( date +%s)
2122# source ${tsmp2_env} # chang pre-processing env. according to comp. model
2223
2324# ##
@@ -57,4 +58,10 @@ pre_cleanup
5758
5859fi # cleanup
5960
61+ # ##
62+ # Log job
63+ # ##
64+ timeend=$( date +%s)
65+ logging_job_status " pre"
66+
6067exit 0
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ IFS=' ' read -r -a lvis <<< "$lvisstr"
1818# ##
1919# source environment
2020# ##
21+ timestart=$( date +%s)
2122source ${tsmp2_env}
2223
2324# ##
@@ -57,4 +58,10 @@ sim_cleanup
5758
5859fi # cleanup
5960
61+ # ##
62+ # Log simulation
63+ # ##
64+ timeend=$( date +%s)
65+ logging_job_status " sim"
66+
6067exit 0
Original file line number Diff line number Diff line change @@ -96,7 +96,8 @@ cp -v ${sim_dir}/slm_multiprog_mapping.conf ${simout_dir}/log/
9696# sim logs
9797mv ${log_dir} /${SLURM_JOB_NAME} _${SLURM_JOB_ID} .{err,out} ${simout_dir} /log/.
9898
99- # echo "SLURM node ID LIST:"${SLURM_JOB_NODELIST}
99+ # job info
100+ echo $( scontrol show job ${SLURM_JOB_ID} ) > ${simout_dir} /log/job_info.log
100101
101102# remove run directory
102103rm -rf ${sim_dir:? }
Original file line number Diff line number Diff line change @@ -83,3 +83,14 @@ check_var_def() {
8383 fi
8484 fi
8585} # check_var_def
86+
87+ logging_job_status (){
88+ local step=" $1 "
89+
90+ if [ " $joblog " = true ]; then
91+ job_state=$( scontrol show job $SLURM_JOB_ID | grep " JobState=" | cut -d= -f2 | cut -d' ' -f1)
92+ printf " %10s %3s %15s %14s %10s %14s %9s\n" " ${expid} " " ${step} " " ${modelid} " \
93+ " ${dateshort} " " ${job_state} " " $( date ' +%Y%m%d%H%M%S' ) " $( date -u -d " 0 $timeend sec - $timestart sec" +" %H:%M:%S" ) \
94+ >> ${ctl_dir} /job_status.log
95+ fi
96+ } # logging_job_status
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ IFS=' ' read -r -a lvis <<< "$lvisstr"
1818# ##
1919# source environment
2020# ##
21+ timestart=$( date +%s)
2122source ${tsmp2_env} # should be changed to visualisation env.
2223
2324# ##
@@ -57,4 +58,10 @@ vis_cleanup
5758
5859fi # cleanup
5960
61+ # ##
62+ # Log job
63+ # ##
64+ timeend=$( date +%s)
65+ logging_job_status " vis"
66+
6067exit 0
You can’t perform that action at this time.
0 commit comments