views:

151

answers:

1

I would like to submit jobs via qsub on Sun Grid Engine (now: Oracle Grid Engine?). I do not wish to use the -sync yes option or qrsh, because I want my controlling program to be single-threaded and able to launch many jobs at a time. These options would block my controlling program's thread.

However, I would like to receive the exit statuses of the processes that I launch. From the man pages, there seems to be no way to get this code without blocking my thread. Short of modifying the jobs that I'm launching to print their exit codes to stdout, is there any way to get this status?

A: 

The answer is 'qacct -j '. A summary of the history of the job is printed to stdout, which can then be parsed for the exit status, start and end times, and a variety of other information.

SGE must be configured properly for this command to work, however.

Brian