triqs_dftkit.qe.driver.MPIHandler
- class triqs_dftkit.qe.driver.MPIHandler(mpi_exec: str = 'mpirun', n_cores: int = 1)[source]
Handles MPI configuration and execution environment for parallel DFT calculations.
This class encapsulates MPI-related configuration and provides utilities for running parallel executables with proper environment variable handling.
Attributes
mpi_exec
(str) The MPI executor command (e.g., “mpirun”, “mpiexec”, “srun”).
n_cores
(int) Number of MPI processes/cores to use for parallel execution.
Methods
Retrieve essential environment variables for subprocess execution.
Check if this is the master MPI node.
report(*args)Report a message (only from master MPI node).
Examples
>>> mpi_handler = MPIHandler(mpi_exec="mpirun -np 4", n_cores=4) >>> env = mpi_handler.get_env_vars()