> For the complete documentation index, see [llms.txt](https://docs.cedana.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cedana.ai/cedana-slurm/cr.md).

# Manual Checkpoint/Restore

For both CPU and GPU workloads, no additional configuration is required. Below is an example of a simple CPU workload that counts from 0 to 600, sleeping for 1 second between each count. By default, Cedana must be enabled to checkpoint SLURM jobs.

```bash
#!/bin/bash
#SBATCH --job-name=hello_world          # Job name
#SBATCH --output=hello_world.out        # Standard output log
#SBATCH --error=hello_world.err         # Standard error log
#SBATCH --time=00:10:00                 # Time limit (hh:mm:ss)
#SBATCH --nodes=1                       # Run on 1 node
#SBATCH --ntasks=1                      # Run 1 task
#SBATCH --export=CEDANA_ENABLE=1        # Enable cedana-slurm

echo "Starting counter job on $(hostname)..."

# Loop from 0 to 600
for i in {0..600}
do
    echo "Counter: $i"
    sleep 1
done

echo "Job finished successfully."
```

## Checkpoint

<figure><img src="/files/kTl4xNS1kTMg7WfAybgl" alt=""><figcaption></figcaption></figure>

To checkpoint a job in SLURM, navigate to the [SLURM Jobs Page](https://ui.cedana.com/slurm/jobs), select the job, and checkpoint it.

## Restore

<figure><img src="/files/o481NkjkpGElQxal6CFh" alt=""><figcaption></figcaption></figure>

To restore a job in SLURM, navigate to the [SLURM Checkpoints Page](https://ui.cedana.com/slurm/checkpoints), select the checkpoint, and restore it.


---

# 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 dynamically by asking a question.

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

```
GET https://docs.cedana.ai/cedana-slurm/cr.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.
