1. Running on an HPC cluster
LatticeMind builds and validates inputs on your machine, then offloads the heavy calculation to a remote workstation or Slurm cluster and fetches the results back. This tutorial walks through the full cycle. For the settings reference, see Remote & HPC execution.
Fig. 1.1 The local-build / remote-run / fetch-back cycle.
1.1. Before you start
Confirm plain SSH already works to your cluster — LatticeMind uses your existing SSH configuration:
ssh my-cluster-login true
1.2. Step 1 — Define the cluster profile
Add a Slurm profile to ~/.latticemind/remote_profiles.toml:
[profiles.cluster]
host = "my-cluster-login"
scheduler = "slurm"
remote_root = "/scratch/myuser/latticemind_runs"
transfer = "rsync"
rescu_command = "rescu"
shell_preamble = "module load rescu"
account = "my-account"
partition = "short"
time = "02:00:00"
nodes = 1
ntasks = 4
cpus_per_task = 1
mem = "8G"
1.3. Step 2 — Select and test it
Inside LatticeMind:
/remote profile cluster
/remote setup cluster # install SSH session-reuse settings
/remote warm cluster # approve 2FA once, if your cluster uses it
/remote test cluster # preflight: SSH, transfer, scheduler, solver
/compute slurm
/remote test verifies the connection, the transfer tool, the scheduler, and
that the solver command exists on the remote host — catching problems before you
submit.
1.4. Step 3 — Build, preview, and submit
Describe your calculation as usual, for example:
Do an SCF and band structure calculation for silicon.
LatticeMind plans and validates locally. Before it submits anything, preview the job:
/launch-preview
This shows the exact remote directory, upload method, the generated Slurm job script, the input files, and the requested resources. When it looks right:
/execute on
run it
LatticeMind bundles the validated job (inputs, scripts, pseudopotentials, a manifest, and the job script), uploads it, and submits it.
1.5. Step 4 — Track and fetch
/remote status # queued / running / complete
/remote logs 80 # tail the remote log
/remote fetch # bring verified outputs back into the project
/remote workdir # show the remote and local bundle paths
Once fetched, the results land in your local project exactly as if they had run locally — post-processing, plots, and the report follow.
1.6. Recovering an interrupted job
If a job is interrupted (wall-time limit, node failure), you do not start over. LatticeMind preserves the inputs and save paths, so you can:
/remote status
/failed # see which steps need attention
/continue <target> # resume the interrupted or downstream steps
Because inputs are unchanged, RESCU restarts cleanly, and only the affected and downstream steps are recomputed.
Note
LatticeMind automatically applies serial-only guardrails to certain RESCU post-analysis stages (phonon band structure/DOS, optics, Raman), stripping MPI launchers for them. See Remote & HPC execution.
1.7. Safety and cost
LatticeMind never sends your API key to the cluster and never runs the AI agent remotely — only the solver job.
Use
/costbefore launching dense k/q grids, relaxations, DFPT, or large-cell workflows, and start with a cheap validation run.