-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
scripts to help with synchronizing async daq jobs
- Loading branch information
1 parent
ea5509e
commit c73691b
Showing
6 changed files
with
124 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# file: /usr/local/mdsplus/bin/job_finish | ||
# | ||
# shell script to signal completion of async daq task. | ||
# | ||
# called by job_finish.fun | ||
# | ||
# param 1 = tree_path | ||
# param 2 = shot number | ||
# | ||
# | ||
. `dirname $0`/job_functions | ||
job_output $1 $2 "FINISHED >>>>>>>>> `date`" | ||
cumulative_name=$(cumulative_log_spec $1 $2) | ||
lock_name=$(job_file_spec $1 $2) | ||
cat $lock_name >> $cumulative_name | ||
rm -f $lock_name |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
set_mds_logs() | ||
{ | ||
if [ "x$MDS_LOGS" = "x" ]; then | ||
MDS_LOGS="/var/log/mdsplus"; | ||
fi | ||
} | ||
|
||
job_file_spec() | ||
{ | ||
set_mds_logs | ||
FILE=$1 | ||
SHOT=$2 | ||
LOG="$MDS_LOGS/$FILE.$2.log" | ||
echo $LOG | ||
} | ||
cumulative_log_spec() | ||
{ | ||
set_mds_logs | ||
FILE=$1 | ||
LOG="$MDS_LOGS/$FILE.log" | ||
echo $LOG | ||
} |
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# file: /usr/local/mdsplus/bin/job_output | ||
# | ||
# shell script to spawn a batch job for automatic intershot analysis. | ||
# | ||
# called by job_que.fun | ||
# | ||
# procedure: | ||
# build a log file name from the base file name | ||
# (logs go to /var/mdsplus/log) | ||
# insert a status line for this shot | ||
# invoke the job with the shot number as $1 redirecting stdout and err | ||
# to the end of the log file | ||
# insert a done status line for this shot | ||
# | ||
# param 1 = tree_path | ||
# param 2 = shot number | ||
# param 3 = message to output | ||
# | ||
. `dirname $0`/job_functions | ||
# | ||
lock_file=$(job_file_spec $1 $2) | ||
if [ ! -e $lock_file ] | ||
then | ||
job_que $1 $2 | ||
fi | ||
if [ -e $lock_file ] | ||
then | ||
echo $3 >> $lock_file | ||
else | ||
echo "No lock file found/created" | ||
fi |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/sh | ||
# | ||
# file: /usr/local/mdsplus/bin/job_que | ||
# | ||
# shell script to signal existance of async daq task. | ||
# | ||
# called by job_que.fun | ||
# | ||
# param 1 = tree_path | ||
# param 2 = shot number | ||
# | ||
# | ||
. `dirname $0`/job_functions | ||
# | ||
file=$(job_file_spec $1 $2) | ||
lockfile $file | ||
chmod a+rw $file |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# file: /usr/local/mdsplus/bin/job_start | ||
# | ||
# shell script to signal start of async daq task. | ||
# | ||
# called by job_start.fun | ||
# | ||
# param 1 = tree_path | ||
# param 2 = shot number | ||
# | ||
# | ||
job_output $1 $2 "STARTING >>>>>>>>> `date`" |