# Managing Jobs

HPC utilizes Slurm to manage jobs that users submit to various queues on a computer system. Each queue represents a group of resources with attributes necessary for the queue's jobs. Doane's Onyx HPC only has one queue to worry about.

📝 **Note:** Do not run jobs on the head node. All jobs launched from this node will be terminated without notice.

## Listing jobs

To list all jobs:

```bash
squeue
```

To refine the list of jobs to only those submitted by a user:

```bash
squeue -u username
```

To obtain the status of a job, run the following command using the job's ID number (this is provided at time of job submission).

```bash
squeue <jobnumber>
```

## Submitting a job

To submit a job, use the `sbatch` command, followed by the name of your submission file. A Job ID will be provided. You may want to make note of the ID for later use.

```bash
sbatch your_script
```

## Deleting a job

📝 **Note:** Be aware that deleting a job cannot be undone. Double check the job ID before deleting a job.

Users can delete their jobs by typing the following command.

```bash
scancel <jobnumber>
```

## Related Information

* [Execute a Job](https://github.com/Doane-CCLA/docs/tree/32c17a186f894def6776654780934fcecf27f8a6/execute-a-job.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doane-ccla.gitbook.io/docs/using-the-hpc/managing-jobs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
