(file) Return to waittosubmit2 CVS log (file) (dir) Up to [Development] / JSOC / proj / globalhs / scripts

File: [Development] / JSOC / proj / globalhs / scripts / waittosubmit2 (download)
Revision: 1.6, Thu Jun 26 20:40:04 2014 UTC (4 years, 3 months ago) by tplarson
Branch: MAIN
CVS Tags: Ver_LATEST, Ver_9-2, Ver_9-1, Ver_9-0, Ver_8-8, Ver_8-7, Ver_8-6, Ver_8-12, Ver_8-11, Ver_8-10, HEAD
Changes since 1.5: +7 -0 lines
add another check for sumbitlock after waiting

#!/bin/tcsh -f
 
set jobthreshold = $1
set tag=$2

if (-e submitlock) echo waittosubmit: submission locked

while(-e submitlock)                    
  sleep 60
end

set pid=$$
@ rand = 10 + ($pid % 47)
echo waittosubmit: $rand seconds

sleep $rand
set njobs = `qstat2 | grep -c $tag`

set count=0
while($njobs >= $jobthreshold)
  sleep $rand
  set njobs = `qstat2 | grep -c $tag`
@ count++
end

echo waittosubmit: $count iterations

if (-e submitlock) echo waittosubmit: submission locked

while(-e submitlock)                    
  sleep 60
end


Karen Tian
Powered by
ViewCVS 0.9.4