Install Docker
once properly installed, and the service has properly started, you can open a terminal and start using docker via command line. There are some helpful tutorials if you need to learn more, however, we will only need very basic commands for running the playground container.
Windows
Installing Docker on Windows is a bit more involved compared to Ubuntu or macOS.
If you are using windows, you might want to watch a tutorial on how to use a terminal with docker.
- Running Docker on Windows mandates turning on the virtualization in the BIOS of your own machine. You can read how to do that here.
- The awesome and free Windows Subsytem for Linux (WSL2) is mandatory in Windows Home edition and highly encouraged in Windows Pro edition. You can get away without WSL2 in Pro, but this is not recommended. Docker installs almost everything for you, but you need to download the kernel from Microsoft here.
- Once installed and started go to command prompt, and run docker.
- Make sure to allow Docker firewall access within your computer to be able to reach the LAMMPS Playground.
Download and start the LAMMPS Playground Docker image
docker run -p 6080:80 -v /dev/shm:/dev/shm obminator/lammps_playground
Once the download is complete, you can go to http://127.0.0.1:6080/ to access the running image.
(allow firewalls for unhindered communications within your machine, if you are asked to do so (this is usually the default))
Start using the playground.
opening the http://127.0.0.1:6080/ link in a supported browser takes you to the ubuntu desktop
Most of your tasks will be using the LXTerminal. You can either double click the desktop shortcut, or go to the applications menu on the lower left, and find the terminal application there.
I also added jmol, ovito, and gnuplot for your convenience. These are used for visualizing the LAMMPS results.
The LAMMPS source code and the examples are under lammps-stable and lammps-stable/examples directories respectively.
Details
Some useful Docker commands:
docker images
:Lists the container that are ready to run. If you have disk space issues, you can remove some images. You should see obminator/lammps_playground
if you did the previous step. If not, do a docker pull obminator/lammps_playground
docker pull DOCKER_IMAGE
: Download the DOCKER_IMAGE to your own computer. The image will appear in your available images section.
docker ps -l
: Lists running/recently run docker containers. You can control the container using CONTAINER ID
docker stop CONTAINER_ID
: Stops a container (handy if it goes unresponsive)
docker rm CONTAINER ID
: Removes the CONTAINER ID from the list
docker run -p 6080:80 obminator/lammps_playground
: This command does the following:
- Searches for obminator/lammps_playground in local images. If there is no local copy, it downloads the image from the docker hub (Warning image is >5 Gb!).
- runs the image, and maps the port 80 of the image to 6080 of the local machine (your VNC connection will be through this port)
docker image rm DOCKER_IMAGE
: Removes the local image from your disk, freeing up the disk space. If you want to run the container again, you'll need to download it once more from scratch
LAMMPS
LAMMPS is compiled and installed in ~/bin. This should already be in your path when you login.
Compilation details
I downloaded the LAMMPS from git stable branch.
then I compiled using the cmake method
cmake ../cmake -D PKG_BODY=yes -D PKG_CLASS2=yes -D PKG_DIPOLE=yes -D PKG_MANYBODY=yes -D PKG_MC=yes -D PKG_LATTE=yes -D PKG_MLIAP=yes -D PKG_SNAP=yes -D PKG_SPIN=yes -D PKG_PYTHON=yes -D PKG_USER-MOLFILE=yes -D PKG_USER-PHONON=yes -D PKG_USER-REAXC=yes -D PKG_KSPACE=yes -D PKG_USER-MEAMC=yes -D PKG_USER-PLUMED=yes -D PKG_USER-SMTBQ=yes -D PKG_USER-DIFFRACTION=yes
The docker image is set to contain some important LAMMPS prerequisites, CMAKE result is
-- Found Python: /usr/bin/python3.8 (found version "3.8.5") found components: Interpreter
-- The following tools and libraries have been found and configured:
* Git
* MPI
* OpenMP
* LAPACK
* Threads
* BLAS
* GSL
* Python
-- <<< Build configuration >>>
Operating System: Linux
Build type: RelWithDebInfo
Install path: /root/.local
Generator: Unix Makefiles using /usr/bin/make
-- Enabled packages: BODY;CLASS2;DIPOLE;KSPACE;LATTE;MANYBODY;MC;MLIAP;PYTHON;SNAP;SPIN;USER-DIFFRACTION;USER-MEAMC;USER-MOLFILE;USER-PHONON;USER-PLUMED;USER-REAXC;USER-SMTBQ
-- <<< Compilers and Flags: >>>
-- C++ Compiler: /usr/bin/c++
Type: GNU
Version: 9.3.0
C++ Flags: -O2 -g -DNDEBUG
Defines: LAMMPS_SMALLBIG;LAMMPS_MEMALIGN=64;LAMMPS_OMP_COMPAT=4;LAMMPS_GZIP;LAMMPS_FFMPEG;FFT_KISS;LMP_PYTHON
-- Fortran Compiler: /usr/bin/gfortran
Type: GNU
Version: 9.3.0
Fortran Flags: -O2 -g -DNDEBUG
-- C compiler: /usr/bin/cc
Type: GNU
Version: 9.3.0
C Flags: -O2 -g -DNDEBUG
-- <<< Linker flags: >>>
-- Executable name: lmp
-- Static library flags:
-- <<< MPI flags >>>
-- MPI_defines:
-- MPI includes: /usr/lib/x86_64-linux-gnu/openmpi/include/openmpi;/usr/lib/x86_64-linux-gnu/openmpi/include
-- MPI libraries: /usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi_cxx.so;/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so;
-- <<< FFT settings >>>
-- Primary FFT lib: KISS
-- Using double precision FFTs
-- Using non-threaded FFTs
-- Configuring done
-- Generating done
-- Build files have been written to: /root/lammps-stable/build2
Docker image
Docker image is a clone modification of dorowu/ubuntu-desktop-lxde-vn