# 當日工作表
## 12/9
> 12/9當日工作表 [name=lee] [time=Wed, Dec 9, 2020 18:36] [color=red]
* rufus
* 目的為將可以開機的ISO檔(如Windows、Linux...)製作成可以放在USB裡安裝碟,就是可以插入隨身碟就開機就直接進USB所安裝的作業系統 **(必須在BIOS裡設置USB權限為最高,因為電腦原本設置的是自己的系統->會直接開啟USB的安裝系統)**
* [輕鬆製作可開機的 USB 磁碟機](https://rufus.ie/zh_TW.html)
* [教學 可開機隨身碟必備工具 Rufus](https://izaka.tw/bootable-usb-rufus-user-guide/#shi_yong_ji_you_ISO_ying_xiang_dang_zhi_zuo_ke_kai_ji_sui_shen_die)
* 隨身碟只有120MB 載不了呵呵呵
* mvapich.x
* 載到一半
:::info
:fire:期中考還沒讀完.....:fire:
:::
## 12/12
>當日工作表[name=Lee][time=Sat, Dec 12, 2020][color=red]
* 換網卡
* 灌系統
* 插開機碟
* 開機設定
* BIOS 開機碟設置最高
* system server設置



==以上是client的,sever需多一個較File and Storage Server==
* 網路設置
1.改名A0~ 並apply
2.按configure
3.網路自動偵測,然後IPv4那改Manual 然後按Add adress 寫192.168.1.10~
按tab 會自動偵測Port24
然後gateway 192.168.1.1
DNS 8.8.8.8

* 硬碟
1.先刪除舊有的硬碟
2.LVM改standard 然後自動分配
3.從上面下來 分別是 /home=414.51GB /=500GB 然後自動分配最後一個額滿
* 時區:台灣
* 下一步 設定root密碼 0和user(ncku)和密碼000000
* 跑完reboot 在螢幕按掉(=關機)後拔除開機碟,不然會再重裝一次
* 等到登入畫面即完成
<font color="#fd2e02">**完成**</font>
:::success
:+1: 謝謝Micheal的晚餐招待 :+1:
:::
## 12/13
>當日工作表[name=Lee][time=Sun, Dec 13, 2020][color=red]
* 再灌其他機台 測試哪台有問題
* 測試
* ifconfig 確認Ip情況
* ping 8.8.8.8 確認連線網際網路狀況(DNS)
* ping www.google.com直接上網連看看
* 網內互聯 ping 192.168.1.10~
* 如果還是不行 ifdown網卡 再ifup試試
* (如果IP設錯 vim /etc/sysconfig/network-scripts 修改相關係數)
* ssh互連免密碼
* [NFS 安裝設定](https://blog.skywebster.com/how-to-setup-nfs-server-on-centos-7-rhel-7/)
* 前置作業
* `vim etc/hosts` 打
```
192.168.1.11 A01
192.168.1.12 A02
192.168.1.13 A03
192.168.1.14 A04
```
1. ssh-keygen(產生公鑰)
2. ssh-copy-id(把公鑰給每一台)
* 安裝NFS Server
1.(所有client及server)NFS server安裝(含rpcbind)
指令`yum install nfs-utils libnfsidma`
啟動NFS server及rpcbind(nfs-server只有server需要)(rpcbind要先)
```
systemctl enable rpcbind
systemctl enable nfs-server
systemctl start rpcbind
systemctl start nfs-server
```
* 設定NFS
* server
1.根目錄下創一個isc21(掛載目錄)
2.server端 編輯/etc/exports(分享資料夾出去)
資料夾路徑 IP(權限)
輸入```/isc21 192.168.1.0/24(rw,sync,no_root_squash)```
* client
3.設定掛載 vim etc/fstab(最下面加一行)
```
A05(server台):/isc21[tab]/isc21[tab]nfs[tab]defaults[tab]0[tab]0
```
4.reboot (確認更改的設定有被讀取,在開機時就會讀取fstab)
(如果要直接掛載可以掛載的目錄的話,可直接用mount -a)
5.測試 server端創資料夾 查看其他四台共用情況
-檢視是否成功掛載:```df -h```
->關機時,需要把掛載的目錄斷開連結
指令```umount /isc21(掛載目錄)```(需在client端且不在掛載目錄下)
以上掛載皆須**確定防火牆已關閉(server端及client)**</font>
如果需要換server端及client
請參閱[server端及client互換](https://hackmd.io/q7ay8q4dRFaTMz2q84bGxg#NFS-serverclient-%E4%BA%92%E6%8F%9B)
* 單機(跨機)
跨機
1. 一樣先改INCAR
2. 創一個檔 mpi.hosts 裡面有要跨機的client
3. (只要一台)mpiexec(跨機操作) -ppn 8(一台8核) -np 32(共32核) -f /root/isc21/vasp.Hg/mpi.hosts(絕對路徑、在INPUT目錄下可以不用) vasp(必須ssh免密碼)
<font color="#fd2e02">**FCL -mkl(函式庫) 從sequential->cluster**</font>
關閉防火牆
## 12/16
>當日工作表[name=Lee][time=Wed, Dec 16, 2020][color=red]
* 測試跑跨機
1. 解壓縮然後改檔名(vasp.Hg.幾核.幾個節點)
2. 檔案裡面IN-long改INCAR測試+mpi.hosts裡寫要跑的機台)
3. mpiexec -ppn(幾核) -np (幾核乘幾個節點) -f mpi.hosts vasp
4. 分析
1. Total CPU time used(sec)
(1)`cat [file name]`->將文件內容顯示於terminal上
(2) 找尋需要比較的項目 EX:Total CPU time used(sec)
(3)grep -R(意思為file) "要比較的項目(字串)" vasp.Hg.ppn0*(*表示所有具有此名的files)EX`grep -R "Total CPU time used (sec)" vasp.Hg.ppn0*`
* OUTCAR 基本
* [VASP的输出文件(OUTCAR)](https://www.bigbrosci.com/2017/10/29/ex07_OUTCAR/)
## 12/25-12/26
>當日工作表[name=Lee][time=Wed, Dec 16, 2020][color=red]
重灌centOS
找不同mpi
### intel mpi
->oneAPI HPC
安裝
->[Centos下安装oneAPI基础工具包(Intel® oneAPI Base Toolkit)和高性能计算工具包(Intel® oneAPI HPC Toolkit)](https://www.mdeditor.tw/pl/gm69)
[intel官網tutoral](https://software.intel.com/content/www/us/en/develop/documentation/get-started-with-intel-oneapi-hpc-linux/top.html)
[Intel® oneAPI Base Toolkit](https://software.intel.com/content/www/us/en/develop/tools/oneapi/base-toolkit/download.html?wapkw=intel%20oneapi%20base%20toolkit#operatingsystem=Linux&#distributions=Web%20&%20Local%20(recommended)&#options=Local)
[Intel® oneAPI HPC Toolkit](https://software.intel.com/content/www/cn/zh/develop/tools/oneapi/hpc-toolkit/download.html#operatingsystem=Linux&#distributions=Web%20&%20Local%20(recommended)&#options=Local)
需要兩個 先裝base 再裝HPC
Intel® oneAPI Base Toolkit
安裝指令
```
wget https://registrationcenter-download.intel.com/akdlm/irc_nas/17431/l_BaseKit_p_2021.1.0.2659_offline.sh
```
執行圖形化介面安裝(目前只有圖形化介面)
```
sudo bash l_BaseKit_p_2021.1.0.2659_offline.sh`
```
按照介面安裝
需要執行時此編譯器時
要執行
`. /opt/intel/oneapi/setvars.sh`(安裝路徑)
會出現以下畫面

代表環境建立完成,可以開始編譯
在關掉terminal之後就會結束環境
Intel® oneAPI HPC Toolkit
安裝指令
```
wget https://registrationcenter-download.intel.com/akdlm/irc_nas/17427/l_HPCKit_p_2021.1.0.2684_offline.sh
```
執行圖形化介面安裝(目前只有圖形化介面)
```
sudo bash l_HPCKit_p_2021.1.0.2684_offline.sh
```
## 12/27
ALPHAFOLD & LAMMPS
### LAMMPS
>[上一屆參考資料(整套)](https://hackmd.io/VpOMhrskQRa8AixYB3BcyA?view#LAMMPS)
#### Introduction
##### 中文方面
->[LAMMPS使用手冊](https://drive.google.com/file/d/0BwKPU847pTTzWFVsc1lEdjUxMEU/view)(中文)
-> [LAMMPS教程](https://computational-materials-science-notes.readthedocs.io/zh_CN/latest/LAMMPS%E6%95%99%E7%A8%8B.html)
->[【讲座】2020年分子动力学LAMMPS计算课程](https://search.bilibili.com/all?keyword=%E3%80%90%E8%AE%B2%E5%BA%A7%E3%80%912020%E5%B9%B4%E5%88%86%E5%AD%90%E5%8A%A8%E5%8A%9B%E5%AD%A6LAMMPS%E8%AE%A1%E7%AE%97%E8%AF%BE%E7%A8%8B&from_source=nav_search_new)
->[LAMMPS教程- 知乎](https://zhuanlan.zhihu.com/p/53013109)
### 下載過程
按照[From GitHub](https://hackmd.io/VpOMhrskQRa8AixYB3BcyA?view#from-GitHub)步驟下載->成功
建立LAMMPS->參照[Build LAMMPS](https://hackmd.io/VpOMhrskQRa8AixYB3BcyA?view#Build-LAMMPS)
>cmake失敗->推測cmake是腳本(網路上說[cmake](https://zh.wikipedia.org/wiki/CMake))
>make失敗->在make serial # build a serial LAMMPS executable using GNU g++失敗(推測為沒有 gnu 編譯器)
參照[lammps-mpi并行安装](https://www.jianshu.com/p/aabc4c340ac7)(內有mpich編譯器安裝、fftw)
編譯器位置需於lammps/src/MAKE裡面的Makefile.mpi修改
>(註釋:src->source、lib->library)


在[lammps-mpi并行安装](https://www.jianshu.com/p/aabc4c340ac7)有參考
照理來說,安裝完成可以執行
```
make mpi
```
## 1/11
>[name=lee][time=Mon, Jan 11, 2021][color=red]
繼續lammps
查makefile.mpi如何設置
>概念釐清[color=yellow]
>mpi V.S. compiler
>[mpi](https://zh.wikipedia.org/wiki/%E8%A8%8A%E6%81%AF%E5%82%B3%E9%81%9E%E4%BB%8B%E9%9D%A2)
**使用cmake進行安裝**
[cmake下載](https://www.796t.com/article.php?id=188757)
分成兩階段 下載openSSL(通訊協定)(如果不下載此軟體,cmake可能下載會不完整)
>./config 為執行安裝檔[color=blue]

安裝完cmake會出現下列資訊

>然後cmake ../cmake出現以下資訊(oneapi環境建立情況下)[color=red]
>
>顯示失敗
> 推測原因為lammps不支援oneapi\(***不是這個原因***)
>改下載MPICH[color=green]
>
>`cmake ../cmake`成功
>mpi應是自動抓取MPICH
mpirun -np 4 lmp_mpi -in in.file 無效
原因為沒有mpi環境 cmake生成執行文件為lmp
**成功流程(make,oneAPI下)**
參考[Intel编译器编译并行版lammps](https://zhuanlan.zhihu.com/p/145143971)
[C++11 standard compliance](https://lammps.sandia.gov/doc/Build_settings.html#cxx11)
[Centos 7操作系统安装lammps最新教程](https://www.codenong.com/js6067df0b94da/)
* 安裝lammps -> 之前有
* 安裝fftw
`wget http://www.fftw.org/fftw-3.3.8.tar.gz`
`tar -xvf fftw-3.3.8.tar.gz`
然後執行並指定安裝路徑(``--prefix=``)
```
./configure --prefix=/opt/fftw-3.3.8 CC=gcc F77=ifort MPICC=mpiicc --enable-mpi --enable-openmp --enable-threads --enable-avx --enable-shared=yes
make
make install
```
編輯 lammps/src/MAKE/Makefile.mpi
``` vim lammps/src/MAKE/Makefile.mpi```
調整成以下

**上面```-std=c++11```為intel oneAPI所需,如是MPICH等則不用**

編輯完成後
在src目錄下 執行
```
make clean-all
make yes-all
make no-lib
make mpi
```
```
make ps # check which packages are currently installed
make yes-name # install a package with name
make no-name # un-install a package with name
```
`make ps`為檢查packages是否都有安裝
`make mpi`成功會生成`lmp_mpi`執行文件->在mpi環境下就可以使用(執行lammps)
如有`make mpi失敗` 則需 ```make clean-all```清除之前的數據
障礙排除再`make mpi`
為了方便使用 lmp_mpi執行檔(功能就像vasp一樣)
可在bashrc裡加入路徑
`export PATH=$PATH:/root/lammps/src`
然後`source .bashrc`更新變數
`which lmp_mpi` 可確認lmp_mpi(會顯示位置)
* 然後可以進入examples測試
`mpirun -np 4 lmp_mpi < in.(examples)`
測試運行結果(in.* 為input file,log.* 為output file)
###### tag:`lammps`
## 1/12
>當日工作表[name=Lee][time=Tue, Jan 12, 2021][color=red]
試跑其他examples->成功
確認make可行
試試看cmake
在開啟mpich編譯環境下執行
`cmake ../cmake`跑出以下錯誤

run完上面指令再`cmake ../cmake`成功跑出

顯示出找到的MPI為mpich3
`cmake --build`之後在examples內輸入
`mpirun -np 4 lmp < in.(範例)`
(須確定在bashrc裡加入 `export PATH=$PATH:/root/lammps/build/lmp`)
成功執行
(mpich啟動:`export PATH=$PATH:/root/lammps/mpich3/bin`)
確認 mpich啟動 `which mpicc`
`which mpicxx`
->cmake建置的lmp執行檔在mpich環境下
->make建置的lmp_mpi執行檔在oneAPI環境下
輸出檔比較(時間不同)
<font color="#fd2e02">**以下為mpich**</font>



<font color="#fd2e02">**以下為oneAPI**</font>



可以發現oneAPI時間極短
Comm(核內通信消耗時間)->可以得知核心數越高越慢 但核心太少反而變慢
我的電腦情況下
1core -> 5s 99.9%CPU used
2cores -> 3s 81.9%CPU used
3cores -> 5s 45.9%CPU used
4cores -> 5s 35%CPU used
5cores -> 6s 26.1%CPU used
6cores -> 7s 21.1%CPU used
時間主要消耗為Pair Comm
以上測試為用oneAPI編譯 no openMP thread
:::info
本日問題 cmake無法跑oneAPI
:::
###### tag:`lammps`
## 1/13
>當日工作表[name=Lee][time=Wed, Jan 13, 2021][color=red]
下載可視化軟體VMD
[Linux软件安装④|VMD](https://zhuanlan.zhihu.com/p/38146922)
按照自己電腦路徑修改
:::info
VMD需要pdb檔或dump文件來跑 一般跑出的log文件無法執行
:::
->log檔為整體系統狀況的output dump檔為原子calculation
https://blog.csdn.net/ditigao0965/article/details/101740674
[額外lammps tool介紹](https://www.smcm.iqfr.csic.es/docs/lammps/Section_tools.html)
[dump 輸出](https://www.mozheyang.top/2020/04/10/lammps2/)
->在in.(輸入檔)內可以調整dump輸出->輸出dump檔案
>dump控制輸出指令為in.內部指令
->丟到VMD裡可以畫出東西->成功
補充:
[Lammps语法规则及常用任务](https://wenku.baidu.com/view/7be423500a1c59eef8c75fbfc77da26925c596ac.html)
針對COVID-19病毒尋找資料
https://www.ks.uiuc.edu/
https://www.nytimes.com/interactive/2020/health/coronavirus-unveiled.html
###### tag:`lammps`
## 1/14
>當日工作表[name=Lee][time=Thu, Jan 14, 2021][color=red]
繼續查詢COV-19
試著查詢病毒建模過程
[A Multiscale Coarse-Grained Model of theSARS-CoV-2 Virion](https://www.cell.com/biophysj/pdf/S0006-3495(20)33168-4.pdf)
[Computer simulation of viral-assembly andtranslocation](https://scholarworks.umass.edu/cgi/viewcontent.cgi?article=1758&context=open_access_dissertations)
**protein data bank**
[protein data bank Japan cov-19](https://pdbj.org/featured/covid-19?tab=all)
[protein data bank](http://www.rcsb.org/)
[National Science Fundation](https://www.nsf.gov/)
[Molecular SciencesSoftware Institute-COVID-19](https://covid.molssi.org/)
* modeling方式
* CG(coarse-grained)->粗粒度建模
* AA(all-atom)
:::info
有找到不同蛋白質模型->如何組裝
:::
youtube
[COV-19 protein model](http://www.charmm-gui.org/?doc=archive&lib=covid19)
https://www.youtube.com/watch?v=GQUCCkHNjN8&pbjreload=101
###### tag:`lammps`
## 1/15
>當日工作表[name=Lee][time=Fri, Jan 15, 2021][color=red]
查詢蛋白質組建過程
參考網站及論文
[Molecular dynamics simulation of the self-assembly oficosahedral virus](https://tel.archives-ouvertes.fr/tel-02353631/document)
[GROMACS蛋白配体分子动力学模拟预处理过程简要笔记](https://zhuanlan.zhihu.com/p/149862369)
[GROMACS蛋白配体分子动力学模拟结果分析简要笔记](https://zhuanlan.zhihu.com/p/149863158)
聽博後介紹MHM2 及蛋白質組成 alphafold使用
軟體需著重docker封包->比較快切換版本
###### tag:`lammps`
## 1/29
>當日工作表[name=Lee][time=Fri, Jan 29, 2021][color=red]
過程複習
lmp_mpi 為 make 由 oneAPI 建置 所以只能在oneAPI環境下建立
oneAPIstart(在bashrc裡加入 `alias oneAPIstart='. /opt/intel/oneapi/setvars.sh'`)建立環境
執行input -> `mpirun -np 4 lmp_mpi < in.~`
lmp 為 cmake 由 mpich 建置 所以只能在mpich環境下建立
mpichstart(在bashrc裡加入 `alias mpichstart='export PATH=$PATH:/root/lammps/mpich3/bin'`)建立環境
執行input -> `mpirun -np 4 lmp < in.~`
目前方向->找論文 看能不能做出一樣的結果
參數設置
[LAMMPS教程](https://computational-materials-science-notes.readthedocs.io/zh_CN/latest/LAMMPS%E6%95%99%E7%A8%8B.html)
[LAMMPS 实例](http://hzwtech.com/Help/ApplicationExamples.html#id36)
[LAMMPS 的输入脚本结构](https://www.dazhuanlan.com/2020/02/28/5e5895d7f36a1/)
[LAMMPS中in文件结构等总结](http://blog.sciencenet.cn/blog-3437453-1264601.html)
[Parameter Tables of Crystals](https://onlinelibrary.wiley.com/doi/pdf/10.1002/9783527633296.app5)
:::info
對於input了解不夠透徹
:::
###### tag:`lammps`
## 1/30
同1/29
## 2/1
>當日工作表[name=Lee][time=Mon, Feb 1, 2021][color=red]
整理官方example
嘗試將PDB檔轉成lammps input file
查到方法有幾種
>github提供的pdb2lmp -> 有遇到問題不知道如何解決
>lammps本身工具 ch2lmp -> 過於複雜,理解困難
>moltemplate轉換 -> 官網進不去
>ATB建模 -> 可模擬原子數很少[color=yellow]
###### tag:`lammps`
## 2/2
>當日工作表[name=Lee][time=Tue, Feb 2, 2021][color=red]
github所提供的pdb2lmp是依據已構成的資料庫去抓資料 推測不能用是因為資料庫無更新
[lammps學習相關](https://www.zhihu.com/column/c_1242450628167217152)
[lammps學習](https://www.zhihu.com/people/ploou-33/posts?page=3)
* VMD轉換PDB檔
1. 用VMD打開PDB檔
2. 在terminal裡輸入 `topo writelammpsdata filename.data molecular`
3. 就會生成data文件
[packmol與moltemplate生成data工具](https://www.796t.com/article.php?id=237380)
###### tag:`lammps`
## 2/3
>當日工作表[name=Lee][time=Wed, Feb 3, 2021][color=red]
[分子动力学初始结构构建程序Packmol的使用](https://warmshawn.github.io/2019/09/30/Packmol%E4%BD%BF%E7%94%A8/)
### packmol相關資料
[packmol](http://www.ime.unicamp.br/~martinez/packmol/userguide.shtml)
利用moltemplate跑例子
流程參考 https://www.youtube.com/watch?v=rBHyWjWVyaA
有關moltemplate與lammps一起跑的相關例子
https://www.youtube.com/channel/UCLrOWMR0SjeLyHZyQncUTYg
lammps協助寫input的工具->ipp tool
:::info
目前已知有兩種方法跑lammps
>用VMD轉PDB檔 在自己寫input file
>寫moltemplate轉換PDB檔 會寫成input file 跟 data檔(理論上)[color=blue]
->目標:以最簡單方式將PDB檔轉成INPUT file/data 並運行
:::
###### tag:`lammps`
## 2/4
>當日工作表[name=Lee][time=Thu, Feb 4, 2021][color=red]
>今日目標->找尋pdb轉input file(using moltemplate)
moltemplate必要條件:system.lt(lt檔)->需要寫的
[Reading large PDB files with Biopython.](https://biopython.org/wiki/Reading_large_PDB_files)
###### tag:`lammps`
## 2/5
>當日工作表[name=Lee][time=Fri, Feb 5, 2021][color=red]
:::info
如果只有單一蛋白質或分子(模擬環境),則可用VMD轉data再自己寫lammps的input file沒問題,但如果超過一個蛋白質組裝,則需其他輔助程式寫data/input file
:::
moltemplate system.lt設置
主要參考:https://sourceforge.net/p/lammps/mailman/message/36049205/
[information needed to make an LT (moltemplate) file](https://lammps.sandia.gov/threads/msg72917.html)
###### tag:`lammps`
## 2/6
>當日工作表[name=Lee][time=Sat, Feb 6, 2021][color=red]
* [Simulating selective binding of a biological template to a nanoscale architecture: a core concept of a clamp-based binding-pocket-favored N -terminal-domain assembly](https://sci-hub.se/10.1039/d0nr07320b)
* [Prediction of the interaction between HIV viruses and Human Serum Albumin (HSA) molecules using an equilibrium dynamics simulation program for application in bio medical science](https://sci-hub.se/10.1016/j.molliq.2020.113989)
NIST potential file->https://www.ctcms.nist.gov/potentials/
###### tag:`lammps`
## 2/8
>當日工作表[name=Lee][time=Mon, Feb 8, 2021][color=red]
:::warning
:mega:回到lammps基本input 搞懂運算模式
:::
lammps為一分子動力學模擬軟體
>原理講解及重要網站
>[lammpstube](http://lammpstube.com/)
>[LAMMPS教程](https://zhuanlan.zhihu.com/p/53013109)
>[分子动力学及力场理论介绍](https://www.bilibili.com/video/BV1jQ4y1K7V7?from=search&seid=8326669748313307013)
>[LAMMPS初级第一讲_分子动力学模拟基础](https://www.zhihu.com/zvideo/1332646637550657536)
>[从计算材料科学到固体力学](https://www.zhihu.com/question/50559712/answer/1487830301)
>[lammps加油站](https://www.zhihu.com/column/c_1294664386653560832)
>[LAMMPS全能助手](https://www.zhihu.com/column/c_1329180391635619840)
>[LAMMPS 模拟软件如何学习?](https://www.zhihu.com/question/50559712/answer/1487830301)
>[LAMMPS学习系列](https://www.zhihu.com/people/ploou-33/posts?page=3)
>[计算模拟之道](https://www.zhihu.com/column/c_1242450628167217152)
>[github-lammps for beginners](https://github.com/mrkllntschpp/lammps-tutorials)
>[color=yellow]
>input file
>[LAMMPS 的输入脚本结构](https://www.dazhuanlan.com/2020/02/28/5e5895d7f36a1/)
>[LAMMPS中in文件结构等总结](http://blog.sciencenet.cn/blog-3437453-1264601.html)
>[LAMMPS计算流程](http://hzwtech.com/Help/ApplicationExamples.html#id36)
>[脚本结构](https://computational-materials-science-notes.readthedocs.io/zh_CN/latest/LAMMPS%E6%95%99%E7%A8%8B.html#id2)
>[lammps manual中文翻譯](http://www.52souji.net/tag/lammps/)
###### tag:`lammps`
## 2/9
>當日工作表[name=Lee][time=Tue, Feb 9, 2021][color=red]
->分子動力學為藉由經驗公式(力場/勢能)加上一些系統資訊(系綜、邊界條件)、結構藉由**牛頓運動方程**去計算原子位置、速度及加速度(因計算量比第一原理少,所以可計算較大尺度的分子模擬)
:::info
->經驗公式(力場/勢能)-為可選擇修改的,也可自己寫
->既然是粗粒化分子模型-粗粒化方法是否可以調整
:::
###### tag:`lammps`
## 2/20
>當日工作表[name=Lee][time=Sat, Feb 20, 2021][color=red]
[ISC21 coding challenge](https://hpcadvisorycouncil.atlassian.net/wiki/spaces/HPCWORKS/pages/2159706134/Coding+Challenge+ISC21)
[MPI_alltoallv](https://www.open-mpi.org/doc/v4.1/man3/MPI_Alltoallv.3.php)
singularity:
[Linux 安裝 Singularity 3 容器與基本使用教學](https://blog.gtwang.org/linux/singularity-3-installation-and-usage-tutorial/)
[Singularity安装和使用](https://my.oschina.net/zhangyangyang/blog/1186793)
[Linux Developer 都應該學習的 Container 工具 - Singularity ](https://champyen.blogspot.com/2020/10/linux-developer-container-singularity.html)
[Singularity Containers](https://scits.math.unibe.ch/singularity.html#1)
[Docker和Singularity双剑合璧构建生物信息分析流](http://tiramisutes.github.io/2019/08/29/docker.html)
[Singularity——HPC 环境的绝佳容器解决方案 ](http://blog.zxh.site/2018/05/15/Singularity/)
###### tag:`Singularity`
## 2/25
>當日工作表[name=Lee][time=Thu, Feb 25, 2021][color=red]
看docker
## 2/26
>當日工作表[name=Lee][time=Fri, Feb 26, 2021][color=red]
安裝docker看docker指令
## 3/3
>當日工作表[name=Lee][time=Wed, Mar 3, 2021][color=red]
寫dockerfile
開頭
FROM centos
->(版本)https://github.com/docker-library/repo-info/blob/master/repos/centos/tag-details.md
->有出錯,改用FROM centos:7
## 3/4
>當日工作表[name=Lee][time=Thu, Mar 4, 2021][color=red]
繼續dockerfile
## 3/5
>當日工作表[name=Lee][time=Fri, Mar 5, 2021][color=red]
完成lammps dcokerfile 且可運行,測試例子可跑
## 3/10-3/12
>當日工作表[name=Lee][time=Wed, Mar 10, 2021][color=red]
看singularity
[Singularity 基礎介紹](https://yylin.io/2020/06/16/singularity-introduction/)
[Singularity官網](https://sylabs.io/guides/3.5/user-guide/introduction.html#why-use-singularity)
[Linux 安裝 Singularity 3 容器與基本使用教學](https://blog.gtwang.org/linux/singularity-3-installation-and-usage-tutorial/)
[Singularity安裝和使用](https://www.itread01.com/articles/1499360225.html)
[Singularity and Docker](https://singularity.lbl.gov/docs-docker)
[Linux Developer 都應該學習的 Container 工具 - Singularity ](https://champyen.blogspot.com/2020/10/linux-developer-container-singularity.html)
[Singularity Containers](https://bit.ly/2Jrh566)
[HowTo:建立 TWNIA2 容器](https://man.twcc.ai/@twccdocs/howto-twnia2-create-sglrt-container-zh)
## 3/16
>當日工作表[name=Lee][time=Tue, Mar 16, 2021][color=red]
測試singularity 將上傳到docker hub的lammps檔下載變成SIF檔
並開啟
>出現問題:以root模式開啟後root目錄下的檔案沒出現原本應該要在映像檔裡面的lammps file
>如果以user執行則沒有東西[color=red]
## 3/17-18
>當日工作表[name=Lee][time=Wed, Mar 17, 2021][color=red]
:::success
上面的解決辦法為:
因為singularity會吃本機的root跟home所以不能把檔案存放在這兩個目錄底下,會被覆蓋掉(應該singularity會跟本機共用的目錄都不行),所以把dockerfile改了一下就可以使用。
:::
把新建的docker image用singularity pull下來之後可以使用 檔案沒有蓋掉但存放在/etc/profile的PATH路徑必須在開啟容器後重新source一遍才能吃到
測試流程:

完成後查看

確實可以執行
>之前在寫--writable-tmpfs時曾出現沒有mksquashfs的問題
>但在下載squashfs-tools後解決[color=yellow]
## 3/19
>當日工作表[name=Lee][time=Fri, Mar 18, 2021][color=red]
lammps的task/submissions

如果要用gpu跑要用nvidia docker
[安裝 NVIDIA Docker 2 來讓容器使用 GPU ](https://k2r2bai.com/2018/02/17/container/nvidia-docker-install/)
[在 Docker Container 裡使用 GPU Resource](https://ithelp.ithome.com.tw/articles/10195029)
[NVIDIA Container Toolkit](https://github.com/NVIDIA/nvidia-docker)
### lammps CPU效能VS GPU效能
官方提供
[LAMMPS Benchmarks ](https://lammps.sandia.gov/bench.html#accelerator)
[Install of GPU package for LAMMPS](https://zhuanlan.zhihu.com/p/32648883)
## 3/23-24
>當日工作表[name=Lee][time=Wed, Mar 23, 2021][color=red]
HPCG測試成功->依據[HPCG安裝](https://hackmd.io/@tings0802/test2_02#HPCG)(使用mpich3)
寫dockerfile
->成功但有問題(mpi為openmpi 4.1.0

使用mpich出現的問題

## 3/25
>當日工作表[name=Lee][time=Tue, Mar 25, 2021][color=red]
:::warning
幹咧媽的早就裝好了
xhpcg的執行檔在build裡面
直接浪費一天 機掰
:::
[dockerfile](https://hackmd.io/CrQltgCUSN-iM4063rgZlA#dockerfile)
## 3/26
用singularity成功開啟hpcg
## 3/27
裝HPCC 阿嘗試用[上一屆安裝方法一](https://hackmd.io/@tings0802/test2_02#HPCC)沒辦法用yum安裝atlas3-base
參考[並行程式設計——HPCC效能測試branchmark](https://tw511.com/a/01/13699.html)
其中修改Make.Linux的檔案說明如下
```
MPdir = /home/andywang/mpich-install //本機安裝mpi的位置
MPinc = -I$(MPdir)/include //mpi標頭檔案所在的位置
MPlib = $(MPdir)/lib/libmpi.a //mpi靜態庫所在的位置
LAdir = $(HOME)/clapack/lib //blas所在的位置
LAinc = //HPCC沒有用到blas標頭檔案,可以空著
LAlib = $(LAdir)/blas_LINUX.a $(LAdir)/lapack_LINUX.a $(LAdir)/libf2c.a
LINKER = $(CC)
```
## 3/29
yum atlas的package名稱就是直接 `yum install -y atlas`
函式庫說明
[Linux 的 .a / .so / .la 函式庫的差異](https://blog.longwin.com.tw/2013/03/linux-a-so-la-library-diff-2013/)
[動靜態函式庫_WIKI](https://zh.wikipedia.org/wiki/%E9%9D%99%E6%80%81%E5%BA%93)
安裝測試成功
用上面的方法裝 只是改LAdir那邊的位置
## 3/30
hpcc dockerfile
有遇到以下問題 https://www.tecmint.com/fix-cannot-find-a-valid-baseurl-for-repo/
其他問題[error: C++ preprocessor "/lib/cpp" fails sanity check錯誤解決方法](https://www.itread01.com/content/1531400527.html)
完成執行出現以下問題

## 3/31
如果yum groupinstall -y 'Development tool'
就不會出現上面的問題且可以執行 但我不知道為什麼
:::success
結論:只多下載rsh可行
:::
## 4/1
重灌A01~A04
NFS
## 4/4
[PBS 排程及COMET Linux 系統架構](http://web.che.ntu.edu.tw/stlin/freshman/pbsskill)
[PBS(Portable Batch System)系統效調細節筆記:使用叢集係統來做百萬級抗原變異點的預測 ](https://weitinglin.com/2017/06/24/pbsportable-batch-system%E7%B3%BB%E7%B5%B1%E6%95%88%E8%AA%BF%E7%B4%B0%E7%AF%80%E7%AD%86%E8%A8%98%EF%BC%9A%E4%BD%BF%E7%94%A8%E5%8F%A2%E9%9B%86%E4%BF%82%E7%B5%B1%E4%BE%86%E5%81%9A%E7%99%BE%E8%90%AC/)
[Cluster Leopard 2.0](http://leopard.mcl.math.ncu.edu.tw/usage.xhtml)
[PBS Pro Installation Note](https://medium.com/@coldsleep/pbs-pro-installation-note-f737951fb014)
[PBS 命令与使用 - Unix/Linux - 一夜孤城](http://www.360doc.com/content/11/0225/09/4182758_95923140.shtml)
## 4/6
PBS
在自己的模擬機上測試
出現以下狀況

參考[Qstat: cannot connect to server (Single node cluster)](https://community.openpbs.org/t/qstat-cannot-connect-to-server-single-node-cluster/1504)
-> loopback address v.s. non-loopbakc address
之後須著重參考
[PBS Pro Installation Note](https://medium.com/@coldsleep/pbs-pro-installation-note-f737951fb014)
[上一屆PBS安裝說明](https://hackmd.io/7S7u5jh5RXOc3hEHS8VOfA#PBS-pro)
## 4/8
參照[PBS Pro Installation Note](https://medium.com/@coldsleep/pbs-pro-installation-note-f737951fb014)安裝
pbs 安裝出現問題

參考 https://community.openpbs.org/t/problem-starting-pbs-server/1053/2 沒用
另參考 https://openpbs.atlassian.net/browse/PP-1284
:::warning
看起來是版本問題:fire: 9.2.* 的版本不可行
:::
另參考 [安裝 PostgreSQL 資料庫](https://blog.gtwang.org/linux/centos-linux-install-postgresql-database-tutorial/)
## 4/9
參考[PostgreSQL的安裝和卸載,遠程連接](https://www.twblogs.net/a/5e9162babd9eee3420901548)
大約過程
找psql版本
```
rpm -qa | grep postgresql
```

然後把9.2.24的都刪掉 用`rpm -e`
把11的裝起來
```
# 下載 PostgreSQL 套件庫資訊
wget https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
# 安裝 PostgreSQL 套件庫資訊與 EPEL
sudo yum install pgdg-redhat-repo-latest.noarch.rpm epel-release
```
[CentOS Linux 安裝 PostgreSQL 資料庫教學](https://blog.gtwang.org/linux/centos-linux-install-postgresql-database-tutorial/)
然後就下載11的(反正就照網站裡的)
裝完後

要先`export PATH=$PATH:/usr/pgsql-11/bin`
然後`/opt/pbs/libexec/pbs_habitat`

用 service pbs start就不行 幹
用原始執行檔`/etc/init.d/pbs start`成功
## 4/11-12
pbs script
[PBS Scripting Guide ](https://docs.pace.gatech.edu/software/PBS_script_guide/)
[Creating a PBS script](http://latisresearch.umn.edu/creating-a-PBS-script)
[Portable Batch System (PBS): Overview](https://www.nas.nasa.gov/hecc/support/kb/portable-batch-system-(pbs)-overview_126.html)
[pbs絕對正確的教學,保證一看就會,手把手教學](https://memes.tw/user-gif/a2cc82a36c9dd92e62a356de9d17901d.gif)
## 4/13
coding challange
## 4/14
NFS
## 4/15
繼續他媽的PBS 有跑起來但是沒跑出結果
http://cypresslin.web.fc2.com/Memo/M-LinuxHPC.html
https://www.nas.nasa.gov/hecc/support/kb/avoiding-job-failure-from-overfilling-pbsspool_183.html
https://www.nas.nasa.gov/hecc/support/kb/avoiding-job-failure-from-overfilling-pbsspool_183.html
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/qsub.html
https://www.cup.uni-muenchen.de/ch/compchem/basic/pbsinfo.html
https://kevinzjy.github.io/2018/08/13/180813-Server-PBS/
https://serverfault.com/questions/510455/i-get-the-error-qsub-bad-uid-for-job-execution-when-trying-to-submit-a-job-via
http://docs.adaptivecomputing.com/torque/4-1-3/Content/topics/commands/qstat.htm
https://www.nas.nasa.gov/hecc/support/kb/common-reasons-why-jobs-wont-start_198.html
## 4/16
弄要給川川的報告(浪費時間です
## 4/19
PBS 大概找到原因
user權限下沒有SSH免密碼
## 4/20
好 問題不是出在那(也是在那)
### 幹找到了 一樣是權限問題 需要改資料夾權限讓客戶端可以讀寫 也需要user SSH啦
```
chmod 777 /pwd
```
## 4/21-25
lammps gpu package
## 4/29
wtf國網

## 4/30
一樣國網問題 似乎無法解決
[Singularity support](https://github.com/Chaste/chaste-docker/issues/4)
## 5/3
:::success
國網測試成功ㄅ
:::
## 5/4
台灣杉1號
## 5/10
lammps
## 5/15~
lammps 參數