Installation¶
SCGO is on PyPI. Python 3.12 or newer.
SQLite needs the JSON1 extension (pysqlite3-binary if your build lacks it).
The base install includes libmolsymm>=3.0 for point-group search.
The EMT examples in Quick start need only the base package. A
machine-learning potential needs exactly one extra. Do not mix [mace],
[uma], and [upet]. Missing or conflicting stacks raise
SCGOConfigurationError.
pip install scgo # EMT tutorial
pip install "scgo[mace]" # or [uma] / [upet]
Current pins (see pyproject.toml):
[mace]:mace-torch==0.3.17,torch-sim-atomistic[mace]==0.6.2,e3nn==0.4.4,nvalchemi-toolkit-ops[torch]==0.4.1[uma]:fairchem-core>=2.25.0,torch-sim-atomistic[fairchem]==0.6.2[upet]:upet>=0.3.1,metatomic-torchsim>=0.1.3,torch-sim-atomistic==0.6.2
The MACE default is MatPES r²SCAN plus DFT-D3(BJ)
(dispersion_xc="r2scan"). See All Parameters.
After scgo[upet], install the neighbor-list pin TorchSim needs:
pip install 'vesin==0.6.0' --force-reinstall --no-deps
With device unset, MACE uses CUDA, then Apple MPS, then CPU. UMA and UPET
use CUDA, then CPU. An unsupported device string raises
SCGOValidationError.
Every run_* entry point calls configure(), which sets
PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True unless that variable is
already set or SCGO_SKIP_PYTORCH_CONFIG is set.
From source¶
git clone https://github.com/rlaplaza-lab/scgo.git
cd scgo
conda env create -f environment.yml # [mace,dev]; or:
# pip install -e ".[mace,dev]" # or [uma,dev] / [upet,dev]
conda activate scgo
pre-commit install
environment.yml is MACE-oriented. Use a separate env for UMA or UPET
(vesin==0.6.0 for UPET).
Parallel jobs and HPC¶
Run folders are unique (run_YYYYMMDD_HHMMSS_ffffff), so parallel jobs under
the same parent usually write different *.db files. Prefer one output
directory (or scratch) per job when sharing a filesystem.
SQLite defaults to WAL off (fewer -wal/-shm issues on Lustre/GPFS/NFS).
Database discovery uses an in-process registry with a filesystem glob fallback.
Set SCGO_LOCAL_DEV=1 or configure_logging(..., hpc_mode=False) for
noisier local logs.
Parallelism: SCGO defaults to a single worker so it does not oversubscribe
the host alongside internal BLAS / MACE / TorchSIM thread pools. A single
top-level knob, n_jobs in go_params, scales every CPU-bound stage at
once (GA population initialization, GA offspring construction, post-GO
validation):
1(default): sequential-1: use every logical CPU-2: use every logical CPU except one (good default on shared nodes)N: cap toNworkers
Per-stage keys (optimizer_params["ga"]["n_jobs_population_init"],
optimizer_params["ga"]["n_jobs_offspring"], and validation_n_jobs)
override the top-level knob; None inherits it.
from scgo import run_go
from scgo.param_presets import get_default_params
params = get_default_params()
params["n_jobs"] = -2 # all CPUs but one, across every parallel stage
results = run_go("Pt5", params=params, seed=42, system_type="gas_cluster")