> For the complete documentation index, see [llms.txt](https://docs.tensorwave.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tensorwave.com/slurm-old/debugging-workloads-and-interactive-jobs.md).

# Debugging Workloads and Interactive Jobs

Often dropping into a shell is the easiest way to hammer out development / debugging work. To get a shell access to a node, use a combination of `salloc` and `srun` commands.

```
tensorwave@tensorwave.com@slurm-login-skip-8566547b9c-zdznk:~$ salloc -N 1 --gpus-per-node=8
salloc: Granted job allocation 269
salloc: Waiting for resource configuration
salloc: Nodes tus1-p13-g41 are ready for job
tensorwave@tensorwave.com@slurm-login-skip-8566547b9c-zdznk:~$ srun --pty bash
tensorwave@tensorwave.com@tus1-p13-g41:~$ # <== bash shell on a worker node
```

`salloc` reserves a resource allocation. It creates a sub-shell tied to a SLRUM allocation, and allows users to call `srun` multiple times on the same set of resrouces. This provides much faster iteration time than calling `srun`/`sbatch` from a login node and having to wait for a resource allocation each time, especially for debugging multi-node jobs.

`srun --pty bash` launches the bash shell on the worker pods. The `--pty` flag sets up a psudoshell, forwarding stdin, stdout, and stderr to the terminal. The `--pty` flag is also useful for `srun` commands with complex outputs like `docker build` or python tools with `tqdm` progress bars.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.tensorwave.com/slurm-old/debugging-workloads-and-interactive-jobs.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
