Metadata-Version: 2.4
Name: slurmfrag
Version: 0.1.0
Summary: SLURM Fragmentation Analyzer - Visualize and analyze resource fragmentation across SLURM clusters
Project-URL: Homepage, https://github.com/ferreirafabio/slurmfrag
Project-URL: Documentation, https://github.com/ferreirafabio/slurmfrag#readme
Project-URL: Repository, https://github.com/ferreirafabio/slurmfrag
Project-URL: Issues, https://github.com/ferreirafabio/slurmfrag/issues
Author: Fabio Ferreira
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: cluster,fragmentation,gpu,hpc,monitoring,slurm,visualization
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: System :: Clustering
Classifier: Topic :: System :: Monitoring
Classifier: Topic :: System :: Systems Administration
Requires-Python: >=3.8
Requires-Dist: pyyaml>=5.0
Provides-Extra: dev
Requires-Dist: mypy>=1.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.0; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Description-Content-Type: text/markdown

# slurmfrag 🧩

```
┌─────────────────────────────────────────────────────────────────────────┐
│  GPU: 25/32 used (78.1%)                                                │
├─────────────────────────────────────────────────────────────────────────┤
│  NODE          USED    TOTAL    USE%   FRAGMENTATION                    │
│  gpunode01        7        8   87.5%   [██████████████████░░]           │
│  gpunode02        8        8  100.0%   [████████████████████]           │
│  gpunode03        4        8   50.0%   [██████████░░░░░░░░░░]           │
├─────────────────────────────────────────────────────────────────────────┤
│  CPU: 374/1536 used (24.3%)                                             │
├─────────────────────────────────────────────────────────────────────────┤
│  gpunode01      124      384   32.3%   [██████░░░░░░░░░░░░░░]           │
│  gpunode02       98      384   25.5%   [█████░░░░░░░░░░░░░░░]           │
│  gpunode03      108      384   28.1%   [██████░░░░░░░░░░░░░░]           │
├─────────────────────────────────────────────────────────────────────────┤
│  Memory: 4.3/6.0 TB used (71.5%)                                        │
├─────────────────────────────────────────────────────────────────────────┤
│  gpunode01     1091     1500   72.7%   [███████████████░░░░░]           │
│  gpunode02     1070     1500   71.3%   [██████████████░░░░░░]           │
│  gpunode03     1074     1500   71.6%   [██████████████░░░░░░]           │
└─────────────────────────────────────────────────────────────────────────┘
```

Visualize SLURM cluster fragmentation — GPU, CPU, and memory usage per node, plus queue depth and pending requests.

## Features

- **All-in-one** — GPU, CPU, memory fragmentation per node in a single view
- **Queue status** — see pending jobs and total resource requests waiting
- **JSON export** — for automation and historical analysis
- **Logging daemon** — run `slurmfrag --log` to periodically capture snapshots for trend analysis
- **Configurable** — YAML config for cluster-specific GRES patterns

## Quick start

**From PyPI:**
```bash
pip install slurmfrag
slurmfrag
```

**From source:**
```bash
git clone https://github.com/ferreirafabio/slurmfrag
cd slurmfrag
python -m slurmfrag
```

### Usage

```bash
slurmfrag                        # interactive partition picker
slurmfrag -p gpu-partition       # direct analysis
slurmfrag -p gpu-partition --json
slurmfrag --log                  # logging daemon mode
```

## Config

Optional `~/.config/slurmfrag/config.yaml`:

```yaml
gres_patterns:
  gpu:
    pattern: "gpu[^:]*:(\\d+)"  # adjust for your cluster

logging:
  output_dir: "./slurmfrag_logs"
  interval_minutes: 5
```

## Requirements

- Python 3.8+
- SLURM (`sinfo`, `squeue` commands)
- PyYAML

## License

Apache-2.0
