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

File: [Development] / JSOC / proj / globalhs / scripts / waittosubmit (download)
Revision: 1.7, Wed Jun 11 05:19:20 2014 UTC (8 years, 11 months ago) by tplarson
Branch: MAIN
CVS Tags: Ver_8-5
Changes since 1.6: +2 -0 lines
added output to inform user of locked submission

#!/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 = `qstat -u $USER | grep -c $tag`

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

echo waittosubmit: $count iterations

Karen Tian
Powered by
ViewCVS 0.9.4