Tuesday, January 23, 2018

Ubuntu bash shell Win10


https://docs.microsoft.com/en-us/windows/wsl/install-win10

Open Settings -> Update and Security -> For developers
open cmd as administrator, run: lxrun/install
                                                   lxrun/setdefaultuser root

reinstall kernel by: sudo apt-get install linux-image-4.4.0-64-generic --reinstall

root folder  (run ubuntu as administrator)
/mnt/c/Users/THANG/AppData/Local/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/

hard driver folders: /mnt/c       or     /mnt/d



Step 1.  Download Anaconda installer for Linux.

                    Anaconda2-5.0.1-Linux-x86_64.sh

Put this file in folder: /home/thang/local/src
cd /uhome/p001cao/local/src
Step 2:  Run command

bash Anaconda2-5.0.1-Linux-x86_64.sh
choose folder to install: /home/thang/local/anaconda2
.
..
...


Step 4. Install cudatoolkit

conda install -c anaconda cudatoolkit

Sunday, January 14, 2018

Compiling Lammps/11Aug17 with Intel 11.0, OpenMPI 1.6.2 and FFTW 3.3.2 (CAN user)

Step 1:
Step 2:  Load modules
 module load   intel/intel-11.1
 module load   intel/mkl-10.2.2
 module load   mpi/intel/openmpi-1.6.2
 module load   fftw/3.3.2/intel-11.1/parallel/openmpi-1.6.2/double
 module load   fftw/3.3.2/intel-11.1/parallel/openmpi-1.6.2/single
check 
 module list
Step 3: Compiling LAMMPS
tar -xvf lammps-stable.tar.gz

Prepare libraries for lammps....
...........
..........
Step 4: Compile required the packages. Go to src directory
......
.......make no-python
Step 5: Edit makefile
Copy file src/MAKE/Makefile.mpi
to  src/MAKE/MINE/Makefile.CANf3mpi   and then edit file Makefile.CANf3mpi

5a # compiler/linker settings:


CCFLAGS = -O3 -fno-alias -restrict -ip -unroll0 -shared-intel
LINKFLAGS = -O -L/opt/intel/composer_xe_2013_sp1.3.174/mkl/lib/intel64
LIB = -lstdc++ -lpthread -lmkl_sequential -lmkl_intel_lp64 -lmkl_core 

5b MPI Library
MPI_INC =   -I/opt/mpi/intel/openmpi-1.6.2/include -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1
MPI_PATH =    
MPI_LIB =  -L/opt/mpi/intel/openmpi-1.6.2/lib
 5c FFT library
FFT_INC =   -I/opt/fftw/3.3.2/intel-11.1/openmpi-1.6.2/double/include/fftw3
FFT_PATH = 
FFT_LIB =   /opt/fftw/3.3.2/intel-11.1/openmpi-1.6.2/double/lib/libfftw3.a

Step 6: Compile LAMMPS
Check make options. Go to src
# make
# make f3mpi
Step 7: Create a home/thang/local/lammps/11Aug17fep and copy libraries. Go to lammps' Source directory
 cp -Rv  bench   /home/thang/local/lammps/11Aug17fep/bench 
 cp -Rv  doc      /home/thang/local/lammps/11Aug17fep/doc
 cp -Rv  examples    /home/thang/local/lammps/11Aug17fep/examples
 cp -Rv  potentials   /home/thang/local/lammps/11Aug17fep/potentials
 cp README   /home/thang/local/lammps/11Aug17fep
 cp -Rv tools   /home/thang/local/lammps/11Aug17fep/tools
 cp -Rv lib     /home/thang/local/lammps/11Aug17fep/lib

 cd src
 cp lmp_CANf3mpi /home/thang/local/lammps/11Aug17fep/bin

cd /home/thang/local/lammps/11Aug17fep/bin
cp -p  lmp_CANf3mpi  lmp_mpi 


Step 8. Create a Modulefile
create modulefile:  lammps/11Aug17fep

Saturday, January 6, 2018

Compiling Lammps/11Aug17 with Intel 14.0, OpenMPI 1.8.1 and FFTW 3.3.4 (USC user)




I.  Assum that Intel compiler and correspoding OpenMPI & FFTW werer be installed
 module avail
 module display "module_name"
II:  Load modules
 module load   intel/intel-14.0
 module load   intel/mkl-14.0
 module load   mpi/intel-14.0/openmpi-1.8.1
 module load   fftw/3.3.4/openmpi-1.8.1/intel-14.0/double/fftw-3.3.4
check 
 module list

III: Compiling LAMMPS
tar -xzvf lammps*.tar.gz
Step 1: chose the packages. Go to src directory
cd src
1a. Check which packages are included
make package-status
1b. Choose all the standard
make yes-standard

make yes-user-fep
make yes-user-misc
make yes-user-phonon
make yes-user-meamc
make yes-user-reaxc
1c. Exclude packages that are not required
 make no-voronoi
 make no-kim
 make no-gpu
 make no-kokkos
 make no-mscg
Step2; Prepare libraries for the chosed packages
2a. lib/reax
make -f Makefile.ifort
2b. lib/meam
There are 2 ways to do:
way 1: manually
$ cd lib/meam
$ vi Makefile.lammps.ifort
      - - - as below - - - (in Vi press "i" to insert mode --> Esc --> :wq)

$ make -f Makefile.ifort
[Makefile.lammps.ifort modify
meam_SYSINC =
meam_SYSLIB =
meam_SYSPATH =
way 2: perform in lammps/src

cd lammps/src
make lib-meam # print help message make lib-meam args="-m mpi" # build with default Fortran compiler compatible with your MPI library make lib-meam args="-m serial" # build with compiler compatible with "make serial" (GNU Fortran) make lib-meam args="-m ifort" # build with Intel Fortran compiler using Makefile.ifort
2c. lib/poems
cd lib/poems
make -f Makefile.icc
2d. lib/atc
$ cd lib/atc
$ vi Makefile.lammps.installed
        - - - as below- - -

$ make -f Makefile.mpic++
[Makefile.lammps.installed modify]

user-atc_SYSINC =
user-atc_SYSLIB =
user-atc_SYSPATH =
2e. lib/awpmd

$ cd lib/awpmd
$ vi Makefile.lammps.installed
     - - - as below - - -

$ make -f Makefile.mpicc
[Makefile.lammps.installed 수정]

user-awpmd_SYSINC =
user-awpmd_SYSLIB =
user-awpmd_SYSPATH =
2f. lib/linalg

$ cd lib/linalg
$ cp -p Makefile.gfortran Makefile.ifort
$ vi Makefile.ifort
- - - 수정 사항은 아래 참조 - - -
$ make -f Makefile.ifort
[Makefile.ifort 수정]

FC = ifort
FFLAGS = -O3 -fPIC
FFLAGS0 = -O0 -fPIC

Step 3: Edit makefile
Copy file src/MAKE/Makefile.mpi
to  src/MAKE/MINE/Makefile.f3mpi   and then edit file Makefile.f3mpi

3a # compiler/linker settings:


CCFLAGS = -O3 -fno-alias -restrict -ip -unroll0 -shared-intel
LINKFLAGS = -O -L/opt/intel/composer_xe_2013_sp1.3.174/mkl/lib/intel64
LIB = -lstdc++ -lpthread -lmkl_sequential -lmkl_intel_lp64 -lmkl_core 

3b MPI Library
MPI_INC =   -I/opt/mpi/intel-14.0/openmpi-1.8.1/include -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1
MPI_PATH =    
MPI_LIB = -L/opt/mpi/intel-14.0/openmpi-1.8.1/lib
3c FFT library
FFT_INC =   -I/opt/fftw/3.3.4/openmpi-1.8.1/intel-14.0/double/include/fftw3 
FFT_PATH = 
FFT_LIB = /opt/fftw/3.3.4/openmpi-1.8.1/intel-14.0/double/lib/libfftw3.a

Step 4: Compile LAMMPS
Check make options. Go to src  (delete previous make --> make clean-all)
# make
# make f3mpi -j8
Step 5: Create a /usr/local/lammps/11Aug17ti/bin and copy libraries. Go to lammps root directory
# cp -Rv  bench   /uhome/p001cao/local/lammps/11Aug17ti/bench 
# cp -Rv  doc      /uhome/p001cao/local/lammps/11Aug17ti/doc
# cp -Rv  examples    /uhome/p001cao/local/lammps/11Aug17ti/examples
# cp -Rv  potentials   /uhome/p001cao/local/lammps/11Aug17ti/potentials
# cp -Rv tools   /uhome/p001cao/local/lammps/11Aug17ti/tools
# cp -Rv lib     /uhome/p001cao/local/lammps/11Aug17ti/lib
    cd src
# cp -p lmp_f3mpi  /uhome/p001cao/local/lammps/11Aug17ti/bin


cd /uhome/p001cao/local/lammps/11Aug17ti/bin
cp -p  lmp_f3mpi  lmp_mpi 
* Test: at /bin
mpirun -np 2 lmp_mpi
LAMMPS (11 Aug 2017)


Step 6. Create a Modulefile
create modulefile:  lammps/11Aug17ti
and put it into folder:  /uhome/p001cao/local/share/lmodfiles
# for Tcl script use only
set     topdir          /uhome/p001cao/local/lammps
set     version         11.Aug.2017fep

module load   mpi/intel-14.0/openmpi-1.8.1
module load   fftw/3.3.4/openmpi-1.8.1/intel-14.0/double/fftw-3.3.4

setenv          LAMMPS                  $topdir/11Aug17ti
prepend-path    PATH                    $topdir/11Aug17ti/bin
prepend-path    LD_LIBRARY_PATH         $topdir/11Aug17ti/lib
load module

. /etc/profile
module use /uhome/p001cao/local/share/lmodfiles
module load lammps/11Aug17ti
mpirun -np $NSLOTS -machinefile $TMPDIR/machines lmp_mpi ...
Step 7. (Optional) make module usable:
# attach the following command to .bashrc file
module use /uhome/p001cao/local/share/lmodfiles
cd ~
ls -la                                      # to see invisible files
vi .bashrc

References:

Notes:
If copy lmp_linux file using WinSCP, then have to use this command to set it as executable file (assume staying .../bin
#   chmod  +x  lmp_linux