run_open_mpi

Contents

run_open_mpi#

jetset.mcmc_ultranest.run_open_mpi(sampler, n_proc=8, ultranest_output_dir=None, min_num_live_points=64, nsteps=1, max_num_improvement_loops=1, min_ess=100, num_c_threads=1, extra_mpirun_args='')[source]#

Run UltraNestSampler.run_sampler through mpirun.

Parameters:
  • sampler (UltraNestSampler) – Configured sampler instance to serialize and execute.

  • n_proc (int, optional) – Number of MPI ranks passed to mpirun -np. Default is 8.

  • ultranest_output_dir (str, optional) – Name passed to run_sampler, and resolved within run_mpi/ directory

  • min_num_live_points (int, optional) – Minimum live points forwarded to run_sampler.

  • nsteps (int, optional) – Slice-sampler step multiplier forwarded to run_sampler.

  • max_num_improvement_loops (int, optional) – Value forwarded to run_sampler.

  • min_ess (int, optional) – Minimum effective sample size target forwarded to run_sampler.

  • num_c_threads (int, optional) – Thread count forwarded to mcmc.model.set_num_c_threads in the generated MPI worker script.

  • extra_mpirun_args (str, optional) – Extra command-line arguments inserted after mpirun and before -np (for example hostfile or binding flags).

Returns:

Sampler reloaded from run_mpi/sampler.pkl after MPI completion.

Return type:

UltraNestSampler

Notes

The function deletes and recreates ./run_mpi in the current working directory, writes a helper Python script there, and temporarily sets OMP_NUM_THREADS to n_proc for the parent process while the MPI command runs.