Skip to content

Add ClusterLocal as cluster scheduler without remote connection#291

Draft
reginabuehler wants to merge 3 commits into
queens-py:mainfrom
reginabuehler:local-cluster-scheduler
Draft

Add ClusterLocal as cluster scheduler without remote connection#291
reginabuehler wants to merge 3 commits into
queens-py:mainfrom
reginabuehler:local-cluster-scheduler

Conversation

@reginabuehler
Copy link
Copy Markdown
Contributor

@reginabuehler reginabuehler commented Feb 17, 2026

Description and Context:
What and Why?

This PR introduces a local cluster scheduler (developed by @sbrandstaeter) that mirrors the existing Cluster scheduler’s PBS/Slurm + Dask jobqueue workflow, but runs in a local access setting (no remote SSH connection).
A few remaining pieces are still pending and listed below.

What's missing:

  •  cluster integration test
  • eliminate code redundancy to schedulers/cluster.py and utils/start_dask_cluster.py

This pull request introduces a new scheduler hierarchy to support the new local cluster scheduler. A new common parent class now contains the shared cluster logic, while the remote and local schedulers are implemented as subclasses.

Related Issues and Pull Requests

  • Closes
  • Related to

Interested Parties

@dharinib98: This branch would allow us to run QUEENS simulations locally on the cluster.

Note: More information on the merge request procedure in QUEENS can be found in the Submit a pull request section in the CONTRIBUTING.md file.

Comment thread src/queens/schedulers/cluster_local.py Outdated
@bennoschoenstein
Copy link
Copy Markdown
Contributor

Hi, I've been using this PR and wanted to share some feedback and two small additions I made.

Addition 1: job_extra_directives parameter

I needed to add a SLURM --constraint to restrict jobs to specific node types (only certain nodes have VTK support). Since ClusterLocal had no way to pass extra SBATCH directives beyond the computed --ntasks, I added a job_extra_directives parameter:

```python
scheduler = ClusterLocal(
...
job_extra_directives=["--constraint=skylake&thin"],
)
```

In _start_cluster_and_connect_client, the existing line:
```python
"job_extra_directives": [job_extra_directives],
```
becomes:
```python
"job_extra_directives": [job_extra_directives, *self.job_extra_directives],
```

Addition 2: slurm_logs/ subdirectory for SLURM logs

With many jobs the .err/.out files pile up directly in the experiment directory. I changed log_directory to write into a slurm_logs/ subdirectory:

```python
"log_directory": str(self.experiment_dir / "slurm_logs"),
```

Would you consider including either or both of these in the PR?

@reginabuehler
Copy link
Copy Markdown
Contributor Author

@bennoschoenstein Thanks for sharing your experience with using this branch and your feedback.
Both additions are very valid points and should ease usability. As far as I see, both concern the current cluster scheduler in cluster.py as well. Since they are not directly related to this feature of a cluster scheduler without a remote connection, I can also see them being introduced in a separate pull request.

On the current status of this PR: It still needs quite some refactoring to be able to be merged due to code redundancy. This refactoring then also (most likely) makes it easier to include these additions in a general manner.
Therefore, I suggest to keep your suggestions in mind while refactoring and possibly open separate issues/PR for these suggestions afterwards.

@reginabuehler reginabuehler force-pushed the local-cluster-scheduler branch 3 times, most recently from fa80f6f to 32d08df Compare April 15, 2026 15:02
reginabuehler and others added 2 commits April 15, 2026 15:25
Co-authored-by: Sebastian Brandstäter <45557303+sbrandstaeter@users.noreply.github.com>
@reginabuehler reginabuehler force-pushed the local-cluster-scheduler branch from 32d08df to dc15434 Compare April 15, 2026 15:26
@m-frey
Copy link
Copy Markdown

m-frey commented Apr 21, 2026

@reginabuehler Thanks for this very usefull contribution, works for me without any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants