> This page is for version 0.5.0.
> For other versions, use one of these documentation indexes:
> - Main (default): https://docs.nvidia.com/nemo/gym/main/llms.txt
> - 0.7.0: https://docs.nvidia.com/nemo/gym/v0.7.0/llms.txt
> - 0.6.0: https://docs.nvidia.com/nemo/gym/v0.6.0/llms.txt
> - 0.5.1: https://docs.nvidia.com/nemo/gym/v0.5.1/llms.txt
> - 0.5.0: https://docs.nvidia.com/nemo/gym/v0.5.0/llms.txt
> - 0.4.0: https://docs.nvidia.com/nemo/gym/v0.4.0/llms.txt
> - 0.3.0: https://docs.nvidia.com/nemo/gym/v0.3.0/llms.txt
> - 0.2.1: https://docs.nvidia.com/nemo/gym/v0.2.1/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo/gym/llms.txt.

# nemo_gym.orchestration.executors.slurm_logs

How the Slurm executor reads the logs of the jobs it queued.

## Module Contents

### Functions

| Name                                                                                            | Description                                                                                               |
| ----------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
| [`parse_log_output`](#nemo_gym-orchestration-executors-slurm_logs-parse_log_output)             | The lines of the log `render_read_log_script` printed; a file that does not exist is `FileNotFoundError`. |
| [`render_read_log_script`](#nemo_gym-orchestration-executors-slurm_logs-render_read_log_script) | The commands that print `path`, or only its last `tail` lines, after a line saying whether it exists.     |

### Data

[`_KIND_MISSING`](#nemo_gym-orchestration-executors-slurm_logs-_KIND_MISSING)

[`_KIND_OK`](#nemo_gym-orchestration-executors-slurm_logs-_KIND_OK)

[`_MARK`](#nemo_gym-orchestration-executors-slurm_logs-_MARK)

[`_SEP`](#nemo_gym-orchestration-executors-slurm_logs-_SEP)

### API

```python
nemo_gym.orchestration.executors.slurm_logs.parse_log_output(
    output: str,
    path: pathlib.Path
) -> list[str]
```

The lines of the log `render_read_log_script` printed; a file that does not exist is `FileNotFoundError`.

```python
nemo_gym.orchestration.executors.slurm_logs.render_read_log_script(
    path: pathlib.Path,
    tail: int | None
) -> list[str]
```

The commands that print `path`, or only its last `tail` lines, after a line saying whether it exists.

A reader that fails (permission denied, an I/O error) fails the script, so a truncated log is never
returned as if it were whole.

```python
nemo_gym.orchestration.executors.slurm_logs._KIND_MISSING = 'missing'
```

```python
nemo_gym.orchestration.executors.slurm_logs._KIND_OK = 'ok'
```

```python
nemo_gym.orchestration.executors.slurm_logs._MARK = '__GYM_LOG'
```

```python
nemo_gym.orchestration.executors.slurm_logs._SEP = ':'
```