forked from Azure/azurehpc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Option to run nhc via slurm prolog
- Loading branch information
Showing
3 changed files
with
23 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 19 additions & 13 deletions
32
experimental/cc_slurm_nhc/cc_slurm_nhc/specs/default/cluster-init/files/wait_for_nhc.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,30 @@ | ||
#!/bin/bash | ||
|
||
$2 = PROLOG_RUN_NHC | ||
|
||
while [ ! -f /usr/sbin/nhc ];do | ||
sleep 2 | ||
echo "[Prolog] waiting for /usr/sbin/nhc" >> /var/log/nhc.log | ||
done | ||
|
||
pid=`ps -ef | grep -v grep | grep /usr/sbin/nhc | tr -s ' ' | cut -d ' ' -f2 | head -n 1` | ||
|
||
while ps -p $pid > /dev/null 2>&1 | ||
do | ||
sleep 10 | ||
TIMESTAMP=$(/bin/date '+%Y%m%d %H:%M:%S') | ||
echo "${TIMESTAMP} [prolog] NHC processes still running" >> /var/log/nhc.log | ||
done | ||
|
||
TIMESTAMP=$(/bin/date '+%Y%m%d %H:%M:%S') | ||
echo "${TIMESTAMP} [prolog] NHC processes finished and job can start" >> /var/log/nhc.log | ||
if [ -n "$pid" ]; then | ||
while ps -p $pid > /dev/null 2>&1 | ||
do | ||
sleep 10 | ||
TIMESTAMP=$(/bin/date '+%Y%m%d %H:%M:%S') | ||
echo "${TIMESTAMP} [prolog] NHC processes still running" >> /var/log/nhc.log | ||
done | ||
|
||
if [ -f /var/run/nhc/nhc.status ]; then | ||
exit 1 | ||
else | ||
exit 0 | ||
TIMESTAMP=$(/bin/date '+%Y%m%d %H:%M:%S') | ||
echo "${TIMESTAMP} [prolog] NHC processes finished and job can start" >> /var/log/nhc.log | ||
if [ -f /var/run/nhc/nhc.status ]; then | ||
exit 1 | ||
else | ||
exit 0 | ||
fi | ||
elif [[ $PROLOG_RUN_NHC == 1 ]]; then | ||
/sched/scripts/run_nhc.sh | ||
fi | ||
|