1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
|
.\" Copyright (C), 2012 Dave Love, University of Liverpool
.\" You may distribute this file under the terms of the GNU Free
.\" Documentation License.
.TH qevent 1 2012-01-09
.SH NAME
qevent \- subscribe and respond to xxQS_NAMExx events
.SH DESCRIPTION
.I qevent
subscribes to "events" generated by the xxQS_NAMExx system and loops
after writing its pid to the file
.IR qevent.pid .
It is used by the xxQS_NAMExx test suite, and otherwise can be used to
wait for a job or task to finish more efficiently than running
.I qstat
in a loop. See the example below.
.SH SYNOPSIS
.B qevent
.RB [ \-h | \-help ]
.RB [ \-ts | \-testsuite ]
.RB [ \-sm | \-subscribe ]
.RB [ \-trigger
.I event script
.RB [ \-trigger
.I event
.IR script ],...]
.SH OPTIONS
.TP
.BR \-h ,\ \-help
Show usage
.TP
.BR \-ts ,\ \-testsuite
Run in test suite mode.
.TP
.BR \-sm ,\ \-subscribe
Run in subscribe mode, printing events from the system.
.TP
.BI \-trigger\ event \ script
Start executable
.I script
when the specified
.I event
occurs.
.I script
gets three arguments: event name, job id, and task id.
.I event
is one of
.BR JB_END :
signals a job end;
.BR JB_TASK_END :
signals a job task end.
.SH FILES
.TP
.I qevent.pid
Id of the
.I qevent
process.
.SH EXAMPLE
This is an example of waiting for a job which could be used if the
.BR \-sync ,
.BR \-hold_jid ,
or
.B \-hold_jid_ad
options of
.I qsub
aren't sufficient.
.PP
.nf
$ cat wait-for-job
#!/bin/sh
if [ "$2" = $JOBID ]; then
echo Job $JOBID finished
kill $(cat qevent.pid)
exit 0
fi
$ export JOBID=`qsub -b y -terse sleep 30`
$ qevent -trigger JB_END ./wait-for-job
Job 122837 finished
$
.fi
.SH BUGS
Needs tidying up and extending.
|