Commit 76d597c9 authored by Robert Dietrich's avatar Robert Dietrich

removed files that should be links only

parent 20cbee31
#!/bin/bash
source /sw/taurus/tools/pika/pika-current.conf
export PIKA_JOB_ID=${SLURM_JOB_ID}
export PIKA_JOB_NODELIST=${SLURM_NODELIST}
# check if prolog script was called
if [ -e ${LOCAL_STORE}/pika_prolog_${PIKA_JOB_ID} ]; then
rm -f ${LOCAL_STORE}/pika_prolog_${PIKA_JOB_ID}
else
exit 0
fi
# check for debug file
if [ "${PIKA_DEBUG}" == "1" ]; then
mkdir -p /tmp/pika_debug
DEBUG_PATH=/tmp/pika_debug/pika_${PIKA_JOB_ID}
echo -e "\nStart epilog debugging..." >> $DEBUG_PATH 2>&1
else
DEBUG_PATH=/dev/null
fi
# file that contains job metadata
BATCHSYSTEM_ENV_FILE=${LOCAL_STORE}/pika_batchsystem_env_${PIKA_JOB_ID}
# determine master node
MASTER_NODE=`echo ${PIKA_JOB_NODELIST} | nodeset -e | cut -d ' ' -f 1`
# this node's name
PIKA_HOSTNAME=$(hostname)
# update job metadata
source ${PIKA_ROOT}/job_control/slurm/taurus/pika_update_metadata_epilog_include.sh >> $DEBUG_PATH 2>&1
# cleanup local data
rm -f ${BATCHSYSTEM_ENV_FILE}
echo -e "\nEpilog finished sucessfully!" >> $DEBUG_PATH 2>&1
exit 0
#!/bin/bash
source /sw/taurus/tools/pika/pika-current.conf
##### (1) if SLURM_JOB_ID is of length zero
if [[ -z "${SLURM_JOB_ID}" ]]; then
mkdir -p /tmp/pika_debug
echo -e "\n SLURM_JOB_ID is not available. Exit prolog" > /tmp/pika_debug/slurm_job_id_not_available 2>&1
env | grep SLURM >> /tmp/pika_debug/slurm_job_id_not_available 2>&1
exit 0
else
export PIKA_JOB_ID=${SLURM_JOB_ID}
fi
##### (2) check for active jobs and make job visible to other prologs #####
# number of local running jobs
LOCAL_JOBS_RUNNING=`ls -l ${LOCAL_STORE} | grep -c pika_prolog_`
# create prolog file (which is removed in epilog)
touch ${LOCAL_STORE}/pika_prolog_${PIKA_JOB_ID}
##### (3) Generate debug file
if [ ${PIKA_DEBUG} -eq 1 ]; then
# delete debug files older than 7 days
find /tmp/pika_debug/pika_* -mtime +7 -exec rm {} \;
find /tmp/pika_debug/memcache_* -mtime +7 -exec rm {} \;
mkdir -p /tmp/pika_debug
DEBUG_PATH=/tmp/pika_debug/pika_${PIKA_JOB_ID}
echo -e "Start prolog debugging..." > $DEBUG_PATH 2>&1
chmod o+r $DEBUG_PATH
else
DEBUG_PATH=/dev/null
fi
##### (4) if SLURM_NODELIST is of length zero
if [[ -z "${SLURM_NODELIST}" ]]; then
echo -e "\n SLURM_NODELIST is not available. Exit prolog" >> $DEBUG_PATH 2>&1
exit 0
else
export PIKA_JOB_NODELIST=${SLURM_NODELIST}
fi
##### (5) pika package installation
# install pika python and likwid in /opt/pika if it is not already there
if [ ! -d "${PIKA_INSTALL_PATH}" ]; then
echo -e "\nUnpack PIKA software stack to ${PIKA_INSTALL_PATH}" >> $DEBUG_PATH 2>&1
# delete old installation if it is still there
if [ -d "/opt/pika" ]; then
rm -rf /opt/pika
fi
mkdir -p ${PIKA_INSTALL_PATH}
echo -e "tar xzf ${PIKA_PACKAGE_PATH} -C ${PIKA_INSTALL_PATH}/.." >> $DEBUG_PATH 2>&1
tar xzf ${PIKA_PACKAGE_PATH} -C ${PIKA_INSTALL_PATH}/.. >> $DEBUG_PATH 2>&1
fi
##### (6) pika presetup
# setup logrotate
source ${PIKA_ROOT}/job_control/slurm/taurus/pika_logrotate_prolog_include.sh >> $DEBUG_PATH 2>&1
# check python
echo -e "\nCheck python3 path:" >> $DEBUG_PATH 2>&1
which python3 >> $DEBUG_PATH 2>&1
# determine master node
MASTER_NODE=`echo ${PIKA_JOB_NODELIST} | nodeset -e | cut -d ' ' -f 1`
# this node's name
PIKA_HOSTNAME=$(hostname)
echo -e "\nMASTER_NODE=$MASTER_NODE" >> $DEBUG_PATH 2>&1
echo -e "\nPIKA_HOSTNAME=$PIKA_HOSTNAME" >> $DEBUG_PATH 2>&1
# file where job information is stored (can be sourced later)
BATCHSYSTEM_ENV_FILE=${LOCAL_STORE}/pika_batchsystem_env_${PIKA_JOB_ID}
# set defaults for all pika metadata provided by SLURM
source ${PIKA_ROOT}/job_control/slurm/taurus/pika_slurm_env.sh >> $DEBUG_PATH 2>&1
##### (7) get additional job metadata from redis
PIKA_MONITORING=1
source ${PIKA_ROOT}/job_control/slurm/taurus/pika_get_metadata_prolog_include.sh >> $DEBUG_PATH 2>&1
##### (8) based on the PIKA_MONITORING value, start or stop collectd
source ${PIKA_ROOT}/job_control/slurm/taurus/pika_collectd_prolog_include.sh >> $DEBUG_PATH 2>&1
##### (9) save job metadata
source ${PIKA_ROOT}/job_control/slurm/taurus/pika_save_metadata_prolog_include.sh >> $DEBUG_PATH 2>&1
echo -e "\nProlog finished sucessfully!" >> $DEBUG_PATH 2>&1
exit 0
\ No newline at end of file
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