網頁

2018年12月31日 星期一

GROMACS拓撲文件的工具

本文把各種可以產生GROMACS拓撲文件的工具進行匯總。值得一提的是,這些程序有很多不能產生原子電荷,或者產生的原子電荷質量較差。 RESP電荷是最適合分子動力學模擬使用的電荷之一,AMBER、GAFF等力場直接將之作為御用的原子電荷。 Multiwfn是計算RESP電荷最簡單、最好、最靈活而且完全免費的工具,見《RESP擬合靜電勢電荷的原理以及在Multiwfn中的計算》(http://sobereva.com/441)。另外,在J. Phys. Chem. B, 121, 3864 (2017)中,OPLS-AA力場被證明很適合結合1.2*CM5電荷使用,用Multiwfn的主功能7的子功能16直接就能計算出CM5電荷,將之手動乘以1.2即是1.2*CM5電荷。

Lammps的moltemplate以及OPLSAA

lammpsmoltemplate裡面oplsaa.lt介紹如何用oplsaa.prm去寫force-field,指令如下

tinkerparm2lt.py -name OPLSAA -file oplsaa.prm -dihedral-style opls -zeropad 3
oplsaa.prm的資訊在以下連結
https://dasher.wustl.edu/tinker/distribution/params/oplsaa.prm

moltemplate的官網以及使用說明
http://www.moltemplate.org/#opennewwindow
https://www.moltemplate.org/doc/moltemplate_manual.pdf

moltemplate影片
http://videominecraft.ru/watch/Z-biSvaYN24/moltemplate-linux.html

2018年12月29日 星期六

Google AI Princeton: Current and Future Research

Google has long partnered with academia to advance research, collaborating with universities all over the world on joint research projects which result in novel developments in Computer Science, Engineering, and related fields. Today we announce the latest of these academic partnerships in the form of a new lab, across the street from Princeton University’s historic Nassau Hall, opening early next year. By fostering closer collaborations with faculty and students at Princeton, the lab aims to broaden research in multiple facets of machine learning, focusing its initial research efforts on optimization methods for large-scale machine learningcontrol theory and reinforcement learning. Below we give a brief overview of the research progress thus far.

TPPMKTOP:OPLS-AA全原子力場的GROMACS拓撲文件生成器

生成OPLS-AA力場的拓撲文件非常複雜, 因為此力場包含的原子類型非常多, 超過800種. 但即便使用如此多的原子類型, OPLS-AA力場仍不可能描述所有分子的化學結構. 因此, 當文獻中給出了新化學片段的參數後, OPLS-AA力場的原子類型也會隨之增加. TPPMKTOP是一個自動化的工具, 可用於生成OPLS-AA力場的拓撲文件. 它提供了免費的網絡服務, 網址為http://erg.biophys.msu.ru/tpp. TPPMKTOP使用了MySQL數據庫, 其中包含了有關原子類型指認的力場參數和信息. 這個數據庫一直持續升級. TPPMKTOP是一個開源項目, 可以聯繫comconadin@gmail.com以便獲得最新版本.

Lammps設定牆

https://lammps.sandia.gov/doc/Howto_walls.html

2018年12月27日 星期四

python執行終端機

以下的範例是利用python寫一個script檔,讓Lammps可以跑完平衡後接著做分析。

2018年12月22日 星期六

ubuntu 18.04 install cuda

安裝前,如果廠商是先灌Windows的話,記得要先到BIOS的secure boot把OS改為other os (主機板是ASUS ROG STRIX Z390-H GAMING)。

強烈建議使用runfile (local)安裝,會比deb (local)方便非常多。

Ubuntu 網路設定 - PPPoE (ADSL) 指令


2018年12月19日 星期三

VMD設定

$ pbc set {100 100 100}
$ pbc box_draw -shiftcenterrel {0 0 0}

$ pbc box -on
$ pbc unwrap

參考
https://www.ks.uiuc.edu/Research/vmd/plugins/pbctools/

VMD User's Guidehttps://www.ks.uiuc.edu/Research/vmd/current/ug/

python
$ import os
$ os.system('vmd conf.gro')
參考
https://www.ks.uiuc.edu/Research/vmd/current/ug/node246.html

Working with a Single Moleculehttps://www.ks.uiuc.edu/Training/Tutorials/vmd/tutorial-html/node2.html#sec:LoadMol

Molecular Modeling
http://videominecraft.ru/watch/kIenedhCUQ8/solvating-a-protein-using-vmd.html

Rendering Images in VMD Using Tachyon, POV-Ray, Snapshot in Windows

Creating representations and trajectory smoothing

Loading a Trajectory

making tutorial

2018年12月11日 星期二

ubuntu 遠端加密複製檔案與目錄

從本地端複製到遠端
檔案
$ scp ~/Downloads/DMFmem/1_NPT/DMFmem.data  chiustin@140.112.182.158:/home/chiustin/桌面/lammps
目錄
$ scp -r ~/Downloads/DMFmem  chiustin@140.112.182.158:/home/chiustin/桌面/lammps

從遠端複製到本地端
檔案
$ scp chiustin@140.112.182.158:/home/chiustin/桌面/lammps ~/Downloads/DMFmem/1_NPT/DMFmem.data
目錄
$ scp -r chiustin@140.112.182.158:/home/chiustin/桌面/lammps ~/Downloads/DMFmem  

參考資料

2018年11月11日 星期日

PDB FILE WRITER

Fortran:
! module, output a single frame (pdb "model") of the trajectory. This has
! nothing to do with OpenMM.
SUBROUTINE myWritePDBFrame(frameNum, timeInPs, energyInKcal)
use MyAtomInfo; implicit none
integer frameNum; real*8 timeInPs, energyInKcal
integer n
print "('MODEL',5X,I0)", frameNum
print "('REMARK 250 time=', F0.3, ' picoseconds; Energy=', F0.3, ' kcal/mole')", &
timeInPs, energyInKcal
do n = 1,NumAtoms
print "('ATOM ', I5, ' ', A4, ' SLT 1 ', 3F8.3, ' 1.00 0.00')", &
n, atoms(n)%pdb, atoms(n)%posInAng
end do
print "('ENDMDL')"
END SUBROUTINE

C++:
static void
myWritePDBFrame(int frameNum, double timeInPs, double energyInKcal,
const MyAtomInfo atoms[])
{
// Write out in PDB format -- printf is so much more compact than formatted cout.
printf("MODEL %d\n", frameNum);
printf("REMARK 250 time=%.3f ps; energy=%.3f kcal/mole\n",
timeInPs, energyInKcal);
for (int n=0; *atoms[n].pdb; ++n)
printf("ATOM %5d %4s SLT 1 %8.3f%8.3f%8.3f 1.00 0.00\n",
n+1, atoms[n].pdb,
atoms[n].posInAng[0], atoms[n].posInAng[1], atoms[n].posInAng[2]);
printf("ENDMDL\n");
}




參考
https://github.com/pandegroup/openmm/blob/master/examples/HelloSodiumChlorideInFortran.f90
https://github.com/pandegroup/openmm/blob/master/examples/HelloSodiumChloride.cpp

Lennard-Jones Fluid Properties

參考

The purpose of these pages is to provide some explicit results from molecular dynamics and Monte Carlo simulations for the Lennard-Jones fluid. It is intended to provide guides for testing codes. Reproducing these results is a test of the correctness of codes, either written by the user or obtained elsewhere. The explicit conditions for each of the sets of results are supplied so that meaningful comparisons of your results with the ones listed here are possible.

2018年11月9日 星期五

Nose-Hoover NPT

Nose-Hoover chain length

現在分子模擬已經發展出許多thermostats和Barostats,最常用的莫非是利用Nose-Hoover演算法所建立的系統像是NVTNoseHoover和NPTMartynaTobiasKlein。這兩種方法都使用一種以上thermostats調控系統,每個thermostats彼此相互調節,使得溫度以及晶格震盪可以有效壓制,特別是模擬小系統效果非常好。Nose-Hoover chain length就是指串連幾個thermostats,chain length不影響平衡結果,但是平衡過程溫度震盪很大的話,可以增加chain length來減少溫度震盪。

參考

2018年11月8日 星期四

tail corrections

在rc到無限遠的空間內散佈著i和j粒子,所以只是在算i和j粒子密度分佈。如果把這裡的密度思考成質量就會發現右項單位和utail單位不合。從講義上也可以確認rho的定義是"average number density"。

參考
http://www.iitg.ac.in/physics/fac/padmakumarp/Courses/PH442/PH442_Slides.pdf

根據Cameron F. Abrams的code會發現少一個N
但其實只是自己眼殘

參考
https://github.com/cameronabrams/codes/blob/master/src/mclj_npt.c

unit converter

Conventional units:
  • distance = Angstroms
  • time = femtoseconds
  • mass = grams/mole
  • temperature = degrees K
  • pressure = atmospheres
  • energy = Kcal/mole
  • velocity = Angstroms/femtosecond
  • force = grams/mole * Angstroms/femtosecond^2
  • charge = +/- 1.0 is proton/electron
LJ reduced units:
  • distance = sigmas
  • time = reduced LJ tau
  • mass = ratio to unitless 1.0
  • temperature = reduced LJ temp
  • pressure = reduced LJ pressure
  • energy = epsilons
  • velocity = sigmas/tau
  • force = reduced LJ force (sigmas/tau^2)
  • charge = ratio to unitless 1.0
This listing of variables assumes conventional units; to convert to LJ reduced units, simply substitute the appropriate term from the list above. E.g. x is in sigmas in LJ units. Per-mole in any of the units simply means for 6.023 x 10^23 atoms.


Meaning        Variable        Units

positions      x               Angstroms
velocities     v               Angstroms / click (see below)
forces         f               Kcal / (mole - Angstrom)                
masses         mass            gram / mole
charges        q               electron units (-1 for an electron)
                                 (1 e.u. = 1.602 x 10^-19 coul)

time            ---             clicks (1 click = 48.88821 fmsec)
timestep        dt              clicks
input timestep  dt_in           fmsec
time convert    dtfactor        48.88821 fmsec / click

temperature     t_current       degrees K
                t_start
                t_stop
input damping   t_freq_in       inverse fmsec
internal temp   t_freq          inverse clicks
  damping

dielec const    dielectric      1.0 (unitless)
Boltmann const  boltz           0.001987191 Kcal / (mole - degree K)

virial          virial[xyz]     Kcal/mole = r dot F
pressure factor pfactor         68589.796 (convert internal to atmospheres)
internal        p_current       Kcal / (mole - Angs^3)
  pressure      p_start
                p_stop
input press     p_start_in      atmospheres
                p_stop_in
output press    log file        atmospheres
input damping   p_freq_in       inverse time
internal press  p_freq          inverse clicks
  damping

pot eng         e_potential     Kcal/mole
kin eng         e_kinetic       Kcal/mole
eng convert     efactor         332.0636 (Kcal - Ang) / (q^2 - mole)
                                (convert Coulomb eng to Kcal/mole)

LJ coeffs       lja,ljb         Kcal-Angs^(6,12)/mole

bond            various         see force_fields file
  parameters    2,3,4-body
                terms

參考
https://lammps.sandia.gov/doc/99/units.html

https://www.unitconverters.net/

Time
1 fs = 10^-15 s
1 ps = 10^-12 s

Pressure
1 pascal (Pa) = 1 newton/square meter (N/m2)
1 bar = 0.98692 atmosphere (atm) = 10^5 pascals (Pa)
1 atm = 101325 pascals (Pa)
1 pascals (Pa) = 0.0000098692 atm
1 GPa =10^9 Pa
1 MPa =10^6 Pa

Energy
1 joule (J) = 1 newton meter (Nm)
1 calorie (cal) = 4.184 joule (J)

Gas constant
pV = nRT
R is related to the Boltzmann constant, k, by

R = k NA
where k = 1.3806 x 10^-23 J K^-1, and NA = 6.022 x 10^23 mol^-1

R with different units 
8.31451 J K^-1 mol^-1 
8.20578 x 10^-2 L atm K^-1 mol^-1 
8.31451 x 10^-2 L bar K^-1 mol^-1 
8.31451 Pa m^3 K^-1 mol^-1 
1.98722 cal K^-1 mol^-1

1 Pa = 10^-3/4.184 kcal/m^3 = 10^-33/4.184 kcal/A^3 = 6.02*10^23/4.184/10^33 kcal/mol/A^3
1 GPa = 10^6 Pa = 6.02*10^29/4.184/10^33 kcal/mol/A^3 = 10^-4*6.02/4.184 kcal/mol/A^3

1 kcal/mol/A^3 = 4184*10^30/6/10^23 j/m^3 (Pa) * 0.0000098692 (atm/Pa) = 412927.328 atm

timestep (fs轉無因次)
t* = t * (epsilon / m / sigma^2)^1/2
t* = t([fs]) * [ sqrt( Kcal/mol * mol/g * Angstrom^-2 ) ] (1 Kcal = 4184J)
    = t([fs]) * [ sqrt( 4184*Kg*meter^2/(second^2) * 1/g *  1/(10^-20 meter^2) ) ] (1 Angstrom = 10^-10 meter)
    = t([fs]) * [ sqrt( 4184*1000 g*meter/(10^30 fs^2) * 1/g *  1/(10^-20 meter^2) ) ] (1 second = 10^15 femtosecond)
    = t * 0.020455

pressure (atm轉無因次)
P* = P([atm]) sigma^3 / epsilon (1 atm = 101325 Pa = 101325 Kg/m/s^2)
     = P([101325 Kg/meter/s^2]) * [ Angstrom^-3 * mol/Kcal ] (1 Kcal = 4184J)
     = P([101325 Kg/meter/s^2]) * [10^-30 meter * mol*s^2/4184/Kg/meter] (1 mol = 6*10^23)
     = P([101325 Kg/meter/s^2]) * [10^-30 meter * 6*10^23*s^2/4184/Kg/meter]
     = P * 0.00001453

temperature (K轉無因次)
T* = T Kb / epsilon
     = T([K]) * [ 1.38064852*10^-23 J/K * mol/Kcal ] (1 mol = 6*10^23)
     = T([K]) * [ 1.38064852*10^-23 J/K * 6*10^23/4184 J ]
     = T * 0.0019798975

2018年11月4日 星期日

GNU Scientific Library (gsl) on Mac

GNU Scientific Library是一種數值計算的C語言函式庫
https://www.gnu.org/software/gsl/doc/html/index.html
由於分子模擬的平衡速度為Maxwell-Boltzmann distribution,為了讓初始結構在平衡過程中不受到local minimum影響,可以利用gsl_ran_exponential設定系統初速度。

2018年11月3日 星期六

pybind11 for Mac

1. 三種方式安裝pybind11
$ brew install pybind11
$ pip3 install pybind11
$ conda install -c conda-forge pybind11

2. 寫example.cpp




參考
https://pybind11.readthedocs.io/en/stable/basics.html#header-and-namespace-conventions

3. 執行Mac的編譯指令產生example.cpython-36m-darwin.so
$ g++ -O3 -Wall -shared -std=c++11 -undefined dynamic_lookup `python3 -m pybind11 --includes` example.cpp -o example`python3-config --extension-suffix`

-undefined dynamic_lookup: Python gets linked dynamically without having all symbols resolved at link timepython3 -m pybind11 --includes: import pybind11 module
python3-config: output build options for python C/C++ extension
--extension-suffix: print the extension suffix used for binary extensions (產生example.cpython-36m-darwin.so)

參考
https://pybind11.readthedocs.io/en/stable/compiling.html#building-manually
https://osmocom.org/issues/1678
https://blog.csdn.net/IAlexanderI/article/details/81003225
https://helpmanual.io/man1/python3-config/

4. 利用python call c++ function

















$ python3 example.py


2018年10月18日 星期四

ubuntu 16.04 install Pulse Secure

1. 下載
$ wget http://ccnet.ntu.edu.tw/vpn/Download/ps-pulse-linux-9.0r2.1-b819-ubuntu-debian-64-bit-installer.deb

2. 安裝
$ sudo dpkg --install ps-pulse-linux-9.0r2.1-b819-ubuntu-debian-64-bit-installer.deb

3. 安裝missing dependency packages
$ sudo apt-get install libc6-i386 
$ sudo apt-get install lib32z1

4. 啟動Pulse client
$ /usr/local/pulse/PulseClient_x86_64.sh -h sslvpn2.ntu.edu.tw -u <username> -p <password> -U https://sslvpn2.ntu.edu.tw/  -r "NTU EMail Account"

5. 建立VPN連線
$ /usr/local/pulse/pulsesvc -h sslvpn2.ntu.edu.tw -u <username> -p <password> -r "NTU EMail Account" -U https://sslvpn2.ntu.edu.tw/

6. 確認連線狀態

ubuntu 16.04 不能用jupyter notebook

The Jupyter HTML Notebook.

這將啟動一個基於tornado的HTML筆記本服務器,它提供一個html5/
javascript筆記本客戶端。

2018年10月17日 星期三

Install CUDA with apt


ubuntu 16.04 install tensorflow

$ sudo apt update
$ sudo apt install python3-dev python3-pip
$ sudo pip3 install -U virtualenv
$ virtualenv --system-site-packages -p python3 ./venv
$ source ./venv/bin/activate
$ pip install --upgrade pip
$ pip list
$ pip install --upgrade tensorflow
$ python -c "import tensorflow as tf; print(tf.__version__)"
有顯示版本代表安裝完成
$ pip install tensorflow-gpu (要先安裝cuDNN,驗證版本cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2)
$ deactivate

TensorFlow from source in Ubuntu 18
https://medium.com/@isaaclascasas/tensorflow-from-source-in-ubuntu-18-4b5dcca910b9?fbclid=IwAR1-E-n7KStl8gPjriDEe4QZtXKZSJfQUK86q6DZRQLhp3Vj9_0qbwYA0MI

如果有顯示Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA,在跑CPU版本的tensorflow時要加入下面兩行API

$ import os
$ os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'

由於tensorflow默認分佈是在沒有CPU擴展的情況下構建的,例如SSE4.1,SSE4.2,AVX,AVX2,FMA等。默認版本(來自pip install tensorflow的版本)旨在與儘可能多的CPU兼容。若是用GPU版本的話,就不必在乎這個問題發生。

如果有顯示ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory
$ ~/~/.zshrc
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64/
$ source ~/.zshrc

如果出現Traceback (most recent call last):
  File "<string>", line 1, in <module>
AttributeError: module 'tensorflow' has no attribute 'enable_eager_execution'
$ pip install tf-nightly  
$ pip install tf-nightly-gpu

ubuntu 16.04 install cuDNN

1. https://developer.nvidia.com/cudnn 下載

cuDNN v7.3.1 Library for Linux
cuDNN v7.3.1 Runtime Library for Ubuntu16.04 (Deb)
cuDNN v7.3.1 Developer Library for Ubuntu16.04 (Deb)
cuDNN v7.3.1 Code Samples and User Guide for Ubuntu16.04 (Deb)


$ tar -xzvf cudnn-9.0-linux-x64-v7.tgz
$ sudo cp cuda/include/cudnn.h /usr/local/cuda/include
(sudo cp cuda/targets/ppc64le-linux/include/cudnn.h /usr/local/cuda/include)
$ sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64
(sudo cp cuda/targets/ppc64le-linux/lib/libcudnn* /usr/local/cuda/lib64)
$ sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*
$ sudo dpkg -i libcudnn7_7.3.1.20-1+cuda10.0_amd64.deb
$ sudo dpkg -i libcudnn7-dev_7.3.1.20-1+cuda10.0_amd64.deb
$ sudo dpkg -i libcudnn7-doc_7.3.1.20-1+cuda10.0_amd64.deb
$ cp -r /usr/src/cudnn_samples_v7/ $HOME
$ cd  $HOME/cudnn_samples_v7/mnistCUDNN
$ make clean && make
$ ./mnistCUDNN
有出現Test passed!代表完成

ubuntu 16.04 install CUDA


ubuntu install for keras

在安裝keras之前,要先安裝其他套件:
1. 安裝numpy和scipy,並確保安裝了基本的線性代數函式庫(BLAS),以便模型在CPU上快速運行。
2. 安裝兩個額外的包,在使用Keras時非常方便:HDF5(用於保存大型神經網絡文件)和Graphviz(用於可視化神經網絡架構)。
3. 通過安裝CUDA驅動程序和cuDNN,確保GPU能夠運行深度學習代碼。
4. 安裝Keras的後端:TensorFlow、CNTK或Theano。


2018年9月14日 星期五

ubuntu lammps install easily

1. 安裝前所需套件
$ sudo apt update
$ sudo apt-get install gcc
$ sudo apt-get install g++
$ sudo apt-get install gfortran
$ sudo apt-get install make
$ sudo apt-get install mpi-default-*
$ sudo apt-get install libfftw3-dev
$ sudo apt-get install libjpeg-dev
$ sudo apt-get install libpng16-dev
$ sudo apt-get install libpng-dev

2. 下載Lammps
https://lammps.sandia.gov/download.html
下載到家目錄

3. 安裝meam
$ cd /home/chiustin/lammps-12Dec18/lib/meam
$ sudo make -f Makefile.gfortran clean
$ sudo make -f Makefile.gfortran

參考
https://github.com/lammps/lammps/tree/master/lib/meam

4. 安裝reax
$ cd /home/chiustin/lammps-12Dec18/lib/reax
$ sudo make -f Makefile.gfortran

參考
https://lammps.sandia.gov/threads/msg66213.html
https://lammps.sandia.gov/threads/msg62170.html

5. 安裝voronoi
$ cd /home/chiustin/lammps-12Dec18/lib/voronoi
$ wget http://math.lbl.gov/voro++/download/dir/voro++-0.4.6.tar.gz
$ tar -xvf voro++-0.4.6.tar.gz
$ cd voro++-0.4.6
$ make clean
$ sudo make
$ sudo make install
$ cd /home/chiustin/lammps-12Dec18/lib/voronoi
$ gedit Makefile.lammps
$ voronoi_SYSINC = -I/usr/local/include/voro++
$ voronoi_SYSLIB = -lvoro++
$ voronoi_SYSPATH = -L/usr/local/lib

參考
https://github.com/lammps/lammps/tree/master/lib/voronoi

6. 安裝fftw
$ cd
http://www.fftw.org/download.html or
$ wget http://www.fftw.org/fftw-3.3.8.tar.gz
$ tar -xvf fftw-3.3.8.tar.gz
$ cd fftw-3.3.8/
$ sudo ./configure --prefix=/usr/local --enable-float
(for Mac ./configure --prefix=/usr/local --enable-float --enable-threads
參考 http://www.fftw.org/install/mac.html)
$ sudo make -j4
$ sudo make install
$ cd /home/chiustin/lammps-12Dec18/src/MAKE/OPTIONS/
$ vi Makefile.fftw
確認
FFT_INC = -DFFT_FFTW3 -I/usr/local/include
FFT_PATH = -L/usr/local/lib
FFT_LIB = -lfftw3

參考
https://zhuanlan.zhihu.com/p/36457551

7. 安裝mpich
$ cd
$ wget http://www.mpich.org/static/downloads/3.3/mpich-3.3.tar.gz
$ tar -xvf mpich-3.3.tar.gz
$ cd mpich-3.3/
$ sudo ./configure --prefix=/usr/local
$ sudo make -j4
$ sudo make install
$ cd /home/chiustin/lammps-12Dec18/src/MAKE/OPTIONS
$ vi Makefile.g++_mpich_link
確認
MPI_INC = -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -I/usr/local/include
MPI_PATH = -L/usr/local/lib
MPI_LIB = -lmpi -lmpl -lpthread

參考
https://zhuanlan.zhihu.com/p/36457551

8. 選擇套件
$ cd /home/chiustin/lammps-12Dec18/src
$ make yes-meam
$ make yes-voronoi
$ make yes-class2
$ make yes-manybody
$ make yes-molecule
$ make yes-dipole
$ make yes-USER-DRUDE
$ make yes-RIGID
$ make yes-reax
$ make yes-user-reaxc

$ make package-status 可以看哪些package沒安裝

9. 編譯binary
$ cd /home/chiustin/lammps-12Dec18/src/MAKE/MACHINES
$ cp Makefile.ubuntu ../
$ cd /home/chiustin/lammps-12Dec18/src
$ sudo make ubuntu
$ sudo make mpi -j4
$ sudo make serial -j4

for Mac
$ cd /home/chiustin/lammps-12Dec18/src/MAKE/MACHINES
$ cp Makefile.mac ../
$ cp Makefile.mac_mpi ../
$ vi Makefile. mac_mpi

CC =        /usr/local/bin/mpic++
CCFLAGS =   -O3
SHFLAGS =   -fPIC
DEPFLAGS =  -M

LINK =      /usr/local/bin/mpic++
LINKFLAGS = -O3
LIB =
SIZE =      size

$ cd /home/chiustin/lammps-12Dec18/src
$ sudo make mac
$ sudo make mac_mpi

10. 環境變數
$ sudo cp lmp_ubuntu /usr/local/bin
$ sudo cp lmp_mpi /usr/local/bin
$ sudo cp lmp_serial /usr/local/bin
$ sudo vim /etc/profile
$ export PATH=/usr/local/bin:$PATH
$ source /etc/profile
$ which lmp_ubuntu
$ which lmp_mpi
$ which lmp_serial

10. 測試
$ cd /home/chiustin/lammps-12Dec18/examples/shear
$ mpirun -np 3 lmp_ubuntu < in.shear
$ lmp_ubuntu < in.shear
$ mpirun -np 3 lmp_mpi < in.shear
$ lmp_serial < in.shear

參考
http://i.youku.com/simuly#opennewwindow

ubuntu install


2018年8月1日 星期三

zsh: command not found: jupyter

問題:
安裝完Anaconda要使用jupyter notebook時
iterm2終端機輸入jupyter notebook出現
zsh: command not found: jupyter

解決:
vi ~/.zshrc
加入
source ~/.bash_profile