Connect the Slurm autodiscovery module to existing infrastructure so users benefit from it without changing their workflow.
Depends on: #7 (SLURM cluster autodiscovery)
Scope
SlurmConfig.from_cluster() class method that auto-populates fields from discovered cluster info
- CLI command:
mdfactory config cluster (show discovered info)
- CLI command:
mdfactory config cluster --json (machine-readable)
- Optional
[slurm] section in config.ini for manual overrides
- When
--partition/--account not provided to analysis run --slurm, fall back to autodiscovered defaults
Design notes
SlurmConfig.from_cluster() uses a lazy import of mdfactory.performance.cluster inside the method body. This avoids a hard import-time dependency on the performance package and ensures analysis/submit.py remains importable on machines without SLURM.
Config integration
[slurm]
; Optional overrides. When empty, values are autodiscovered.
ACCOUNT =
PARTITION_CPU =
PARTITION_GPU =
DEFAULT_QOS =
When set, these take priority over autodiscovery. When empty, the module queries SLURM at runtime.
Acceptance criteria
mdfactory config cluster prints partition/account/GPU info on a SLURM cluster
mdfactory config cluster prints helpful message on non-SLURM machine
mdfactory analysis run --slurm works without explicit partition/account when autodiscovery succeeds
Connect the Slurm autodiscovery module to existing infrastructure so users benefit from it without changing their workflow.
Depends on: #7 (SLURM cluster autodiscovery)
Scope
SlurmConfig.from_cluster()class method that auto-populates fields from discovered cluster infomdfactory config cluster(show discovered info)mdfactory config cluster --json(machine-readable)[slurm]section in config.ini for manual overrides--partition/--accountnot provided toanalysis run --slurm, fall back to autodiscovered defaultsDesign notes
SlurmConfig.from_cluster()uses a lazy import ofmdfactory.performance.clusterinside the method body. This avoids a hard import-time dependency on the performance package and ensuresanalysis/submit.pyremains importable on machines without SLURM.Config integration
When set, these take priority over autodiscovery. When empty, the module queries SLURM at runtime.
Acceptance criteria
mdfactory config clusterprints partition/account/GPU info on a SLURM clustermdfactory config clusterprints helpful message on non-SLURM machinemdfactory analysis run --slurmworks without explicit partition/account when autodiscovery succeeds