阿里云
订阅广场
发表主题 回复主题
  • 215阅读
  • 1回复

[干货分享]实践GROMACS

级别: 论坛粉丝
发帖
1227
云币
2325
CaL\fZ  
GROMACS 简介 @>p<3_Y1  
fZ*+2T>  
!4^C #{$  
GROMACS(GROningen MAchine for Chemical Simulations)是一款通用软件包,用于对具有数百万颗粒子的系统进行基于牛顿运动方程的分子动力学模拟。GROMACS主要用于生物化学分子,如蛋白质,脂质等具有多种复杂键合相互作用的核酸。由于GROMACS在计算典型的主流模拟应用如非键合相互作用非常高效,许多研究人员将其用于非生物系统如聚合物的研究。 6"~P/\jP  
GROMACS支持从现代分子动力学实现中预期的所有常见算法,其代码由世界各地的开发人员维护。详情可参见官网www.gromacs.org !"\80LP  
tD+9kf2  
准备工作 Cn "s` q  
MBqt&_?K  
运行以下示例需要在创建集群时选择安装GROMACS相关软件包。
i(>4wK!!  
[backcolor=transparent]注:若需运行gromacs-gpu算例,在创建集群时[backcolor=transparent]必须使用GPU系列机型作为计算节点,否则集群创建或gromacs-gpu无法按照以下指引运行。 FQqI<6;  
同时还需选择所依赖的相关MPI库
&o,<ijJ:^m  
#MRMNL@   
运行算例 hRK/T7v  
[backcolor=transparent]注意:运行算例前务必做好提交作业中准备工作部分的操作 MP!d4  
nv@8tdrc  
GROMACS 算例1:水中的溶菌酶(Lysozyme in Water) fSs4ZXC  
(=* cK-3  
yuat" Pg  
本样例为用户设置一个蛋白质(lysozyme)加上离子在水盒子里的模拟过程。 Ry%Mej:  
官方教程链接:http://www.bevanlab.biochem.vt.edu/Pages/Personal/justin/gmx-tutorials/lysozyme/index.html rEv$+pP  
非官方中文翻译链接:http://jerkwin.github.io/GMX/GMXtut-1/ PfC!lI BU  
rvXWcu-"  
下载地址 _Ou WB"  
http://public-ehs.oss-cn-hangzhou.aliyuncs.com/packages/Lysozyme.tar.gz t.`@{R$hoA  
*=+td)S/1  
运行步骤 %*`J k#W:  
a. 串行版本$ ./serial_run.sh uF1~FKB  
b. 并行版本$ ./parallel_run.sh \E% 'Y  
j^^Ap  
GROMACS算例2:水分子运动 2JJ"O|Ibz  
本算例为模拟大量水分子在给定空间、温度内的运动过程,以下运行实例为GPU加速版。 5[* qi?w=  
& 8l%T'gd  
运行步骤 = c>Qx"Sw  
  • 设置环境变量,运行module avail 查看是否安装GROMACS 软件。
  1. [backcolor=transparent]$ export MODULEPATH[backcolor=transparent]=/[backcolor=transparent]opt[backcolor=transparent]/[backcolor=transparent]ehpcmodulefiles[backcolor=transparent]/[backcolor=transparent]   [backcolor=transparent]# module命令依赖的环境变量
  2. [backcolor=transparent]$ module avail
  3. [backcolor=transparent]------------------------------[backcolor=transparent] [backcolor=transparent]/[backcolor=transparent]opt[backcolor=transparent]/[backcolor=transparent]ehpcmodulefiles [backcolor=transparent]-------------------------------------
  4. [backcolor=transparent]gromacs[backcolor=transparent]-[backcolor=transparent]gpu[backcolor=transparent]/[backcolor=transparent]2016.3[backcolor=transparent]      openmpi[backcolor=transparent]/[backcolor=transparent]1.10[backcolor=transparent].[backcolor=transparent]7
  • 运行 module load 加载 GROMACS,OpenMPI。
  1. [backcolor=transparent]$ module load openmpi
  2. [backcolor=transparent]$ module load gromacs[backcolor=transparent]-[backcolor=transparent]gpu
  3. [backcolor=transparent]$ which gmx_mpi
  4. [backcolor=transparent]/[backcolor=transparent]opt[backcolor=transparent]/[backcolor=transparent]gromacs[backcolor=transparent]-[backcolor=transparent]gpu[backcolor=transparent]/[backcolor=transparent]2016.3[backcolor=transparent]/[backcolor=transparent]bin[backcolor=transparent]/[backcolor=transparent]gmx_mpi
  • 下载water算例
;9#Z@]p  
假设当前目录在当前用户的$HOME下面
  1. [backcolor=transparent]$ pwd
  2. [backcolor=transparent]/[backcolor=transparent]home[backcolor=transparent]/<[backcolor=transparent]current_user_name[backcolor=transparent]>
  3. [backcolor=transparent]$ wget http[backcolor=transparent]://[backcolor=transparent]public[backcolor=transparent]-[backcolor=transparent]ehs[backcolor=transparent].[backcolor=transparent]oss[backcolor=transparent]-[backcolor=transparent]cn[backcolor=transparent]-[backcolor=transparent]hangzhou[backcolor=transparent].[backcolor=transparent]aliyuncs[backcolor=transparent].[backcolor=transparent]com[backcolor=transparent]/[backcolor=transparent]packages[backcolor=transparent]/[backcolor=transparent]water_GMX50_bare[backcolor=transparent].[backcolor=transparent]tar[backcolor=transparent].[backcolor=transparent]gz
  4. [backcolor=transparent]$ tar xzvf water_GMX50_bare[backcolor=transparent].[backcolor=transparent]tar[backcolor=transparent].[backcolor=transparent]gz
  • &Nczv"TM  
    提交PBS作业运行water算例。高配置计算节点(>32 CPU核,双GPU卡)的PBS作业脚本
  1. [backcolor=transparent]$ cat [backcolor=transparent]>[backcolor=transparent] gromacs_single_node[backcolor=transparent].[backcolor=transparent]pbs
  2. [backcolor=transparent]#!/bin/sh
  3. [backcolor=transparent]#PBS -l ncpus=32,mem=4gb
  4. [backcolor=transparent]#PBS -l walltime=00:20:00
  5. [backcolor=transparent]#PBS -o gromacs_gpu_pbs.log
  6. [backcolor=transparent]#PBS -j oe
  7. [backcolor=transparent]cd [backcolor=transparent]/[backcolor=transparent]home[backcolor=transparent]/[backcolor=transparent]water[backcolor=transparent]-[backcolor=transparent]cut1[backcolor=transparent].[backcolor=transparent]0[backcolor=transparent]_GMX50_bare[backcolor=transparent]/[backcolor=transparent]1536
  8. [backcolor=transparent]/[backcolor=transparent]opt[backcolor=transparent]/[backcolor=transparent]gromacs[backcolor=transparent]-[backcolor=transparent]gpu[backcolor=transparent]/[backcolor=transparent]2016.3[backcolor=transparent]/[backcolor=transparent]bin[backcolor=transparent]/[backcolor=transparent]gmx_mpi grompp [backcolor=transparent]-[backcolor=transparent]f pme[backcolor=transparent].[backcolor=transparent]mdp [backcolor=transparent]-[backcolor=transparent]c conf[backcolor=transparent].[backcolor=transparent]gro [backcolor=transparent]-[backcolor=transparent]p topol[backcolor=transparent].[backcolor=transparent]top [backcolor=transparent]-[backcolor=transparent]o topol_pme[backcolor=transparent].[backcolor=transparent]tpr
  9. [backcolor=transparent]/[backcolor=transparent]opt[backcolor=transparent]/[backcolor=transparent]openmpi[backcolor=transparent]/[backcolor=transparent]1.10[backcolor=transparent].[backcolor=transparent]7[backcolor=transparent]/[backcolor=transparent]bin[backcolor=transparent]/[backcolor=transparent]mpirun [backcolor=transparent]-[backcolor=transparent]np [backcolor=transparent]4[backcolor=transparent] [backcolor=transparent]/[backcolor=transparent]opt[backcolor=transparent]/[backcolor=transparent]gromacs[backcolor=transparent]-[backcolor=transparent]gpu[backcolor=transparent]/[backcolor=transparent]2016.3[backcolor=transparent]/[backcolor=transparent]bin[backcolor=transparent]/[backcolor=transparent]gmx_mpi mdrun [backcolor=transparent]-[backcolor=transparent]ntomp [backcolor=transparent]8[backcolor=transparent] [backcolor=transparent]-[backcolor=transparent]resethway [backcolor=transparent]-[backcolor=transparent]noconfout [backcolor=transparent]-[backcolor=transparent]nsteps [backcolor=transparent]8000[backcolor=transparent] [backcolor=transparent]-[backcolor=transparent]v [backcolor=transparent]-[backcolor=transparent]pin on [backcolor=transparent]-[backcolor=transparent]nb gpu [backcolor=transparent]-[backcolor=transparent]gpu_id [backcolor=transparent]0011[backcolor=transparent] [backcolor=transparent]-[backcolor=transparent]s topol_pme[backcolor=transparent].[backcolor=transparent]tpr
  • 较低配置节点的PBS作业脚本
  1. [backcolor=transparent]$ cat [backcolor=transparent]>[backcolor=transparent] gromacs_single_node[backcolor=transparent].[backcolor=transparent]pbs
  2. [backcolor=transparent]#!/bin/sh
  3. [backcolor=transparent]#PBS -l ncpus=4,mem=4gb
  4. [backcolor=transparent]#PBS -l walltime=00:20:00
  5. [backcolor=transparent]#PBS -o gromacs_gpu_pbs.log
  6. [backcolor=transparent]#PBS -j oe
  7. [backcolor=transparent]cd [backcolor=transparent]/[backcolor=transparent]home[backcolor=transparent]/[backcolor=transparent]water[backcolor=transparent]-[backcolor=transparent]cut1[backcolor=transparent].[backcolor=transparent]0[backcolor=transparent]_GMX50_bare[backcolor=transparent]/[backcolor=transparent]1536
  8. [backcolor=transparent]/[backcolor=transparent]opt[backcolor=transparent]/[backcolor=transparent]gromacs[backcolor=transparent]-[backcolor=transparent]gpu[backcolor=transparent]/[backcolor=transparent]2016.3[backcolor=transparent]/[backcolor=transparent]bin[backcolor=transparent]/[backcolor=transparent]gmx_mpi grompp [backcolor=transparent]-[backcolor=transparent]f pme[backcolor=transparent].[backcolor=transparent]mdp [backcolor=transparent]-[backcolor=transparent]c conf[backcolor=transparent].[backcolor=transparent]gro [backcolor=transparent]-[backcolor=transparent]p topol[backcolor=transparent].[backcolor=transparent]top [backcolor=transparent]-[backcolor=transparent]o topol_pme[backcolor=transparent].[backcolor=transparent]tpr
  9. [backcolor=transparent]/[backcolor=transparent]opt[backcolor=transparent]/[backcolor=transparent]openmpi[backcolor=transparent]/[backcolor=transparent]1.10[backcolor=transparent].[backcolor=transparent]7[backcolor=transparent]/[backcolor=transparent]bin[backcolor=transparent]/[backcolor=transparent]mpirun [backcolor=transparent]-[backcolor=transparent]np [backcolor=transparent]1[backcolor=transparent] [backcolor=transparent]/[backcolor=transparent]opt[backcolor=transparent]/[backcolor=transparent]gromacs[backcolor=transparent]-[backcolor=transparent]gpu[backcolor=transparent]/[backcolor=transparent]2016.3[backcolor=transparent]/[backcolor=transparent]bin[backcolor=transparent]/[backcolor=transparent]gmx_mpi mdrun [backcolor=transparent]-[backcolor=transparent]ntomp [backcolor=transparent]4[backcolor=transparent] [backcolor=transparent]-[backcolor=transparent]resethway [backcolor=transparent]-[backcolor=transparent]noconfout [backcolor=transparent]-[backcolor=transparent]nsteps [backcolor=transparent]8000[backcolor=transparent] [backcolor=transparent]-[backcolor=transparent]v [backcolor=transparent]-[backcolor=transparent]pin on [backcolor=transparent]-[backcolor=transparent]nb gpu [backcolor=transparent]-[backcolor=transparent]s topol_pme[backcolor=transparent].[backcolor=transparent]tpr
  • 通过PBS作业脚本提交作业
  1. [backcolor=transparent]$ qsub gromacs_single_node[backcolor=transparent].[backcolor=transparent]pbs
  2. [backcolor=transparent]1.iZ2zedptfv8e8dc9c2zt0tZ
  3. [backcolor=transparent]$ qstat
  4. [backcolor=transparent]                                                            [backcolor=transparent]Req[backcolor=transparent]'d  Req'[backcolor=transparent]d   [backcolor=transparent]Elap
  5. [backcolor=transparent]Job[backcolor=transparent] ID          [backcolor=transparent]Username[backcolor=transparent] [backcolor=transparent]Queue[backcolor=transparent]    [backcolor=transparent]Jobname[backcolor=transparent]    [backcolor=transparent]SessID[backcolor=transparent] NDS TSK [backcolor=transparent]Memory[backcolor=transparent] [backcolor=transparent]Time[backcolor=transparent]  S [backcolor=transparent]Time
  6. [backcolor=transparent]---------------[backcolor=transparent] [backcolor=transparent]--------[backcolor=transparent] [backcolor=transparent]--------[backcolor=transparent] [backcolor=transparent]----------[backcolor=transparent] [backcolor=transparent]------[backcolor=transparent] [backcolor=transparent]---[backcolor=transparent] [backcolor=transparent]---[backcolor=transparent] [backcolor=transparent]------[backcolor=transparent] [backcolor=transparent]-----[backcolor=transparent] [backcolor=transparent]-[backcolor=transparent] [backcolor=transparent]-----
  7. [backcolor=transparent]1.iZ2zedptfv8e8[backcolor=transparent] mingying workq    gromacs_si  [backcolor=transparent]20775[backcolor=transparent]   [backcolor=transparent]1[backcolor=transparent]   [backcolor=transparent]4[backcolor=transparent]    [backcolor=transparent]4gb[backcolor=transparent] [backcolor=transparent]00[backcolor=transparent]:[backcolor=transparent]20[backcolor=transparent] R [backcolor=transparent]00[backcolor=transparent]:[backcolor=transparent]03
RV5n,J  
[ 此帖被反向一觉在2017-10-26 13:54重新编辑 ]
级别: 新人
发帖
1
云币
1
只看该作者 沙发  发表于: 01-01
Re实践GROMACS
这个实例购买位置在哪儿?
发表主题 回复主题
« 返回列表上一主题下一主题

限100 字节
如果您在写长篇帖子又不马上发表,建议存为草稿
 
验证问题: 阿里云官网域名是什么? 正确答案:www.aliyun.com
上一个 下一个