English 中文(简体)
Getting the exit code from a process submitted with qsub on Sun Grid Engine
原标题:

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?

最佳回答

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.

问题回答

If you are submitting your jobs within your application, the simplest and fastest (faster then submitting with qsub) way (and getting the exit status later) is using the DRMAA API. This simple API is available in C and in Java in Sun Grid Engine for a very long time. Univa Grid Engine (commercial successor of Grid Engine) and Sun Grid Engine forks also shipping the necessary library. Since it is an open standard you can submit even to completely other DRMS like Condor/SLURM etc. without changing your program. Language bindings for GO, Python, or TCL (and others) are available.

See: http://www.gridengine.eu/mangridengine/htmlman3/drmaa_wait.html

Some more information and the Go (#golang) DRMAA language binding with examples you can find here: http://www.gridengine.eu/programming-apis

Cheers

Daniel

www.gridengine.eu





相关问题
trapping shell exit code

I am working on a shell script, and want to handle various exit codes that I might come across. To try things out, I am using this script: #!/bin/sh echo "Starting" trap "echo "first one"; echo "...

Command /usr/bin/codesign failed with exit code 1

I have the following error: Command /usr/bin/codesign failed with exit code 1 Here is what I already did for trying to fix this: set the bundle identifier to com.server.pgmname set the code ...

Why would waitpid in Perl return wrong exit code?

I get wrong exit code from waitpid and I can t figure out why. Could someone give me some ideas? Here what I do: I start my child process with open2 then I wait for it to finish with waitpid get ...

How do I check the exit code of a command executed by flock?

Greetings all. I m setting up a cron job to execute a bash script, and I m worried that the next one may start before the previous one ends. A little googling reveals that a popular way to address ...

热门标签