irradiapy.io.lammpsreadermpi module

This module contains the LAMMPSReaderMPI class.

class irradiapy.io.lammpsreadermpi.LAMMPSReaderMPI(file_path, encoding='utf-8', comm=<factory>)[source]

Bases: MPIExceptionHandlerMixin

A 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).

close()[source]

Closes the file associated with this reader.

Return type:

None

comm: Comm
encoding: str = 'utf-8'
file_path: Path