阿里云
技术周刊订阅频道
发表主题 回复主题
  • 583阅读
  • 1回复

[干货分享]实践GROMACS

级别: 论坛粉丝
发帖
1227
云币
2325
Q{y{rC2P  
GROMACS 简介 6X_\Ve  
AEg(m<t  
EX "|H.(  
GROMACS(GROningen MAchine for Chemical Simulations)是一款通用软件包,用于对具有数百万颗粒子的系统进行基于牛顿运动方程的分子动力学模拟。GROMACS主要用于生物化学分子,如蛋白质,脂质等具有多种复杂键合相互作用的核酸。由于GROMACS在计算典型的主流模拟应用如非键合相互作用非常高效,许多研究人员将其用于非生物系统如聚合物的研究。 !:0v{ZQ  
GROMACS支持从现代分子动力学实现中预期的所有常见算法,其代码由世界各地的开发人员维护。详情可参见官网www.gromacs.org 4s.]M>Yb  
w{,4rk;Hr  
准备工作 ?M}S| dsmE  
Hfc"L>  
运行以下示例需要在创建集群时选择安装GROMACS相关软件包。
k$"d^*R  
[backcolor=transparent]注:若需运行gromacs-gpu算例,在创建集群时[backcolor=transparent]必须使用GPU系列机型作为计算节点,否则集群创建或gromacs-gpu无法按照以下指引运行。 \8v91g91f  
同时还需选择所依赖的相关MPI库
Fo|xzLm9*|  
Q!'qC*Gyfn  
运行算例 MDO$m g  
[backcolor=transparent]注意:运行算例前务必做好提交作业中准备工作部分的操作 }DjYGMrTB  
"@ E3MTW  
GROMACS 算例1:水中的溶菌酶(Lysozyme in Water) FxW&8 9G  
raUs%Y3  
lK(Fg  
本样例为用户设置一个蛋白质(lysozyme)加上离子在水盒子里的模拟过程。 Y`ihi,s`H  
官方教程链接:http://www.bevanlab.biochem.vt.edu/Pages/Personal/justin/gmx-tutorials/lysozyme/index.html WZewPn>#q  
非官方中文翻译链接:http://jerkwin.github.io/GMX/GMXtut-1/ ?=On%bh  
c$H+g,7xQ-  
下载地址 EU+cca|qS9  
http://public-ehs.oss-cn-hangzhou.aliyuncs.com/packages/Lysozyme.tar.gz M"Y0jQ(  
= !2NU  
运行步骤 7&%^>PU7  
a. 串行版本$ ./serial_run.sh mOBACTY^  
b. 并行版本$ ./parallel_run.sh K~6e5D7.  
4_=Ja2v8;`  
GROMACS算例2:水分子运动 MQTdk*L_]  
本算例为模拟大量水分子在给定空间、温度内的运动过程,以下运行实例为GPU加速版。 '\7G@g?UZ  
i'HQQWd  
运行步骤 OSDy'@   
  • 设置环境变量,运行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算例
;y>a nE}n{  
假设当前目录在当前用户的$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
  • ;`j/D@H  
    提交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
1=VJ&D;  
[ 此帖被反向一觉在2017-10-26 13:54重新编辑 ]
级别: 新人
发帖
1
云币
1
只看该作者 沙发  发表于: 01-01
Re实践GROMACS
这个实例购买位置在哪儿?
发表主题 回复主题
« 返回列表上一主题下一主题

限100 字节
批量上传需要先选择文件,再选择上传
 
验证问题: ECS是阿里云提供的什么服务? 正确答案:云服务器
上一个 下一个