irradiapy.io.bzip2lammpsreadermpi module

This module contains the BZIP2LAMMPSReaderMPI class.

class irradiapy.io.bzip2lammpsreadermpi.BZIP2LAMMPSReaderMPI(file_path, encoding='utf-8', comm=<factory>, parallelization=0)[source]

Bases: MPIExceptionHandlerMixin

A class to read data from a LAMMPS dump file compressed with bzip2 in parallel using MPI.

Note

Assumed orthogonal simulation box.

Note

Rank 0 performs indexed, multi-threaded decompression using indexed_bzip2 of each timestep one by one, then scatters strings of atom data to all ranks, which build local numpy structured arrays.

Parameters:
  • file_path (Path) – Path to the .bz2 LAMMPS dump file.

  • encoding (str) – Text encoding used inside the dump (default: ‘utf-8’).

  • comm (Comm) – The MPI communicator (default: MPI.COMM_WORLD).

  • parallelization (int) – indexed_bzip2 parallelization setting. 0 = use all cores (recommended); 1 = serial; N > 1 = use N threads.

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
parallelization: int = 0