Commit 77a00641 authored by Robert Dietrich's avatar Robert Dietrich

fixed if statements to determine master node

parent 6005cc36
#!/bin/bash
if [ ${PIKA_HOSTNAME} = ${MASTER_NODE} ]; then
if [ "${PIKA_HOSTNAME}" = "${MASTER_NODE}" ]; then
# get utility functions
source ${PIKA_ROOT}/pika_utils.sh >> $DEBUG_PATH 2>&1
......@@ -10,8 +10,13 @@ if [ ${PIKA_HOSTNAME} = ${MASTER_NODE} ]; then
# get start time from prolog
LOCAL_TIME_STORE=${LOCAL_STORE}/pika_local_time_${PIKA_JOB_ID}
JOB_START=`cat ${LOCAL_TIME_STORE}/START_${PIKA_HOSTNAME}`
rm -rf ${LOCAL_TIME_STORE}
if [ -d ${LOCAL_TIME_STORE} ] && [ -f ${LOCAL_TIME_STORE}/START_${PIKA_HOSTNAME} ]; then
JOB_START=`cat ${LOCAL_TIME_STORE}/START_${PIKA_HOSTNAME}`
rm -rf ${LOCAL_TIME_STORE}
else
rm -rf ${LOCAL_TIME_STORE}
exit 0
fi
echo -e "\nJOB_START=${JOB_START}" >> $DEBUG_PATH 2>&1
# save local end time
......@@ -31,7 +36,11 @@ if [ ${PIKA_HOSTNAME} = ${MASTER_NODE} ]; then
# if Redis script worked overwrite metadata
if [ "${PIKA_MONITORING}" -ge 0 ]; then
source ${BATCHSYSTEM_ENV_FILE} >> $DEBUG_PATH 2>&1
if [ -f ${BATCHSYSTEM_ENV_FILE} ]; then
source ${BATCHSYSTEM_ENV_FILE} >> $DEBUG_PATH 2>&1
else
echo "${BATCHSYSTEM_ENV_FILE} does not exist!" >> $DEBUG_PATH 2>&1
fi
else
echo -e "\nNo job metadata from redis available." >> $DEBUG_PATH 2>&1
source ${PIKA_ROOT}/job_control/slurm/taurus/pika_slurm_env.sh >> $DEBUG_PATH 2>&1
......
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