Skip to main content

Parallel Lammps Python interface - control a mpi4py parallel LAMMPS instance from a serial python process or a Jupyter notebook

Project description

pylammpsmpi - Parallel Lammps Python interface

Coverage Status Python package

With pylammpsmpi you can control a mpi4py parallel LAMMPS instance from a serial python process or a Jupyter notebook. Internally pylammpsmpi leverages the pympipool communication interface to connect the serial python process the user interacts with, with the mpi4py parallel LAMMPS instance. The advantage of separating the mpi4py parallel LAMMPS instance from the rest of the workflow is that the workflow can be written as serial python code, while still benefiting from the parallel performance of LAMMPS. Still this comes at the cost of additional data transfer, as the LAMMPS pointers cannot be transferred this way and the linked data has to be copied instead. So copying large atomistic structures can decrease the performance of the pylammpsmpi interface in comparison to writing your own fully mpi4py parallel LAMMPS workflows.

Interfaces

The pylammpsmpi module implements three different interfaces for different use cases:

  • pylammpsmpi.LammpsBase: The most basic interface is the LammpsBase, it implements the same commands like the default lammps.lammps interface and returns the same datatypes. With this API compatibility to the standard interface, this interface is commonly the easiest way to accelerate a serial LAMMPS based workflow by leveraging mpi4py parallel LAMMPS instances.
  • pylammpsmpi.LammpsConcurrent: Inspired by the concurrent.futures module in the standard python library the pylammpsmpi.LammpsConcurrent interface implements the same API as the pylammpsmpi.LammpsBase class but rather than holding the controlling process until the mpi4py parallel LAMMPS instance finishes the execution of a given set of commands, the pylammpsmpi.LammpsConcurrent interface returns a concurrent.futures.Future object. This enables the development of asynchronous / concurrent workflows.
  • pylammpsmpi.LammpsLibrary: Finally, the pylammpsmpi.LammpsLibrary interface adds a higher level interface on top of the default lammps.lammps interface. This higher level interface provides direct access to the commands and thermodynamic properties used in the LAMMPS input files. Especially for experienced LAMMPS users who are familiar with the LAMMPS input files this interface simplifies switching from file based input to using the python interface.

The choice of interface depends on the users background, experience and the simulation protocol the user wants to implement. Still internally all three interfaces are based on the pylammpsmpi.LammpsConcurrent interface, so they use an additional thread to connect the mpi4py parallel LAMMPS instance to the serial python process or Jupyter notebook.

Documentation

License

pylammpsmpi is released under the BSD license https://github.com/pyiron/pylammpsmpi/blob/main/LICENSE . It is a spin-off of the pyiron project https://github.com/pyiron/pyiron therefore if you use pylammpsmpi for calculation which result in a scientific publication, please cite:

@article{pyiron-paper,
  title = {pyiron: An integrated development environment for computational materials science},
  journal = {Computational Materials Science},
  volume = {163},
  pages = {24 - 36},
  year = {2019},
  issn = {0927-0256},
  doi = {https://doi.org/10.1016/j.commatsci.2018.07.043},
  url = {http://www.sciencedirect.com/science/article/pii/S0927025618304786},
  author = {Jan Janssen and Sudarsan Surendralal and Yury Lysogorskiy and Mira Todorova and Tilmann Hickel and Ralf Drautz and Jörg Neugebauer},
  keywords = {Modelling workflow, Integrated development environment, Complex simulation protocols},
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pylammpsmpi-0.2.7.tar.gz (24.7 kB view details)

Uploaded Source

Built Distribution

pylammpsmpi-0.2.7-py3-none-any.whl (32.0 kB view details)

Uploaded Python 3

File details

Details for the file pylammpsmpi-0.2.7.tar.gz.

File metadata

  • Download URL: pylammpsmpi-0.2.7.tar.gz
  • Upload date:
  • Size: 24.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for pylammpsmpi-0.2.7.tar.gz
Algorithm Hash digest
SHA256 3963bb46b0bc725b0f9ee3eb5cd34e6a91b346b18282a1ed12fa2a61da007b05
MD5 677ffee8ece0fed9f4d81380222d0e46
BLAKE2b-256 89a8acf1b0b5f121fd4edbca25fb62db83a6da92bccc10591ed52d651c57e162

See more details on using hashes here.

File details

Details for the file pylammpsmpi-0.2.7-py3-none-any.whl.

File metadata

  • Download URL: pylammpsmpi-0.2.7-py3-none-any.whl
  • Upload date:
  • Size: 32.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for pylammpsmpi-0.2.7-py3-none-any.whl
Algorithm Hash digest
SHA256 1d9f45a56ae439ed830d59fa5d6af542a4e323b7665f19f65234c7b42bf87678
MD5 e60cc5354ea413ba3d442e11066a56de
BLAKE2b-256 13981e7fa1f48ba2e955801a50e6ffa87e0387f8234e17ae6149215b834e361b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page