Ellipsoidal particles in spherical solvent (LAMMPS)

From HPC Wiki
Jump to:navigation Jump to:search

Ellipsoidal particles in spherical solvent, 2d system. The example used here is identical to the version released with LAMMPS, with the following exceptions:

  • Time-step is halved.
  • Run times increased to 1,000,000.
  • Creates a movie.

Initial Setup

We need to complete the initial setup tutorial first, to be sure that the GNU Compiler Collection, and Open MPI will be used for our simulations.

Important
The initial setup must be completed before continuing.

Prepare Example Directory

First, make sure we are at the root of our home directory

user $cd

Now, make an example directory, and copy the ellipse example directory into it.

user $mkdir examples
user $cp -r /home/bgo/shared/examples/lammps/ellipse examples/
user $cd examples/ellipse
user $ls
ellipse.gayberne.lmp

We also need a script to submit the job to the cluster. Lets start with the sample script in /home/bgo/shared/samples by copying it to our new ellipse example directory.

user $cp /home/bgo/shared/samples/torque-lmp.sh .
user $ls
ellipse.gayberne.lmp  torque-lmp.sh

The torque-lmp.sh script should look something like this:

FILE torque-lmp.sh(original)
#PBS -l walltime=10:00:00,mem=15gb,nodes=1:ppn=16
##PBS -M EmailAddress
##PBS -m bae
#PBS -q default
#PBS -N Jobname
#PBS -o myoutput.txt
#PBS -j oe

. $(which lmp-config)

# The LAMMPS input file must have a '.lmp' extension (e.g., mysimulation.lmp).
INPUTFILE=mysimulation

doLAMMPS

Modify Queue Submission Script

The submission script we just copied has default settings that have to be modified for this simulation. Lucky, most of the defaults work for the ellipse simulation (1 node, 16 processes per node, etc.) and all we have to change is the name of the job and the lammps input file. Changing the job name to ellipse-lmp and the input file to ellipse.gayberne results in a submission script that looks like this:

FILE torque-lmp.sh(edited)
#PBS -l walltime=10:00:00,mem=15gb,nodes=1:ppn=16
##PBS -M EmailAddress
##PBS -m bae
#PBS -q default
#PBS -N ellipse-lmp
#PBS -o myoutput.txt
#PBS -j oe

. $(which lmp-config)

# The LAMMPS input file must have a '.lmp' extension (e.g., mysimulation.lmp).
INPUTFILE=ellipse.gayberne

doLAMMPS

Submit Job

The job is now ready to be sent to the cluster.

user $qsub torque-lmp.sh
user $qstat
Job ID                    Name             User            Time Use S Queue
------------------------- ---------------- --------------- -------- - -----
14222.flory               ellipse-lmp      user            00:00:35 R default  

The job should take about 4 minutes. Check the job status with qstat to see when it is finished; when the job is no longer listed it has finished.

Check Results

When the job completes you should find the following files:

user $ls -lh
total 22M
-rw-r--r-- 1 user user 1.8K Dec 20 17:25 ellipse.gayberne.lmp
-rw-rw-r-- 1 user user 1.5M Dec 20 17:29 ellipse.gayberne.out
-rw-rw-r-- 1 user user  398 Dec 20 17:26 log.cite
-rw-rw-r-- 1 user user  20M Dec 20 17:29 movie.mkv
-rw------- 1 user user  730 Dec 20 17:29 myoutput.txt
-rwxr-xr-x 1 user user  293 Dec 20 16:14 torque-lmp.sh

General information about the job can be found in myoutout.txt, if any errors occurred they should be listed in this file. A successful run will look like this:

user $cat myoutput.txt
-------------- lmp-config (BEGIN) --------------

Start time       : Tue Dec 20 17:25:51 EST 2016

PBS_JOBID        : 14222.flory.usm.edu
Working Directory: /home/user/examples/ellipse
MPI command      : /home/user/shared/gnu-openmpi/bin/mpirun
LAMMPS command   : /home/user/shared/gnu-openmpi/bin/lmp
LAMMPS script    : /home/user/examples/ellipse/ellipse.gayberne.lmp
Processes        : 16
Controlling Node : n005.cluster.com
Nodes            : n005.cluster.com (16)

Command: mpirun  lmp -in "ellipse.gayberne.lmp" -log "ellipse.gayberne.out" -screen "none"

Stop  time       : Tue Dec 20 17:29:39 EST 2016

Elapsed time     : 0 days 00h 03m 48s

-------------- lmp-config ( END ) --------------

The results from the LAMMPS simulation can be found in ellipse.gayberne.out, and movie.mkv is the movie.

To watch the movie, copy it to your computer. It should be about 1 minute 23 seconds long. During the first half of movie the box is shrinking (NPT ensemble), but the movie is also zooming in, making it look like the particles are getting larger.