Writing · Research Computing

Why your cluster job is pending or failed, and how to read the clues

← All writing

You submitted a job and walked away. Hours later it's still waiting, or it ended and left you an empty folder. The scheduler isn't being mysterious. It knows exactly what happened, and a few short commands will tell you too. This guide assumes Slurm, which many campus and national clusters use. Your site may add its own commands, so check its documentation for anything that looks different.

Start with the job's status

To see jobs that are waiting or running, use squeue -u yourusername. The state column is short, and two codes cover most of what you'll see: PD means pending (not started) and R means running. For a job that has already ended, use sacct -j JOBID. It lists the final state, the exit code, how long the job ran, and often how much memory it used. For one job in detail, scontrol show job JOBID works while the job is still known to the scheduler.

If it's pending, read the reason

The last column in squeue shows why a job hasn't started. The wording varies a little by site, but a few reasons come up all the time.

Resources means the job is next in line and waiting for enough free nodes. That's normal. Priority means other jobs are ahead of yours. Also normal, and it often clears by itself. Reasons that mention a limit, such as a per-user job cap or an account limit, mean you've hit a policy ceiling, and the job will start once your other jobs finish. Anything that says the request is invalid, or that no node can satisfy it, means you asked for something the cluster can't give, like more memory than any node has or a partition you aren't allowed to use. Cancel it with scancel JOBID and fix the request.

One more trick: if you asked for 48 hours and 200 GB of memory, try the smaller ask you really need. Shorter, smaller jobs fit into gaps the scheduler can't use for big ones, so they often start sooner.

If it failed, check the final state

In the sacct output, the state tells you where to look next. FAILED means your program exited with an error, so open the job's output and error files and read the last lines first. TIMEOUT means it hit the time limit you set, and the fix is a longer limit or a job that saves progress as it goes. OUT_OF_MEMORY means it used more memory than you requested. The memory errors article covers what to change in your code, and your job script is where you raise the request. CANCELLED means you or an administrator ended it.

When the state is COMPLETED but the results are missing, the script ran to the end without crashing, so look at paths. A script that moves to the wrong folder will happily write its files somewhere you aren't looking.

Habits that save you time

Test a tiny version first, as the first-job guide suggests, so the real job doesn't wait a day only to fail on a typo. Write the job ID in your notes. Send output and error to named files so you can find them. And record how long and how much memory a finished run used, so the next request is based on a number instead of a guess. If you're still deciding where a job should run at all, campus, national, or cloud compares the options, and the research computing guide gathers the rest in one place.

Common questions

Why is my job pending when the cluster looks empty? The scheduler reserves resources for jobs ahead of yours, and your request may need a specific mix (a GPU, a lot of memory, a long time limit) that isn't free yet even if many nodes are idle. Run squeue and look at the reason column, then try asking for less.

How long should I wait before worrying? It depends on the site and on how much you asked for. Short, small requests often start within minutes. Large or long ones can wait a day or more. If the reason says something about a limit or an invalid request, don't wait. Fix the request.

My job says COMPLETED but there's no output. What happened? COMPLETED only means the script exited cleanly. Check that it wrote files where you expect, that the working directory in your script is right, and that the log file has no earlier errors.

Who do I ask when I can't tell? Your campus research computing team or the help desk of the national resource you're using. Send the job ID, the script, and the output of sacct for that job. That's usually enough for them to answer quickly.


Samah Alshrief, Ph.D.

AI data scientist and research-computing specialist. I help researchers and universities with research data management, data services, and private AI. Get in touch →