Skip to main content

milady — Python launcher for the MiLaDy solver

milady_run(...) stages a working directory and runs mpirun -np N milady_main.exe in it, so a MiLaDy run becomes one Python call.

from milady import milady_run

res = milady_run(
    input="/path/to/vacancy.ml",          # the .ml namelist
    db_model="/path/to/db_model.in",       # the db_model table
    DB="/path/to/MPtrj_2022.9_full.json",  # database: .json / .xyz file, or a classic DB dir
    nprocs=4,
)

print(res.returncode, res.duration_s, res.workdir)
for f in res.output_files:                 # files the run created / changed
    print(f)

Equivalent on the command line:

$ milady-run -i vacancy.ml -m db_model.in -d MPtrj_2022.9_full.json -n 4

What it does

The solver always runs inside a directory and reads fixed names from it. milady_run builds that directory for you:

staged file source name used
name.in derived one line: the run stem (e.g. vacancy)
<stem>.ml input= stem from input's basename, or name=
<db_file> db_model= db_file= in the .ml (default db_model.in)
<db_path> DB= db_path= in the .ml; else DB for a directory (classic DB/), else the file's basename

The database is symlinked by default (it can be tens of GB); pass copy_db=True to copy it. Small text inputs are copied. Extra auxiliary inputs (*.gin, train_files.milady, …) go through extra_files=[...].

Finding the solver

Resolution order (first hit wins):

  1. exe= / mpirun= arguments
  2. $MILADY_EXE / $MILADY_MPIRUN
  3. milady_main.exe / mpirun on PATH (the case after conda install milady)
  4. $CONDA_PREFIX/bin, then $MLD_BUIDIR/bin (and _gnu / _intel / _mix variants)

Runtime shared libraries: $MILADY_LIB (a :-list) if set, otherwise the conda prefix the solver lives in plus whatever ldd currently resolves — these are prepended to LD_LIBRARY_PATH for the child process only.

Key options

argument default meaning
nprocs 1 MPI ranks (mpirun -np)
workdir fresh temp dir where to run; not deleted afterwards
name from input run stem
mpi_args () extra launcher tokens, e.g. ["--oversubscribe"]
env None extra environment for the run
use_mpirun None None = auto (launcher if found or nprocs>1)
stream_output False also echo solver output live
check True raise MiladyError on non-zero exit
timeout None seconds before the run is killed
log_file "milady.out" combined stdout+stderr log written in workdir
output None extra combined-log path (abs, or relative to CWD), e.g. run.out

Install

The PyPI distribution name is milady-mlip; the import name stays milady.

want command contents
solver + launcher, no toolchain pip install milady-mlip self-contained wheel (Linux x86-64); pulls mkl
solver + launcher, via conda conda install -c <ch> milady milady + milady-bin (see ../conda/)
launcher only (you supply milady_main.exe) pip install ./python pure Python, any OS

The self-contained wheel is built by wheel/build_wheel.sh (desktop) or the wheels GitHub Actions workflow (manylinux, PyPI-ready) — see wheel/README.md.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

milady_mlip-2.0.1.tar.gz (17.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

milady_mlip-2.0.1-py3-none-manylinux_2_28_x86_64.whl (8.2 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

File details

Details for the file milady_mlip-2.0.1.tar.gz.

File metadata

  • Download URL: milady_mlip-2.0.1.tar.gz
  • Upload date:
  • Size: 17.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for milady_mlip-2.0.1.tar.gz
Algorithm Hash digest
SHA256 c157c94e3bfeda1a57de36d3b126f060228653135298baa0596c0cebf4b4d6f5
MD5 07f13b453e86edf42951c6d025ca68be
BLAKE2b-256 1d939ed85eef4a6d0866a6fdbb197745548c314446c500f3a4aea825202d9c3f

See more details on using hashes here.

Provenance

The following attestation bundles were made for milady_mlip-2.0.1.tar.gz:

Publisher: wheels.yml on mcmarinica/ml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file milady_mlip-2.0.1-py3-none-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for milady_mlip-2.0.1-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7a3bcbd04ffda4d079fd20b11c4e69513c54438a8343d997394fba8447cd0cb5
MD5 defb51e58f8623ca63ef2bf39e6adadc
BLAKE2b-256 5dbe3e529886edc7a7992ec5f56a36e1750f432ad84cd6a0fc6c3d31fa5648cd

See more details on using hashes here.

Provenance

The following attestation bundles were made for milady_mlip-2.0.1-py3-none-manylinux_2_28_x86_64.whl:

Publisher: wheels.yml on mcmarinica/ml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

2.0.1 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page