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

Pipeline codecov

With pylammpsmpi you can control a mpi4py parallel LAMMPS instance from a serial python process or a Jupyter notebook. Internally pylammpsmpi leverages the executorlib 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.3.9.tar.gz (19.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pylammpsmpi-0.3.9-py3-none-any.whl (24.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pylammpsmpi-0.3.9.tar.gz
  • Upload date:
  • Size: 19.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pylammpsmpi-0.3.9.tar.gz
Algorithm Hash digest
SHA256 11de93a24ac68fb89659aefd69288ab6b46281f7ffd2ecf7be2fea837c2d4ffb
MD5 702322122147413595f9d808acf6365c
BLAKE2b-256 5da96afaa3b2efe3dfe775aa32c1a9ed871ff4eaffcf0d7ee3b279a59f296238

See more details on using hashes here.

Provenance

The following attestation bundles were made for pylammpsmpi-0.3.9.tar.gz:

Publisher: deploy.yml on pyiron/pylammpsmpi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: pylammpsmpi-0.3.9-py3-none-any.whl
  • Upload date:
  • Size: 24.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pylammpsmpi-0.3.9-py3-none-any.whl
Algorithm Hash digest
SHA256 cf3dde226d89b7c4c80f718cb55e8d9d7f2a0793067b1ea3ccc679fba3b74b14
MD5 4392ff707485150888016fa3f7054fc6
BLAKE2b-256 6fa6b5c1eba876a154e87b1252b3fff2c82dcea068d7fce6557e2b49ed5ae713

See more details on using hashes here.

Provenance

The following attestation bundles were made for pylammpsmpi-0.3.9-py3-none-any.whl:

Publisher: deploy.yml on pyiron/pylammpsmpi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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