Skip to content

casino-mcp 0.2.0

Choose a tag to compare

@Konjkov Konjkov released this 26 Aug 12:22
· 22 commits to main since this release

Two things, one release. Stopping a calculation and continuing it now go through CASINO’s
own scripts — haltqmc and runqmc — instead of through signals and file moves of this
layer’s own devising. And the test data became a check on CASINO rather than a record of it:
every calculation the suite reads now lives in this repository, runs in minutes, and can be
re-run against a newly built CASINO to see whether the output format moved under the parser.

pip install casino-mcp

On PyPI: https://pypi.org/project/casino-mcp/0.2.0/

Added

  • casino_run(resume=true) (casino-mcp run --continue): carry an interrupted run on instead
    of starting it again. Which of CASINO's two continuation routes that takes is read out of
    out rather than chosen here: a run CASINO stopped on max_cpu_time / max_real_time left
    a CONTINUATION INFO: block and is continued by runqmc --continue, and a run that was
    interrupted is continued by a plain runqmc over the input that haltqmc -u rewrote —
    --continue errstops there, on continuation info that was never written. A run that reached
    its own end is refused: there is nothing to continue. The reply says which route was taken.
  • CASINO_HALTQMC, alongside CASINO_RUNQMC: an explicit path to haltqmc, otherwise PATH,
    then $CASINO_HOME/bin_qmc/haltqmc. casino-mcp config reports it and says when it is
    missing — a job can still be stopped without it, but its directory will not be tidied.
  • examples/: eighteen real CASINO calculations committed with the out files they produced,
    and enough of their inputs to be re-run. They are a settings cover, not a sample — chosen out
    of PyCasino's 526 so that every runtype, basis type, sampling method, optimiser and
    wavefunction option appears at least once, at the smallest total size that achieves it,
    together with a run that never printed an energy and one interrupted mid-optimisation.
  • tests/test_examples.py: the tree parses, and it still covers every setting it was
    assembled to cover. Runs without CASINO, so a calculation cannot be dropped from examples/
    without the suite naming the setting that went with it.
  • tools/refresh_examples.py and tests/integration/test_examples_rerun.py: the tree is
    re-run against the installed CASINO and compared with what was committed. The test asserts
    only that no phase, keyword or number parse_out reads has disappeared, which is what a
    changed output format looks like from a parser's side. Moved values are reported, never
    asserted: a new release may legitimately produce different numbers, and random_seed does
    not pin an optimisation run anyway — it redistributes configurations across MPI processes and
    lands somewhere slightly different each time. Efficiency is excluded from the comparison
    entirely, being computed from a measured time that rounds to zero on a short block.

Changed

  • casino_stop no longer signals the whole process tree and clears the lock file itself. It
    sends SIGTERM to that job's casino processes and to nothing else — the same signal
    haltqmc -k sends, except that haltqmc's own kill is a pkill -x casino over every CASINO
    process the account owns, which on a machine running several jobs would take the others down
    too. The ranks are found by session id, because mpirun puts each of them in a process group
    of its own and killpg therefore never reaches them. runqmc is left alive to finish its
    epilogue — the per-node output concatenated into out, its own lock file removed — and only
    a job still running after timeout has its process group signalled and then killed.
  • Everything a stop then does to the directory is haltqmc -f -u: config.out to config.in,
    the lock and marker files, and input rewritten for the work that is left. The reply carries
    what it did under halt. Since that rewrite is the one thing restart cannot undo — CASINO
    refuses newrun : F without the config.in restarting deletes — the input as it was is
    copied into the job directory first, and restart=true on a directory whose input is set
    up to continue is refused with that copy's location.
  • Breaking: overwrite is replaced by restart, which does what overwrite only claimed
    to. overwrite=true lifted the refusal to start in a directory that already held an out
    and then deleted nothing, so runqmc — which appends — produced an out containing two
    runs, and left the previous .hist files and configs to be appended to as well.
    restart=true deletes them: out, out_part.N, .out_proc*, vmc.hist, dmc.hist and
    their numbered backups, config.in/config.out and their _fixed/_nofixed forms,
    correlation.out.N, parameters.N.casl, saved_part_N/. Inputs are never touched — the
    list is named rather than derived, because the same directory holds the wave function, the
    pseudopotentials and a correlation.data that is usually hand-edited. The reply carries
    removed, the names that went. Nothing is deleted until every check that could refuse the
    run has passed.
  • The parser fixtures under tests/data/ were regenerated on CASINO v3.1.24 and now each keep
    the input that produced them, so their asserted values can be reproduced rather than
    trusted. The DMC fixture moved from krypton to beryllium — 4 electrons instead of 36 — and
    from a single statistics block to 2 equilibration and 20 statistics blocks, which is the
    shape a wandering DMC population actually shows up in and which nothing was asserting
    before. The interrupted fixture was left alone; it was already v3.1.24, and a run that was
    killed cannot be reproduced by running.
  • The integration suite reads examples/ and nothing else: --examples-dir, $CASINO_EXAMPLES
    and the dependency on a PyCasino checkout are gone. Installing casino-mcp does not install
    PyCasino, so pytest -m integration now needs only CASINO itself.
  • The example calculations were shortened and re-run in one pass, so the tree takes minutes
    rather than days to reproduce. This costs statistics and no output format: the longest run
    went from 2.5 hours to a couple of minutes with every phase, keyword and printed number
    intact. Two examples are cut below the point where CASINO can reblock, which is the one
    output shape the tree previously had no instance of.