I am using a cluster with Torque / Maui system. I have a bash script that send one job with the qsub command and then perform several actions, for example, move files, write ASCII files and check the result of the work that I sent. As for this result, basically, if it contains number 1, you need to send the task again. If different from 1, the bash script does something else.
The problem is that qsub is running in the background and all bash are evaluated right away. I would like to make qsub behave the same as awk, cat, sort, etc. When the script just goes further after completing these commands - if not put in the background.
So, I need bash to stop in the first qsub and continue working immediately after qsub completes, which means that when the work finishes. Is there any way to do this? It will be something similar to:
-sync y
what i have:
#!/bin/bash
.
.
some commands
.
.
qsub my_application
.
.
more commands
.
.
my_application_output=(`cat my_application_output.txt`)
case "$my_application_output" in
["1"])
qsub my_application
;;
["0"])
some commands
;;
["100"])
some commands
;;
*)
some commands
exit 1
esac
.
.
some comments
- It is not convenient to use: qsub -Ix, as soon as I want to save the output in the output file; and don’t want to block node by running interactive mode (-I)
- I assume that this is not a simple work-dependent problem, as soon as a re-presentation of 1) can happen, 2) cannot, and most importantly, if this happens (1), it can be several times.
thanks for all
source
share