Skip to main content

Multi-CPU / multi-GPU parallel tempering

Project description

pypi version license DOI

Parallel tempering is a simulation method that accelerates sampling of configuration space in systems with rugged energy landscapes. Applications range from the simulation of biomolecules to studies of phase transitions in condensed matter or spin glasses. The key idea is to perform Monte Carlo or molecular dynamics simulations of independent replicas of the system of interest at different state conditions (say, temperatures). During the simulation, the states of pairs of replicas are exchanged in a way that respects detailed balance. Through these exchanges replicas can overcome energy barriers and sample the configuration space more efficiently.

Since replicas evolve independently between exchanges, the algorithm is straightforward to parallelize. atooms-pt relies on mpi4py to distribute groups of replicas to multiple CPUs and/or GPUs and it builds on the atooms framework to decouple the algorithm from the underlying simulation backend. The scalability is excellent up to several tens of CPUs or GPUs. The preferred simulation backend is RUMD, a molecular dynamics code running entirely on GPUs that is very efficient even on small system sizes, say of a few hundreds particles.

Quick start

>From the command line: --steps 10 -T 1.0,0.9,0.8 -e 50000 -i data/ /tmp/output_dir

This will run 10 steps of parallel tempering simulation for three replicas, starting from the configuration in data/ and writing output to /tmp/output_dir. The replicas are simulated at temperatures 1.0, 0.9 and 0.8 and temperature exchanges are attempted every 50000 steps of the underlying simulation backend.

The same simulation can be ran from python:

from atooms.backends.rumd import Rumd
from atooms.simulation import Simulation
from atooms.parallel_tempering import ParallelTempering

temperatures = [1.0, 0.9, 0.8]

# Create backends and wrap them as simulation instances
backend = [Rumd(integrator='nvt', temperature=T) for T in temperatures]
sim = [Simulation(s) for s in backend]
pt = ParallelTempering(sim, params=temperatures,
                       steps=10, exchange_interval=50000)

The current implementation targets the RUMD molecular dynamics package, but any atooms simulation backend (for instance, LAMMPS) should work just fine.



>From the python package index

pip install atooms-pt

>From the code repository

git clone
python install


This code was developed in the context of PRACE (“Partnership for Advanced Computing in Europe”) project 2010PA1751 “Multi-GPU parallel tempering simulations”.

Project details

Download files

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

Files for atooms-pt, version 1.1.1
Filename, size File type Python version Upload date Hashes
Filename, size atooms_pt-1.1.1-py2.py3-none-any.whl (16.3 kB) File type Wheel Python version py2.py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page