# Molequeue and Backend Plugins

**URL:** <https://discuss.avogadro.cc/t/molequeue-and-backend-plugins/7611>\
**Category:** Development\
**Created:** [December 4, 2026, 5:24pm UTC](https://discuss.avogadro.cc/t/molequeue-and-backend-plugins/7611 "2026-12-04T17:24:45Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![ghutchis](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/ghutchis/32/456_2.png) [@ghutchis](https://discuss.avogadro.cc/u/ghutchis)\
**Post date:** [December 4, 2026, 5:24pm UTC](https://discuss.avogadro.cc/t/molequeue-and-backend-plugins/7611/1 "2026-12-04T17:24:45Z")

</div>

I’ve mentioned previously that there’s some interest for [backend](https://discuss.avogadro.cc/t/backend-plugins/7565) or [queue adapter](https://discuss.avogadro.cc/t/plugins-for-queue-adapters/7432) plugins. @brockdyer03 prompted me by doing some work to update Molequeue. (It would be great to have Molequeue back, particularly for users who want a dedicated resident queue manager that keeps managing local and remote jobs even when Avogadro is closed.)

I want to create some discussion and feedback feedback on a **Backend Protocol v2** architecture designed to keep MoleQueue first-class _and_ make the broader compute ecosystem sustainable for a volunteer open-source team.

## Maintainability

1. **Trying to support every service.** Supporting Slurm, PBS, SGE, LSF, HTCondor, WebMO, Galaxy, AWS/GCP Batch, HPC gateways, and custom cluster wrappers inside a single C++ codebase is hard to test and maintain. (Let alone running local jobs on Linux, macOS, and Windows.)
2. **A separate plugin for every cluster.** Asking every university or lab to maintain custom Python/C++ code just because their Slurm uses `--mem` instead of `--mem-per-cpu`, or needs `-M smp` or `suborca`, doesn’t work either, IMHO.

## Proposal: Four defined roles over JSON-RPC

The idea is to extend MoleQueue’s JSON-RPC 2.0 protocol so existing input generators keep their Submit workflow, while splitting execution into **four small, well-bounded roles** :

| Role | What it handles | How a new site or tool is added |
| --- | --- | --- |
| **1. Built-in `local` & MoleQueue bridge** | Simple local jobs on a laptop/teaching workstation with zero extra installs, **plus** a live MoleQueue instance in the same picker when you want a full resident queue daemon | Auto-detected / existing MoleQueue queues |
| **2. One unified `hpc` backend** | Lab Linux GPU boxes (no scheduler), Slurm, PBS Pro, SGE, LSF, HTCondor, cloud Slurm clusters, and site wrappers—all over SSH | **A shareable JSON profile file only (no code)** |
| **3. Thin REST gateway plugins** | Managed services that handle their own environments: **WebMO** , **Galaxy** , ChemCompute, `slurmrestd`, cloud batch, AiiDA | Small (~150–300 line) plugin implementing a 5-method core |
| **4. Registries & caches (optional)** | Workgroup/public calculation databases like **`ccreg`** or QCArchive (`browse`, pre-submit `findJob`, post-run `register`) | Linked directly inside a group profile |

Here’s why I think this can work:

- **Profiles, not plugins, for cluster diversity.** Differences between clusters (partitions, `--mem` vs `--mem-per-cpu`, `$SLURM_SCRATCH`, `module load` lines, allocation accounts) live in layered JSON (or TOML) profiles (`Site → Group → Machine → Personal`). A guided **Profile Builder** dialog in Avogadro can test SSH, probe partitions/modules, preview the rendered script, run a water test job, and export a sanitized profile (secrets and username stripped) for a class, research group, or a shared `OpenChemistry/avogadro-profiles` repo like the plugin ecosystem.
- **A tiny 5-method core for backend plugins.** A working compute backend only needs `describe`, `testConnection`, `submitJob`, `lookupJobs`, and `fetchFiles`. Everything else (`listQueues`, `listTools`, `submitWorkflow`, `cancelJob`, `listJobs`, `peekFile`, `estimateCost`, `discoverPrograms`) is opt-in via declared capabilities. That keeps gateway plugins small enough for the WebMO, Galaxy, or AiiDA communities to maintain themselves. 🤞
- **Standardized post-run steps in Program Adapters.** Real workflows rarely end when the QM binary exits—you often want to convert ORCA `.gbw` → Molden (`orca_2mkl`), run Gaussian `formchk`, remove `.tmp`/`.rwf` scratch files, or gzip large outputs before transferring them back. Putting these once in curated “Program Adapter” steps lets users toggle them safely with checkboxes instead of scattering raw shell snippets across profiles.

---

<div class="post-metadata">

**Author:** ![ghutchis](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/ghutchis/32/456_2.png) [@ghutchis](https://discuss.avogadro.cc/u/ghutchis)\
**Post date:** [December 4, 2026, 5:27pm UTC](https://discuss.avogadro.cc/t/molequeue-and-backend-plugins/7611/2 "2026-12-04T17:27:09Z")

</div>

Okay - here are some questions to prompt discussion:

I’ve been planning to prototype this incrementally (starting with `local`, MoleQueue bridge, an SSH/Slurm + direct-Linux `hpc` prototype, and one REST gateway like WebMO since we use that here at Pitt and there’s a public instance). Before writing code, I’d love your thoughts:

1. **MoleQueue’s role going forward:** For those using MoleQueue—would you prefer it to stay focused as a standalone desktop tool connected via the bridge, or also adopt parts of the v2 protocol (like shareable profiles and post-run conversion steps)? I’m guessing the latter.
2. **Cluster quirks we shouldn’t miss:** What weird requirements does your HPC cluster have (MFA/Duo, secure authentication requirements, mandatory wrapper scripts, node-local scratch, no `sacct`, restricted login-node polling) that a profile-driven `hpc` backend needs to handle cleanly?
3. **Post-run steps:** Beyond `orca_2mkl -molden`, Gaussian `formchk`, temp cleanup, and compression, what post-processing do you almost always run on the cluster before bringing files home?
4. **Helping out:** Are there specific pieces—MoleQueue updates, a site profile for your cluster, a WebMO/Galaxy backend, or the Profile Builder UI—that you’d be interested in testing or helping maintain?

---

<div class="post-metadata">

**Author:** ![ghutchis](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/ghutchis/32/456_2.png) [@ghutchis](https://discuss.avogadro.cc/u/ghutchis)\
**Post date:** [December 4, 2026, 5:27pm UTC](https://discuss.avogadro.cc/t/molequeue-and-backend-plugins/7611/3 "2026-12-04T17:27:37Z")

</div>

And of course “anything I’ve forgotten?” (lol) although I’m sure this will become obvious as we start to code this…

---

<div class="post-metadata">

**Author:** ![brockdyer03](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/brockdyer03/32/2015_2.png) [@brockdyer03](https://discuss.avogadro.cc/u/brockdyer03)\
**Post date:** [December 4, 2026, 6:19pm UTC](https://discuss.avogadro.cc/t/molequeue-and-backend-plugins/7611/4 "2026-12-04T18:19:35Z")

</div>

Profiles over plugins is absolutely preferable, even more if the profiles are TOML. There should be some way to customize beyond what is given in a profile, since I can already imagine someone making a mistake in a profile and other users being frustrated by it.

One thing to keep in mind is that many clusters have extensive module systems, which would need to be supported somehow. For example, on the Perlmutter supercomputer, you have to load a module that gives you access to a pre-compiled version of Quantum ESPRESSO with all of the required libraries.

As you mentioned in a question, MFA is going to need support for sure. On Perlmutter, the most common login path prompts the user for their password and a one-time password from say, Google Authenticator. Another thing to note is that often a cluster has multiple queues with different limits, e.g. on Perlmutter the debug queue limits jobs to 30 minutes on at most 4 nodes, and you can only submit 5 debug jobs at a time.

I think MoleQueue should adopt some of the new features in the v2 protocol for sure. It’d make life a heck of a lot easier when using it if you could load up a cluster profile instead of specifying it yourself.

Post-run steps are important, though are less important than just getting things up and running. It’d be nice if Avogadro could support a nice GUI for workflows but that would likely need a lot of work, since you’d need a lot of extra logic for things like run failure detection, translating information (e.g. you may want to run a geometry optimization followed by a frequency calculation, and would need to grab the final optimized geometry and put it into the freq input). I have a lot of experience in this area, so when we get there I would be very interested in adding this feature.

---

<div class="post-metadata">

**Author:** ![ghutchis](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/ghutchis/32/456_2.png) [@ghutchis](https://discuss.avogadro.cc/u/ghutchis)\
**Post date:** [December 4, 2026, 6:42pm UTC](https://discuss.avogadro.cc/t/molequeue-and-backend-plugins/7611/5 "2026-12-04T18:42:10Z")

</div>

Here’s a draft of a profile - as I said it would be great to have some sort of UI to help build it:

```toml
# Shareable group profile (secrets and username are stored locally, never exported)
profile = 1
name = "Research Group — University Slurm Cluster"
extends = "https://raw.githubusercontent.com/OpenChemistry/avogadro-profiles/main/sites/university-cluster.toml"
version = 1
maintainer = "pi@example.edu"
lastVerified = "2026-12-04"
backend = "hpc"
defaultQueue = "smp"
jobRoot = "/shared/examplegroup/$USER/avogadro-jobs"

[transport]
kind = "ssh"
host = "cluster.example.edu"
controlPersist = "8h"

[scheduler]
dialect = "slurm"
pollMinimumSec = 60

[scheduler.options]
clusters = "smp"
memoryFlag = "mem-per-cpu"
gpuFlag = "--gres=gpu:{{gpus}}"
account = "examplegroup"
extraDirectives = ["--signal=B:USR1@300"] # warn 5 min before walltime

[queues.smp]
maxCores = 64
maxMemoryMB = 256000
maxWalltime = "144:00:00"
gpus = 0

[queues.gpu]
maxCores = 16
maxMemoryMB = 128000
maxWalltime = "72:00:00"
gpus = 4

[scratch]
kind = "node-local"
path = "$SLURM_SCRATCH"
syncLogEverySec = 60

[programs.ORCA]
env = "module"
setup = ["module load orca/6.1.0"]

[programs.xtb]
env = "path"
path = "/shared/examplegroup/bin/xtb"

[postRun]
steps = ["orca_2mkl"] # runs orca_2mkl on the compute node
cleanupTemp = true
compress = "gzip"
compressRoles = ["orbitals", "volume"]

```

---

<div class="post-metadata">

**Author:** ![ghutchis](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/ghutchis/32/456_2.png) [@ghutchis](https://discuss.avogadro.cc/u/ghutchis)\
**Post date:** [December 4, 2026, 6:50pm UTC](https://discuss.avogadro.cc/t/molequeue-and-backend-plugins/7611/6 "2026-12-04T18:50:00Z")

</div>

The module side is fairly common (e.g., sometimes you need to load a few modules at once, e.g. a specific MPI library or compiler environment).

I haven’t spent much time looking into the MFA side, but I think [libssh](https://www.libssh.org//) handles this. I’m less sure about hardware keys, etc.

> [@brockdyer03](#):
>
> less important than just getting things up and running

Yes. Exactly. And of course you always realize a few things once you get something running. 🙂

---

<div class="post-metadata">

**Author:** ![ghutchis](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/ghutchis/32/456_2.png) [@ghutchis](https://discuss.avogadro.cc/u/ghutchis)\
**Post date:** [December 4, 2026, 6:52pm UTC](https://discuss.avogadro.cc/t/molequeue-and-backend-plugins/7611/7 "2026-12-04T18:52:20Z")

</div>

Oh, one other thing to be clear: **Credentials stay in the OS keychain** or via `${HOME}/.ssh` not in any Avogadro file or setting.

---

<div class="post-metadata">

**Author:** ![brockdyer03](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/brockdyer03/32/2015_2.png) [@brockdyer03](https://discuss.avogadro.cc/u/brockdyer03)\
**Post date:** [December 4, 2026, 8:12pm UTC](https://discuss.avogadro.cc/t/molequeue-and-backend-plugins/7611/8 "2026-12-04T20:12:13Z")

</div>

> [@ghutchis](#):
>
> … it would be great to have some sort of UI to help build it

Most IDEs will give some autocomplete if there’s a schema, which would be a good start. It could also be just built into MoleQueue as a GUI, but that seems like it may need to happen after some ideas are had about what actually could/should go into the file.

---

<div class="post-metadata">

**Author:** ![ghutchis](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/ghutchis/32/456_2.png) [@ghutchis](https://discuss.avogadro.cc/u/ghutchis)\
**Post date:** [December 4, 2026, 10:08pm UTC](https://discuss.avogadro.cc/t/molequeue-and-backend-plugins/7611/9 "2026-12-04T22:08:03Z")

</div>

One other thought - for `local` calculations, we should have the input generator declare a likely name or list of possible names, eg `rungms` or `g16` to search the environment.
