Explanation of Exit Codes

Question:  What are the exit codes I might see on a job and what do they mean?

Answer:  Torque sets exit codes of -1 through -12, as outlined here:
It also sets an exit code of 271 for canceled running jobs and allows you to set the exit code for all canceled jobs with exit_code_canceled_job. Beyond that it just lets the user set the exit code for their own job in the script, or it gets the exit code from the shell.


Moab generally doesn't set exit codes. It primarily gets exit codes from Torque. There are two exceptions to that rule. It does set an exit code of 271 sometimes, but this is just to match up with Torque's 271 exit code and it generally doesn't matter because it should get that exit code from Torque too. The other case is for ENABLEFAILUREFORPURGEDJOB. This parameter has a note in the docs saying you have to have the keep_completed time set to 0 in Torque in order for this to work. If Torque kept the completed job around it would set it's own exit code and overwrite the code of 98 set by Moab. So the only way it works is to tell Torque not to track completed jobs.

Tags: completion code, exit code, status
Last update:
2016-02-11 22:38
Ben Roberts
Average rating:0 (0 Votes)

You cannot comment on this entry

Chuck Norris has counted to infinity. Twice.

Records in this category