SKILL.md
MaxwellLink core workflow
Enforce invariants
- Create new runnable inputs only under
projects/YYYY-MM-DD-NAME/. - Keep runs reproducible by storing parameters in a
config.json(or similar) and avoiding hard-coded absolute paths. - Never pass both
hub=...anddriver=...tomaxwelllink.Molecule; provide exactly one.
Choose coupling mode
- Use embedded mode when the driver can run in the same Python process:
- Construct molecules with Molecule(driver="<id>", driver_kwargs={...}).
- Use socket mode when drivers must run as separate processes or nodes:
- Construct a SocketHub(...), pass hub=hub into each Molecule(...), and launch one mxl_driver --model <id> ... per molecule.
- If local socket runs fail with MPI/network permission errors, prefer embedded mode (
Molecule(driver="...", ...)) on local machines and reserve socket mode for SLURM/HPC. - For local socket mode, you can disable MPI auto-init with
MPI4PYRCINITIALIZE=0and ensure loopback NIC usage (use127.0.0.1; set site-specific NIC selection env vars if MPI/OFI tries a non-loopback interface).
Handle units/time
- For Meep: set
timeunitsfsonMeepSimulation(...)and keep it consistent when interpreting driver times. - For SingleMode/LaserDriven: work directly in atomic units and set
dt_auexplicitly.
Handle MPI and multi-process execution
- Launch socket drivers only once (rank 0) under MPI; rely on MaxwellLink broadcasts for other ranks.
- Set generous
timeoutfor HPC and tunelatencyto match driver cost. - If attaching many molecules, consider
storeadditionaldata=Falsefor most molecules to limit memory usage; keep itTrueonly for the molecules you intend to export/plot.
Validate before running
- Use
skills/mxl-project-scaffold/scripts/mxlvalidateproject.pyto sanity-checkconfig.jsonand required files. - When debugging behavior, compare to patterns in
tests/anddocs/source/usage.rst.
References
- Solver choice:
skills/mxl-core/references/solver_quickref.md - Driver choice:
skills/mxl-core/references/driver_quickref.md