Metadata-Version: 2.3
Name: slurmipy
Version: 2024.0.3
Summary: A package to manage Dask clusters on SLURM systems and execute functions with Dask parallelization.
Project-URL: Homepage, https://github.com/nollde/slurmipy
Project-URL: Issues, https://github.com/nollde/slurmipy/issues
Author-email: Dennis Noll <github@nollde.de>
License: MIT License
Keywords: python,slurm
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.8
Requires-Dist: dask-jobqueue
Requires-Dist: dask>=2021.6.0
Requires-Dist: distributed>=2021.6.0
Description-Content-Type: text/markdown

# SlurmiPy

Run python functions on a SLURM cluster as easy as:
```
@slurm_cluster.execute
def hello_world():
    print("YAY, I am running via SLURM!")
```

SlurmiPy provides a factory class for managing Dask clusters on SLURM-based systems and provides very easy exectution of python code on a SLURM cluster.

## Installation

- Navigate to the directory containing `setup.py`.
- Run the following command to build and install the package:

```bash
pip install .
```

## Usage

Here's a basic example of how to use `SlurmiPy` on Perlmutter:

```python
from slurmipy import SlurmiPy, configs

# Create a SLURM cluster with 4 jobs
slurm_cluster = SlurmiPy(jobs=4, **configs["perlmutter_debug"])

@slurm_cluster.execute
def process_data(data):
    return [x**2 for x in data]

# Execute the function using the SLURM cluster
result = process_data([1, 2, 3, 4])

print(result)  # Output: [1, 4, 9, 16]
