RETURN
Simulation
April 2023

LAMMPS on Qarnot Cloud

LAMMPS is a molecular dynamics software which focuses mainly on materials modeling. It's an acronym for Large-scale Atomic/Molecular Massively Parallel Simulator.

LAMMPS can be used as a particle simulator at different scales: atomic, meso or continuum scale. It has potential in the fields of solid-state materials (metals, semiconductors) and soft matter (biomolecules, polymers).

LAMMPS simulations can run on single processors or in parallel, using message-passing techniques and a spatial-decomposition of the simulation domain.

Version

Year: 2022
Version: 2Jun2022
Included Packages: most, see Appendix

If you are interested in another version, please email us at support@qarnot.com.

We included support for JPEG/PNG image generation (through ‘dump’ commands). However, movie generation is not included. Two different profiles for LAMMPS are available: one without any acceleration package, and the other allowing you to use GPU acceleration.

Prerequisites

Before trying a test case, please ensure that the following prerequisites have been met.

Test case

This test case will show you how to launch the in.indent simulation provided with LAMMPS. It inserts a spherical indenter within a simulation box.

You can download the file here. Put the file in.indent in your input/ folder.

Launching the case

Once everything is set up, use the following script.

Be sure you have copied your authentication token in the script (instead of <<<MY_SECRET_TOKEN>>>) to be able to launch the task on Qarnot.

If you want to use GPU acceleration, you need to set the variable GPU to True.

#!/usr/bin/env python

# Import the Qarnot SDK
import qarnot

# Set to true to use GPU acceleration
GPU = False

# Connect to the Qarnot platform
conn = qarnot.connection.Connection(client_token='<<<MY_SECRET_TOKEN>>>')

# Create the task, lammps-gpu profile is used if you use GPU acceleration
if GPU:
    task = conn.create_task('lammps', 'lammps-gpu', 1)
    task.constants['DOCKER_TAG'] = '2Jun2022'
else:
    task = conn.create_task('lammps', 'lammps', 1)
    task.constants['DOCKER_TAG'] = '2Jun2022'    

# Create a resource bucket and add input files
input_bucket = conn.create_bucket('lammps-resource')
input_bucket.sync_directory('input', True)

# Attach the bucket to the task
task.resources.append(input_bucket)

# Create a result bucket and attach it to the task
output_bucket = conn.create_bucket('lammps-files-output')
task.results = output_bucket

# Take a snapshot every 10 seconds
task.snapshot(10)

# Submit the task to the API
task.run(output_dir= 'output')

To launch this script simply copy this code in a Python script and execute python3 run-lammps.py in your terminal.

The script will run the simulation on the Qarnot platform and output the result in the ‘output’ folder on your computer once it is completed.

Results

At any given time, you can monitor the status of your task on the console. For more information on its usage, please visit the keepng track of your computation page. The following figure shows a successful LAMMPS simulation on Qarnot’s Tasq.

You should also now have a file called ‘log.lammps’ in the output bucket and on your computer. If the commands dump were uncommented in your input file, you should also find pictures of the simulation.

These pictures can be put together to create an animated GIF or a short movie of the simulation with software like ImageMagick or ffmpeg.

Wrapping up

That’s it! If you have any questions, especially if you need support for other LAMMPS packages, please contact support@qarnot-computing.com and we will help you with pleasure!

Appendix: Packages

LAMMPS can be built with various packages that add functionalities. The version we provide includes most packages that can run without libs (packages built with yes-most option, see LAMMPS documentation). The following packages are included:

ASPHERE BOCS BODY BPM BROWNIAN CG-SDK CLASS2 COLLOID CORESHELL DIFFRACTION DIPOLE DPD-BASIC DPD-MESO DPD-REACT DPD-SMOOTH DRUDE EFF EXTRA-COMPUTE EXTRA-DUMP EXTRA-FIX EXTRA-MOLECULE EXTRA-PAIR FEP GRANULAR INTERLAYER KSPACE MANYBODY MC MEAM MISC ML-SNAP MOFFF MOLECULE OPENMP OPT ORIENT PERI PLUGIN QEQ REACTION REAXFF REPLICA RIGID SHOCK SPH SPIN SRD UEF YAFF DIELECTRIC ML-IAP PHONON

Return

Our articles