deMonPy.profile

Back to DeMonNanoPy API Reference

Description

Process management: build the command line, environment and execute the binary.

Source file: deMonPy/profile.py

Classes

Process

Run the deMon/deMonNano binary directly or through a launcher (e.g. "mpirun -np {nprocs}").

Methods

Method Signature Description
__init__ __init__(executable, workdir="", omp_threads=1, prefix="DEMON", launcher=None, nprocs=1) Store paths, validate positive integers, parse the launcher template.
build_command build_command(exe) Build the full command line including launcher and {nprocs} substitution.
build_env build_env() Build the environment (OMP_NUM_THREADS, ...).
execute execute(check=True, timeout=None) Run the command, optionally with a timeout; raises ExecuteFailed on non-zero exit when check=True.

Private helpers

  • _positive_int (static)
  • _parse_launcher (static)
  • _uses
  • _check_consistency

Functions

Function Signature Description
assert_flags assert_flags(myset) Decorator: run a method only when all given flags are active (lower-cased parameter keys).
exclude_flags exclude_flags(myset) Decorator: run a method only when none of the given flags are active.