I've mentioned previously that there's some interest for backend or queue adapter 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
- 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.)
- A separate plugin for every cluster. Asking every university or lab to maintain custom Python/C++ code just because their Slurm uses
--meminstead of--mem-per-cpu, or needs-M smporsuborca, 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,
--memvs--mem-per-cpu,$SLURM_SCRATCH,module loadlines, 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 sharedOpenChemistry/avogadro-profilesrepo like the plugin ecosystem. - A tiny 5-method core for backend plugins. A working compute backend only needs
describe,testConnection,submitJob,lookupJobs, andfetchFiles. 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 Gaussianformchk, remove.tmp/.rwfscratch 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.
Discuss this on our forum.
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.
Here’s a draft of a profile - as I said it would be great to have some sort of UI to help build it:
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 handles this. I’m less sure about hardware keys, etc.
Yes. Exactly. And of course you always realize a few things once you get something running. :slight_smile: