Thursday, December 13, 2018

Environment Modules on Ubuntu 18.04

Download : http://modules.sourceforge.net/
https://modules.readthedocs.io/en/stable/INSTALL.html

http://www.admin-magazine.com/HPC/Articles/Environment-Modules

http://manpages.ubuntu.com/manpages/bionic/man1/module.1.html


1. Install:


Tuesday, December 11, 2018

Ubuntu Stuff

I. Office 2016 on Ubuntu
           using PlayOnLinux

1. Install winbind
sudo apt-get install winbind

2. on PlayOnLinux
search Office

Notes: remember to copy source_folder to an accessible that can run by WINE

II. SSH connect:
using Remmina

III Taskbar - desktop - theme:
Tweak
Setting --> Dock

Thursday, July 26, 2018

WinSCP under Ubuntu 18.04

To run WinSCP under Linux (Ubuntu 18.04), follow these steps:
  1. Run sudo apt-get install wine (run this one time only, to get 'wine' in your system, if you haven't it)
  2. Download latest WinSCP portable package https://winscp.net/eng/download.php
  3. Make a folder and put the content of zip file in this folder
  4. Open a terminal, cd to folder contain WinSCP
  5. Type sudo su
  6. Type wine WinSCP.exe
Done! WinSCP will run like in Windows environment!

Monday, March 5, 2018

Install Nvidia CUDA-9.1 environment on Ubuntu WinBash

1. Install NVIDIA Graphics Driver

Determine the latest version of Nvidia driver available for your graphics card
Detecting NVIDIA card model
lspci -vnn | grep VGA
Visit the graphics drivers PPA homepage here and determine the latest versions of Nvidia drivers available
Remove Previous Installations (Important)
Search what packages from nvidia you have installed.
dpkg -l | grep -i nvidia
except the package nvidia-common all other packages should be purged.
sudo apt-get remove --purge nvidia-*
sudo apt-get autoremove
sudo reboot
Update gcc-6 g++6
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-6 g++-6
sudo ln -s /usr/bin/gcc-6 /usr/bin/gcc -f
sudo ln -s /usr/bin/g++-6 /usr/bin/g++ -f
checking
gcc -v
Add the graphics drivers PPA
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update

Install
sudo apt-get install nvidia-390 nvidia-390-dev
sudo reboot
lsmod | grep nvidia
or
nvidia-smi
If there is no output, then your installation has probably failed. It is also possible that the driver is not available in your system's driver database. You can run the following command to check if your system is running on the open source driver nouveau. If the output is negative for nouveau, then all is well with your installation.
lsmod | grep nouveau

Prevent automatic updates that might break the drivers
sudo apt-mark hold nvidia-390


2. Install CUDA

Preparation for installing of CUDA 9 + SDK
We install a number of build/dev packages which we require later:
sudo apt-get install g++ freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libglu1-mesa libglu1-mesa-dev
We notice that the default gcc/g++ version on 17.10 is 7.2.0 (Ubuntu 7.2.0-8ubuntu3) :
gcc -v
CUDA 9 requires gcc 6. Thus, we install it and set the corresponding sym-links:
sudo apt install gcc-6
sudo apt install g++-6
sudo ln -s /usr/bin/gcc-6 /usr/local/cuda/bin/gcc
sudo ln -s /usr/bin/g++-6 /usr/local/cuda/bin/g++
Note that the default gcc version is still 7.2; can be checked by running gcc -v again.
Installation of CUDA 9 + SDK
Download a version of CUDA 9, such as
wget https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/cuda_9.0.176_384.81_linux-run
Make the downloaded file executable and run it using sudo:
chmod +x cuda_9.1.85_387.26_linux.run 
sudo ./cuda_cuda_9.1.85_387.26_linux.run --override
We install CUDA with the following configurations:
You are attempting to install on an unsupported configuration. Do you wish to continue?
y
Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 384.81?
n
Install the CUDA 9.0 Toolkit?
y
Enter Toolkit Location
[default location]
Do you want to install a symbolic link at /usr/local/cuda?
y
Install the CUDA 9.0 Samples?
y
Enter CUDA Samples Location
[default location]
Test the CUDA 9 installation using the SDK
Build your favorite CUDA sample and run it:
cd ~/NVIDIA_CUDA-9.0_Samples/5_Simulations/smokeParticles
make
../../bin/x86_64/linux/release/smokeParticles 
After the installation finishes, configure runtime library.
sudo bash -c "echo /usr/local/cuda/lib64/ > /etc/ld.so.conf.d/cuda.conf"
sudo ldconfig
It is also recommended for Ubuntu users to append string /usr/local/cuda/bin to system file /etc/environments so that nvcc will be included in $PATH. This will take effect after reboot.

Install cuDNN

The recommended way for installing cuDNN is to first copy the tgz file to /usr/local and then extract it, and then remove the tgz file if necessary. This method will preserve symbolic links. At last, execute sudo ldconfig to update the shared library cache.

** References:
1) How can I install CUDA 9 on Ubuntu 17.10
2) Install NVIDIA Driver and CUDA on Ubuntu / CentOS / Fedora Linux OS
3) Install Nvidia CUDA-7.5 environment in CentOS 6
4) Things to know when installing NVIDIA drivers
5) Install the latest NVIDIA driver on Linux
6) GTX 1070 on Ubuntu 16.04 with Cuda 8.0 and Theano







































Install Intel Compiler with MPI_cuda on Ubuntu bash shell

Install OpenMPI with Intel compilerA. Prerequisites:
- Enable Ubuntu Bash Shell for Windows 10:
- When apt-get install is unable to locate a package, try
1. Make sure you have enabled Ubuntu repositories:
sudo add-apt-repository main
sudo add-apt-repository universe
sudo add-apt-repository restricted
sudo add-apt-repository multiverse
2. Don't forget to update (make apt aware of your changes):
sudo apt-get update
3. Finally install the package:
sudo apt-get install <package>
B. install Intel compiler:
Dependencies You will need to install GCC C and C++ compilers on all the machines.

sudo apt-get install gcc
sudo apt-get install gcc-c++
go to folder contain source code Intel (create folder c:/Ubuntu/local )
    cd /mnt/c/Ubuntu/local$

extract the tgz file by running:
tar -xvf opt-intel-11.1.059.tar
(this complier just need to unpack)







Downloand NAMD Source Code
Step 2: Extract the package of NAMD


$ tar -xvf NAMD_2.12_Source.tar.gz
$ cd NAMD_2.12_Source          # let call it is $NAMD_SRC
Step 3: Building TCL-8.5.9 and FFTW libraries
(cd to NAMD_2.12_Source if you're not already there)


wget http://www.ks.uiuc.edu/Research/namd/libraries/fftw-linux-x86_64.tar.gz 
tar xzf fftw-linux-x86_64.tar.gz 
mv linux-x86_64 fftw
wget http://www.ks.uiuc.edu/Research/namd/libraries/tcl8.5.9-linux-x86_64.tar.gz 
wget http://www.ks.uiuc.edu/Research/namd/libraries/tcl8.5.9-linux-x86_64-threaded.tar.gz 
tar -xvf tcl8.5.9-linux-x86_64.tar.gz 
tar -xvf tcl8.5.9-linux-x86_64-threaded.tar.gz 
mv tcl8.5.9-linux-x86_64 tcl 
mv tcl8.5.9-linux-x86_64-threaded tcl-threaded

Step 4: Building CHARM-6.7.1
$ cd NAMD_2.12_Source          
$ tar -xvf charm-6.7.1.tar
$ cd charm-6.7.1
./build charm++ {arch} {C compiler} {Fortran compiler} {other options} 
$ MPICXX=mpiicpc CXX=icpc ./build charm++  mpi-linux-x86_64 mpicxx ifort --with-production --no-shared -O3 -DCMK_OPTIMIZE=1
$ cd $NAMD_SRC

Step 5: Compile NAMD.
Make sure you're in the main NAMD directory, then configure and run make:
$ ./config Linux-x86_64-icc --charm-arch mpi-linux-x86_64-ifort-mpicxx
$ cd Linux-x86_64-icc
$ make -j16
You should see the namd2 executable
Step 10: mpirun
$ mpirun -np 32 -machinefile $MACHINEFILE namd2  something.conf > job$LSB_JOBID.log
References:
3)

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