irradiapy.io.lammpsreadermpi module
This module contains the LAMMPSReaderMPI class.
- class irradiapy.io.lammpsreadermpi.LAMMPSReaderMPI(file_path, encoding='utf-8', comm=<factory>)[source]
Bases:
MPIExceptionHandlerMixinA class to read data from a LAMMPS dump file in parallel using MPI.
Note
Assumed orthogonal simulation box.
Note
Rank 0 reads each timestep one by one, then scatters strings of atom data to all ranks, which build local numpy structured arrays.
- Variables:
file_path (Path) – The path to the LAMMPS dump file.
encoding (str, optional (default="utf-8")) – The file encoding.
comm (MPI.Comm, optional (default=mpi4py.MPI.COMM_WORLD)) – The MPI communicator.
- Yields:
dict[str, Any] – A dictionary containing the timestep data with keys: ‘time’ (optional), ‘timestep’, ‘boundary’, ‘xlo’, ‘xhi’, ‘ylo’, ‘yhi’, ‘zlo’, ‘zhi’, and ‘atoms’ (as a numpy structured array).
- comm: Comm