Commit 9acc17fd authored by Frank Winkler's avatar Frank Winkler
Browse files

Added slurm metadata to prolog and epilog.

parent 6a956341
pika-spank/pika_spank.tar.gz
pika-spank/pika_spank
pika-spank/rpmbuild
pika-control/pika_access
......@@ -41,8 +41,8 @@ if [ "${PIKA_HOSTNAME}" = "${MASTER_NODE}" ]; then
# create sql statement
SQL_QUERY="INSERT INTO Job_Data "
SQL_QUERY+="(JID,USER,PROJECT,STATUS,NUM_NODES,NODELIST,CPULIST,NUM_CORES,START,NAME,WALLTIME,P_PARTITION,EXCLUSIVE,ARRAY_ID) "
SQL_QUERY+="VALUES ('${PIKA_JOB_ID}','${PIKA_JOB_USER}','${PIKA_JOB_ACCOUNT}','running','${JOB_NUM_NODES}','${PIKA_JOB_NODELIST}','${PIKA_JOB_CPUS_ALLOCATED}','${PIKA_JOB_NUM_CORES}','${PIKA_JOB_START}','${PIKA_JOB_NAME}','${PIKA_JOB_WALLTIME}','${PIKA_JOB_PARTITION}','${PIKA_JOB_EXCLUSIVE}','${JOB_ARRAY_ID}')"
SQL_QUERY+="(JID,USER,PROJECT,STATUS,NUM_NODES,NODELIST,CPULIST,NUM_CORES,SUBMIT,START,NAME,WALLTIME,P_PARTITION,EXCLUSIVE,ARRAY_ID) "
SQL_QUERY+="VALUES ('${PIKA_JOB_ID}','${PIKA_JOB_USER}','${PIKA_JOB_ACCOUNT}','running','${JOB_NUM_NODES}','${PIKA_JOB_NODELIST}','${PIKA_JOB_CPUS_ALLOCATED}','${PIKA_JOB_NUM_CORES}','${PIKA_JOB_SUBMIT}','${PIKA_JOB_START}','${PIKA_JOB_NAME}','${PIKA_JOB_WALLTIME}','${PIKA_JOB_PARTITION}','${PIKA_JOB_EXCLUSIVE}','${JOB_ARRAY_ID}')"
# check if mysql is installed
MYSQL_CHECK=`command -v mysql`
......
#!/bin/bash
PIKA_JOB_ID=${SLURM_JOB_ID}
PIKA_JOB_NODELIST=${SLURM_NODELIST}
PIKA_JOB_USER=${SLURM_JOB_USER}
PIKA_JOB_EXCLUSIVE=1
PIKA_JOB_PARTITION=${SLURM_JOB_PARTITION}
PIKA_JOB_NAME='pika-test'
PIKA_JOB_WALLTIME=60
PIKA_JOB_CPUS_ALLOCATED='n/a'
PIKA_JOB_ARRAY_ID='None'
PIKA_JOB_ACCOUNT='pika'
PIKA_JOB_NUM_CORES=0
PIKA_JOB_STATUS='completed'
#export PIKA_JOB_START=`date +%s`
PIKA_JOB_END=`date +%s`
# get remaining data from SLURM scontrol show job ${SLURM_JOB_ID} -d
slurm_data=$(scontrol show job ${SLURM_JOB_ID} -d)
#sacct -j ${SLURM_JOB_ID} --format="jobidraw,jobname%30,partition,ncpus,timelimit,state,submit,start,end" | grep -F "${SLURM_JOB_ID} " >> $DEBUG_PATH 2>&1
PIKA_JOB_STATUS=$(echo $slurm_data | awk -F 'JobState=' '{print $2}' | awk '{print $1}')
#scontrol -d show job ${SLURM_JOB_ID} >> $DEBUG_PATH 2>&1
start_time=$(echo $slurm_data | awk -F 'StartTime=' '{print $2}' | awk '{print $1}')
start_time_seconds=$(date -d "$start_time" +"%s")
PIKA_JOB_START=$start_time_seconds
# 11974924 Pika-Regression-Test ml 4 01:00:00 COMPLETED
# 2021-03-11T10:07:54 2021-03-11T10:08:04 2021-03-11T10:13:13
# JobId=11974924 JobName=Pika-Regression-Test
# UserId=fwinkler(1015185) GroupId=zihforschung(50244) MCS_label=N/A
# Priority=31103 Nice=0 Account=zihforschung QOS=resv
# JobState=COMPLETING Reason=None Dependency=(null)
# Requeue=1 Restarts=0 BatchFlag=1 Reboot=0 ExitCode=0:0
# DerivedExitCode=0:0
# RunTime=00:05:09 TimeLimit=01:00:00 TimeMin=N/A
# SubmitTime=2021-03-11T10:07:54 EligibleTime=2021-03-11T10:07:54
# AccrueTime=2021-03-11T10:07:54
# StartTime=2021-03-11T10:08:04 EndTime=2021-03-11T10:13:13 Deadline=N/A
# SuspendTime=None SecsPreSuspend=0 LastSchedEval=2021-03-11T10:08:04
# Partition=ml AllocNode:Sid=tauruslogin3:13001
# ReqNodeList=taurusml5 ExcNodeList=(null)
# NodeList=taurusml5
# BatchHost=taurusml5
# NumNodes=1 NumCPUs=4 NumTasks=1 CPUs/Task=1 ReqB:S:C:T=0:0:*:1
# TRES=cpu=4,mem=1200M,node=1,billing=4
# Socks/Node=* NtasksPerN:B:S:C=0:0:*:1 CoreSpec=*
# JOB_GRES=(null)
# Nodes=taurusml5 CPU_IDs=0-3 Mem=1200 GRES=
# MinCPUsNode=1 MinMemoryCPU=300M MinTmpDiskNode=0
# Features=(null) DelayBoot=00:00:00
# Reservation=zihforschung_406
# OverSubscribe=OK Contiguous=0 Licenses=(null) Network=(null)
# Command=/home/h5/fwinkler/applications/matrix/run_ml.sh
# WorkDir=/home/h5/fwinkler/applications/matrix
# Comment=<<<ZIH_JOB_STATS__REMOVE_HDF5>>>
# StdErr=/home/h5/fwinkler/applications/matrix/slurm-11974924.out
# StdIn=/dev/null
# StdOut=/home/h5/fwinkler/applications/matrix/slurm-11974924.out
# Power=
# MailUser=(null) MailType=NONE
end_time=$(echo $slurm_data | awk -F 'EndTime=' '{print $2}' | awk '{print $1}')
end_time_seconds=$(date -d "$end_time" +"%s")
PIKA_JOB_END=$end_time_seconds
......@@ -5,54 +5,25 @@ PIKA_JOB_NODELIST=${SLURM_NODELIST}
PIKA_JOB_USER=${SLURM_JOB_USER}
PIKA_JOB_EXCLUSIVE=1
PIKA_JOB_PARTITION=${SLURM_JOB_PARTITION}
PIKA_JOB_NAME='pika-test'
PIKA_JOB_WALLTIME=60
PIKA_JOB_CPUS_ALLOCATED='n/a'
PIKA_JOB_ARRAY_ID='None'
PIKA_JOB_ACCOUNT='pika'
PIKA_JOB_NUM_CORES=0
PIKA_JOB_STATUS='running'
#export PIKA_JOB_START=`date +%s`
PIKA_JOB_END=`date +%s`
# get remaining data from SLURM scontrol show job ${SLURM_JOB_ID} -d
slurm_data=$(scontrol show job ${SLURM_JOB_ID} -d)
#sacct -j ${SLURM_JOB_ID} --format="jobidraw,jobname%30,partition,ncpus,timelimit,state,submit,start,end" | grep -F "${SLURM_JOB_ID} " >> $DEBUG_PATH 2>&1
PIKA_JOB_NAME=$(echo $slurm_data | awk -F 'JobName=' '{print $2}' | awk '{print $1}')
PIKA_JOB_STATUS=$(echo $slurm_data | awk -F 'JobState=' '{print $2}' | awk '{print $1}')
PIKA_JOB_ACCOUNT=$(echo $slurm_data | awk -F 'Account=' '{print $2}' | awk '{print $1}')
PIKA_JOB_NUM_CORES=$(echo $slurm_data | awk -F 'NumCPUs=' '{print $2}' | awk '{print $1}')
#scontrol -d show job ${SLURM_JOB_ID} >> $DEBUG_PATH 2>&1
walltime=$(echo $slurm_data | awk -F 'TimeLimit=' '{print $2}' | awk '{print $1}')
walltime_seconds=$(echo $walltime | awk -F: '{ print ($1 * 3600) + ($2 * 60) + $3 }')
PIKA_JOB_WALLTIME=$walltime_seconds
submit_time=$(echo $slurm_data | awk -F 'SubmitTime=' '{print $2}' | awk '{print $1}')
submit_time_seconds=$(date -d "$submit_time" +"%s")
PIKA_JOB_SUBMIT=$submit_time_seconds
# 11974924 Pika-Regression-Test ml 4 01:00:00 COMPLETED
# 2021-03-11T10:07:54 2021-03-11T10:08:04 2021-03-11T10:13:13
# JobId=11974924 JobName=Pika-Regression-Test
# UserId=fwinkler(1015185) GroupId=zihforschung(50244) MCS_label=N/A
# Priority=31103 Nice=0 Account=zihforschung QOS=resv
# JobState=COMPLETING Reason=None Dependency=(null)
# Requeue=1 Restarts=0 BatchFlag=1 Reboot=0 ExitCode=0:0
# DerivedExitCode=0:0
# RunTime=00:05:09 TimeLimit=01:00:00 TimeMin=N/A
# SubmitTime=2021-03-11T10:07:54 EligibleTime=2021-03-11T10:07:54
# AccrueTime=2021-03-11T10:07:54
# StartTime=2021-03-11T10:08:04 EndTime=2021-03-11T10:13:13 Deadline=N/A
# SuspendTime=None SecsPreSuspend=0 LastSchedEval=2021-03-11T10:08:04
# Partition=ml AllocNode:Sid=tauruslogin3:13001
# ReqNodeList=taurusml5 ExcNodeList=(null)
# NodeList=taurusml5
# BatchHost=taurusml5
# NumNodes=1 NumCPUs=4 NumTasks=1 CPUs/Task=1 ReqB:S:C:T=0:0:*:1
# TRES=cpu=4,mem=1200M,node=1,billing=4
# Socks/Node=* NtasksPerN:B:S:C=0:0:*:1 CoreSpec=*
# JOB_GRES=(null)
# Nodes=taurusml5 CPU_IDs=0-3 Mem=1200 GRES=
# MinCPUsNode=1 MinMemoryCPU=300M MinTmpDiskNode=0
# Features=(null) DelayBoot=00:00:00
# Reservation=zihforschung_406
# OverSubscribe=OK Contiguous=0 Licenses=(null) Network=(null)
# Command=/home/h5/fwinkler/applications/matrix/run_ml.sh
# WorkDir=/home/h5/fwinkler/applications/matrix
# Comment=<<<ZIH_JOB_STATS__REMOVE_HDF5>>>
# StdErr=/home/h5/fwinkler/applications/matrix/slurm-11974924.out
# StdIn=/dev/null
# StdOut=/home/h5/fwinkler/applications/matrix/slurm-11974924.out
# Power=
# MailUser=(null) MailType=NONE
start_time=$(echo $slurm_data | awk -F 'StartTime=' '{print $2}' | awk '{print $1}')
start_time_seconds=$(date -d "$start_time" +"%s")
PIKA_JOB_START=$start_time_seconds
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment