espressomd.io package

Subpackages

Submodules

espressomd.io.mpiio module

class espressomd.io.mpiio.Mpiio(**kwargs)[source]

Bases: espressomd.script_interface.ScriptInterfaceHelper

MPI-IO object.

Used to output particle data using MPI-IO to binary files.

read(prefix=None, positions=False, velocities=False, types=False, bonds=False)[source]

MPI-IO read.

This function reads data dumped by :meth`write`. See the :meth`write` documentation for details.

Note

The files must be read on the same number of processes that wrote the data. The data must be read on a machine with the same architecture (otherwise, this might silently fail).

write(prefix=None, positions=False, velocities=False, types=False, bonds=False)[source]

MPI-IO write.

Outputs binary data using MPI-IO to several files starting with prefix. Suffixes are:

  • head: Information about fields that are dumped,

  • pref: Information about processes: 1 int per process,

  • id: Particle ids: 1 int per particle,

  • pos: Position information (if dumped): 3 doubles per particle,

  • vel: Velocity information (if dumped): 3 doubles per particle,

  • typ: Type information (if dumped): 1 int per particle,

  • bond: Bond information (if dumped): variable amount of data,

  • boff: Bond offset information (if bonds are dumped): 1 int per particle.

Note

Do not read the files on a machine with a different architecture!

Parameters
  • prefix (str) – Common prefix for the filenames.

  • positions (bool, optional) – Indicates if positions should be dumped.

  • velocities (bool, optional) – Indicates if velocities should be dumped.

  • types (bool, optional) – Indicates if types should be dumped.

  • bonds (bool, optional) – Indicates if bonds should be dumped.

Raises

ValueError – If no prefix was given or none of the output fields are chosen.

Module contents