Showing posts with label lammps. Show all posts
Showing posts with label lammps. Show all posts

Friday, October 14, 2016

LAMMPS Tools and Packmol with Intel Fortran

PACKMOL information can be obtained from http://www.ime.unicamp.br/~martinez/packmol/userguide.shtml#conv

Installing can be found at http://www.ime.unicamp.br/~martinez/packmol/userguide.shtml#comp

 1. Compile Packmol with Intel Fortran
# tar -zxvf packmol.tar.gz
# cd packmol
# ./configure ifort
# make

2. LAMMPS Tools
# git clone https://github.com/jdevemy/lammps-tools.git
# cd lammps-tools
# python setup.py build
# sudo python setup.py install

3. Make sure the Python has the following libraries in create_conf (sys, os, logging, argparse, math random) 4. Make sure the Python (if you install lammps-tool)
# export PYTHONPATH=/home/user1/Downloads/lammps-tools-master/lib
# ./create_conf

Tuesday, June 14, 2016

Compiling LAMMPS-14May16 with Intel-15.0.6 and Intel-MPI-5.0.3

Step 1: Remember to initialise Intel Environment. In your .bashrc
source /usr/local/intel/bin/compilervars.sh intel64
Step 2: Untar LAMMPS
# tar -zxvf lammps-stable.tar.gz
Step 3: Prepare libraries for lammps 3a. lib/reax
# make -f Makefile.gfortran
3b. lib/meam
# make -f Makefile.ifort
3c. lib/poems
# make -f Makefile.icc
Step 4: Compile required the packages. Go to src directory
# cd src
4a. Check which packages are included
# make package-status
Installed YES: package ASPHERE
Installed YES: package BODY
Installed YES: package CLASS2
Installed YES: package COLLOID
Installed YES: package COMPRESS
Installed YES: package CORESHELL
Installed YES: package DIPOLE
Installed YES: package FLD
Installed  NO: package GPU
Installed YES: package GRANULAR
Installed  NO: package KIM
Installed YES: package KOKKOS
  src/pair_lj_sdk_kokkos.cpp does not exist
  src/pair_lj_sdk_kokkos.h does not exist
Installed YES: package KSPACE
Installed YES: package MANYBODY
Installed YES: package MC
Installed YES: package MEAM
Installed YES: package MISC
Installed YES: package MOLECULE
Installed YES: package MPIIO
Installed YES: package OPT
Installed YES: package PERI
Installed YES: package POEMS
Installed YES: package PYTHON
Installed YES: package QEQ
Installed YES: package REAX
Installed YES: package REPLICA
Installed YES: package RIGID
Installed YES: package SHOCK
Installed YES: package SNAP
Installed YES: package SRD
Installed  NO: package VORONOI
Installed YES: package XTC
.........
4b. Choose all the standard
# make yes-standard
4c. Exclude packages that are not required
# make no-voronoi
# make no-kim
# make no-gpu
# make no-kokkos
Step 5: Install User-Contributed Intel Optimised Package (user-intel) and User-Contributed OpenMP Packages (user-omp)
# make yes-user-intel
# make yes-user-omp
Step 6: Compile LAMMPS Check make options. Go to src
# make intel_cpu_intelmpi -j 16
Step 6a: If in the midst of compilation you land yourself in this error ld: unable to to locate -lompstub. This is due to Intel 2015 using depreciating ompstub to ompistub5. Just go to the Intel Directory
# cd /usr/local/intel_2015/composerxe/lib/intel64
# ln -s  libiompstubs5.so libompstub.so
Step 7: Create a /usr/local/lammps-7Dec15 and copy libraries. Go to lammps root directory
# cp -Rv bench /usr/local/lammps-14May16
# cp -Rv doc /usr/local/lammps-14May16
# cp -Rv examples /usr/local/lammps-14May16
# cp -Rv potentials /usr/local/lammps-14May16
# cp README /usr/local/lammps-14May16
# cp -Rv tools /usr/local/lammps-14May16
# cp -Rv lib /usr/local/lammps-14May16
# cp lmp_intel_cpu_intelmpi /usr/local/lammps-14May16/bin
7a. Create a softlinks
# ln -s /usr/local/lammps-7Dec15/bin/lmp_intel_cpu_intelmpi lammps
References:
  1. Quick install guide for LAMMPS on Linux cluster
  2. LAMMPS Optimized for Intel on Quad Socket Xeon

Friday, November 5, 2010

Installing lammps using Intel Compilers, OpenMPI and FFTW (Update)

This is an update of  Blog Entry Installing lammps using Intel Compilers, OpenMPI and FFTW

The steps are still relevant and workable, but if you are doing a lot of customisation pathing or you just simply wish to tweak the parameters in the configuration file, here is my sample script. I got my information from the Message threads of LAMMPS http://lammps.sandia.gov/threads/msg12768.html

Here are my settings, amending the $SOURCE/lammps-30Mar10/src/MAKE/Makefile.Linux

# linux = RedHat Linux box, Intel icc, MPICH2, FFTW

SHELL = /bin/sh
# ---------------------------------------------------------------------
# compiler/linker settings
# specify flags and libraries needed for your compiler

CC = mpicc
CCFLAGS = -g -O -I/usr/local/fftw/include -DFFT_FFTW
DEPFLAGS = -M
LINK = mpicc
LINKFLAGS = -O
USRLIB = -lfftw -lmpi
LIB = -lstdc++ -lpthread
ARCHIVE = ar
ARFLAGS = -rc
SIZE = size

# ---------------------------------------------------------------------

# LAMMPS-specific settings
# specify settings for LAMMPS features you will use
# LAMMPS ifdef options, see doc/Section_start.html

LMP_INC = -DLAMMPS_GZIP
# MPI library, can be src/STUBS dummy lib
# INC = path for mpi.h, MPI compiler settings
# PATH = path for MPI library
# LIB = name of MPI library:wq

MPI_INC = -DMPICH_IGNORE_CXX_SEEK
MPI_PATH = -L/usr/mpi/intel/lib # where I store my openmpi binary and lib
MPI_LIB = -lmpi -lpthread

# FFT library, can be -DFFT_NONE if not using PPPM from KSPACE package
# INC = -DFFT_FFTW, -DFFT_INTEL, -DFFT_NONE, etc, FFT compiler settings
# PATH = path for FFT library
# LIB = name of FFT library

FFT_INC = -DFFT_FFTW
FFT_PATH = -L/usr/local/fftw/lib # I've put my fftw at /usr/local/fftw
FFT_LIB = -lfftw

.............

You can add further flags at CCFLAGS. See my other blog entry
  1. Understanding -DOMPI_SKIP_MPICXX Flag for compiler/linker settings
  2. Understanding -DOMPI_IGNORE_CXX_SEEK Flag for compiler/linker settings

Thursday, April 29, 2010

Installing lammps using Intel Compilers, OpenMPI and FFTW

This is a entry on how I install LAMMPS using Intel, OpenMPI and FFTW
  1. If you are eligible for the Intel Compiler Free Download. Download the Free Non-Commercial Intel Compiler Download
  2. Build OpenMPI with Intel Compiler
  3. Install FFTW. Remember to install FFTW-2.1.x and not FFTW-3.x or you will face an issue fft3d.h(164): catastrophic error: could not open source file "fftw.h" . Read the LAMMPS "Getting Started" Section for more information
  4. When you are ready and about to compile, there are several "Make" selection found at "$SOURCE/lammps-30Mar10/src/MAKE". I chose the makefile.openmpi. Be default you do not need to edit the Makefile.openmpi. But if you are a guru and want to edit the file, feel free to
  5. Finally go to the preceding directory by typing
    cd .. (ie $SOURCE/lammps-30Mar10/src)
    make openmpi -j (-j for parallel compilation)
  6. At the end of the compilation, you should see a lmp_openmpi binary at the src directory. You are almost done
  7. Check that the executable are properly linked by doing a
    # ldd lmp_openmpi
  8. Remember to include /usr/local/lib in the LD_LIBRARY_PATH if libmpi_cxx.so.0 is located at /usr/local/lib

fft3d.h(164): catastrophic error: could not open source file "fftw.h"

I was compiling LAMMPS Molecular Dynamics Simulator.
  1. Using $SOURCE/lammps-30Mar10/src
  2. I compiled using make.linux. Quite soon, I encounter the following error fft3d.h(164): catastrophic error: could not open source file "fftw.h"
  3. I have compiled my fftw3 and my Intel Math Kernel library properly and was able to locate the header in my Intel Math Kernel Library. I've correctly "source" the path at LD_LIBRARY_PATH and /etc/ld.so.conf.d. But the LAMMPS is still not able to locate the library.
  4. I realise the cruz of the problem was that LAMPS requires FFTW-2.1.x. configuring and compiling fftw-2.x, the problem went away
Problem eliminated. My compilation is not done yet. But this fftw initial problem is settle for now :)