计算化学公社

 找回密码 Forget password
 注册 Register
Views: 17275|回复 Reply: 10
打印 Print 上一主题 Last thread 下一主题 Next thread

[GROMACS] 运行gmx时如何指定GPU

[复制链接 Copy URL]

157

帖子

0

威望

4349

eV
积分
4506

Level 6 (一方通行)

一台服务器里装了两块GPU, 跑gmx时能否指定用其中的一块GPU ?

143

帖子

3

威望

4430

eV
积分
4633

Level 6 (一方通行)

2#
发表于 Post on 2018-4-4 19:01:25 | 只看该作者 Only view this author
以下是gmx_mpi mdrun -h的部分输出:
OPTIONS

Options to specify input and output files:

-s     [<.tpr/.tpb/...>] (topol.tpr) (Input) Run input file: tpr tpb tpa
-o     [<.trr/.cpt/...>] (traj.trr) (Output)
     Full precision trajectory: trr cpt trj tng
-x     [<.xtc/.tng>] (traj_comp.xtc) (Output, Opt.)
     Compressed trajectory (tng format or portable xdr format)
-cpi   [<.cpt>] (state.cpt) (Input, Opt.) Checkpoint file
-cpo   [<.cpt>] (state.cpt) (Output, Opt.) Checkpoint file
-c     [<.gro/.g96/...>] (confout.gro) (Output)
     Structure file: gro g96 pdb brk ent esp
-e     [<.edr>] (ener.edr) (Output) Energy file
-g     [<.log>] (md.log) (Output) Log file
-dhdl  [<.xvg>] (dhdl.xvg) (Output, Opt.) xvgr/xmgr file
-field [<.xvg>] (field.xvg) (Output, Opt.) xvgr/xmgr file
-table [<.xvg>] (table.xvg) (Input, Opt.) xvgr/xmgr file
-tabletf [<.xvg>] (tabletf.xvg) (Input, Opt.) xvgr/xmgr file
-tablep [<.xvg>] (tablep.xvg) (Input, Opt.) xvgr/xmgr file
-tableb [<.xvg>] (table.xvg) (Input, Opt.) xvgr/xmgr file
-rerun [<.xtc/.trr/...>] (rerun.xtc) (Input, Opt.)
     Trajectory: xtc trr cpt trj gro g96 pdb tng
-tpi   [<.xvg>] (tpi.xvg) (Output, Opt.) xvgr/xmgr file
-tpid  [<.xvg>] (tpidist.xvg) (Output, Opt.) xvgr/xmgr file
-ei    [<.edi>] (sam.edi) (Input, Opt.) ED sampling input
-eo    [<.xvg>] (edsam.xvg) (Output, Opt.) xvgr/xmgr file
-devout [<.xvg>] (deviatie.xvg) (Output, Opt.) xvgr/xmgr file
-runav [<.xvg>] (runaver.xvg) (Output, Opt.) xvgr/xmgr file
-px    [<.xvg>] (pullx.xvg) (Output, Opt.) xvgr/xmgr file
-pf    [<.xvg>] (pullf.xvg) (Output, Opt.) xvgr/xmgr file
-ro    [<.xvg>] (rotation.xvg) (Output, Opt.) xvgr/xmgr file
-ra    [<.log>] (rotangles.log) (Output, Opt.) Log file
-rs    [<.log>] (rotslabs.log) (Output, Opt.) Log file
-rt    [<.log>] (rottorque.log) (Output, Opt.) Log file
-mtx   [<.mtx>] (nm.mtx) (Output, Opt.) Hessian matrix
-dn    [<.ndx>] (dipole.ndx) (Output, Opt.) Index file
-multidir [<dir> [...]] (rundir) (Input, Opt.) Run directory
-membed [<.dat>] (membed.dat) (Input, Opt.) Generic data file
-mp    [<.top>] (membed.top) (Input, Opt.) Topology file
-mn    [<.ndx>] (membed.ndx) (Input, Opt.) Index file
-if    [<.xvg>] (imdforces.xvg) (Output, Opt.) xvgr/xmgr file
-swap  [<.xvg>] (swapions.xvg) (Output, Opt.) xvgr/xmgr file

Other options:

-nice  <int>    (0)        Set the nicelevel
-deffnm <string>           Set the default filename for all file options
-xvg   <enum>   (xmgrace)  xvg plot formatting: xmgrace, xmgr, none
-dd    <vector> (0 0 0)    Domain decomposition grid, 0 is optimize
-ddorder <enum> (interleave) DD rank order: interleave, pp_pme, cartesian
-npme  <int>    (-1)
     Number of separate ranks to be used for PME, -1 is guess
-nt    <int>    (0)        Total number of threads to start (0 is guess)
-ntmpi <int>    (0)        Number of thread-MPI threads to start (0 is guess)
-ntomp <int>    (0)
     Number of OpenMP threads per MPI rank to start (0 is guess)
-ntomp_pme <int> (0)
     Number of OpenMP threads per MPI rank to start (0 is -ntomp)
-pin   <enum>   (auto)     Set thread affinities: auto, on, off
-pinoffset <int> (0)
     The starting logical core number for pinning to cores; used to avoid
     pinning threads from different mdrun instances to the same core
-pinstride <int> (0)
     Pinning distance in logical cores for threads, use 0 to minimize the
     number of threads per physical core
-gpu_id <string>
     List of GPU device id-s to use, specifies the per-node PP rank to GPU
     mapping
-[no]ddcheck    (yes)      Check for all bonded interactions with DD
-rdd   <real>   (0)
     The maximum distance for bonded interactions with DD (nm), 0 is determine
     from initial coordinates
-rcon  <real>   (0)        Maximum distance for P-LINCS (nm), 0 is estimate
-dlb   <enum>   (auto)     Dynamic load balancing (with DD): auto, no, yes
-dds   <real>   (0.8)
     Fraction in (0,1) by whose reciprocal the initial DD cell size will be
     increased in order to provide a margin in which dynamic load balancing
     can act while preserving the minimum cell size.
-gcom  <int>    (-1)       Global communication frequency
-nb    <enum>   (auto)
     Calculate non-bonded interactions on: auto, cpu, gpu, gpu_cpu
-nstlist <int>  (0)
     Set nstlist when using a Verlet buffer tolerance (0 is guess)
-[no]tunepme    (yes)      Optimize PME load between PP/PME ranks or GPU/CPU
-[no]testverlet (no)       Test the Verlet non-bonded scheme
-[no]v          (no)       Be loud and noisy
-[no]compact    (yes)      Write a compact log file
-[no]seppot     (no)
     Write separate V and dVdl terms for each interaction type and rank to the
     log file(s)
-pforce <real>  (-1)       Print all forces larger than this (kJ/mol nm)
-[no]reprod     (no)
     Try to avoid optimizations that affect binary reproducibility
-cpt   <real>   (15)       Checkpoint interval (minutes)
-[no]cpnum      (no)       Keep and number checkpoint files
-[no]append     (yes)
     Append to previous output files when continuing from checkpoint instead
     of adding the simulation part number to all file names
-nsteps <int>   (-2)
     Run this number of steps, overrides .mdp file option
-maxh  <real>   (-1)       Terminate after 0.99 times this time (hours)
-multi <int>    (0)        Do multiple simulations in parallel
-replex <int>   (0)
     Attempt replica exchange periodically with this period (steps)
-nex   <int>    (0)
     Number of random exchanges to carry out each exchange interval (N^3 is
     one suggestion).  -nex zero or not specified gives neighbor replica
     exchange.
-reseed <int>   (-1)       Seed for replica exchange, -1 is generate a seed

加 -gpu_id参数,显卡的编号从0开始

162

帖子

7

威望

817

eV
积分
1119

Level 4 (黑子)

3#
发表于 Post on 2018-4-10 21:26:06 | 只看该作者 Only view this author
-gpu_id <string>
     List of GPU device id-s to use, specifies the per-node PP rank to GPU

这么明显的提示都没看到啊

245

帖子

0

威望

2723

eV
积分
2968

Level 5 (御坂)

4#
发表于 Post on 2018-5-31 09:33:18 来自手机 | 只看该作者 Only view this author
那请问能够不是用gpu吗?应该如何使用命令控制?谢谢!

45

帖子

0

威望

2797

eV
积分
2842

Level 5 (御坂)

5#
发表于 Post on 2018-5-31 17:41:35 | 只看该作者 Only view this author
lonemen 发表于 2018-5-31 09:33
那请问能够不是用gpu吗?应该如何使用命令控制?谢谢!

你的意思是不使用GPU?
如果是这样的话 命令后面加 -nb cpu

6万

帖子

99

威望

6万

eV
积分
125127

管理员

公社社长

6#
发表于 Post on 2018-5-31 17:43:29 | 只看该作者 Only view this author
lonemen 发表于 2018-5-31 09:33
那请问能够不是用gpu吗?应该如何使用命令控制?谢谢!

编译一个非GPU版,不用GPU就调用那个就完了
北京科音自然科学研究中心http://www.keinsci.com)致力于计算化学的发展和传播,长期开办极高质量的各种计算化学类培训:初级量子化学培训班中级量子化学培训班高级量子化学培训班量子化学波函数分析与Multiwfn程序培训班分子动力学与GROMACS培训班CP2K第一性原理计算培训班,内容介绍以及往届资料购买请点击相应链接查看。这些培训是计算化学从零快速入门以及进一步全面系统性提升研究水平的高速路!培训各种常见问题见《北京科音办的培训班FAQ》
欢迎加入北京科音微信公众号获取北京科音培训的最新消息,并避免错过网上有价值的计算化学文章!
欢迎加入人气极高、专业性特别强的理论与计算化学综合交流群思想家公社QQ群(群号见此链接),合计达一万多人。北京科音培训班的学员在群中可申请VIP头衔,提问将得到群主Sobereva的最优先解答。
思想家公社的门口Blog:http://sobereva.com(发布大量原创计算化学相关博文)
Multiwfn主页:http://sobereva.com/multiwfn(十分强大、极为流行的量子化学波函数分析程序)
Google Scholar:https://scholar.google.com/citations?user=tiKE0qkAAAAJ
ResearchGate:https://www.researchgate.net/profile/Tian_Lu

245

帖子

0

威望

2723

eV
积分
2968

Level 5 (御坂)

7#
发表于 Post on 2018-6-5 08:43:49 | 只看该作者 Only view this author
sobereva 发表于 2018-5-31 17:43
编译一个非GPU版,不用GPU就调用那个就完了

谢谢sob!本来想偷懒来着,看来还是再编译一个才妥当。

245

帖子

0

威望

2723

eV
积分
2968

Level 5 (御坂)

8#
发表于 Post on 2018-6-5 08:55:00 | 只看该作者 Only view this author
syjohn 发表于 2018-5-31 17:41
你的意思是不使用GPU?
如果是这样的话 命令后面加 -nb cpu

好的,谢谢指点!我去试试看。

20

帖子

0

威望

140

eV
积分
160

Level 3 能力者

9#
发表于 Post on 2024-7-30 09:40:45 | 只看该作者 Only view this author
tomwong4253 发表于 2018-4-10 21:26
-gpu_id
     List of GPU device id-s to use, specifies the per-node PP rank to GPU

你好,请问你用这个指令能成功指定节点吗?我按照该指令提交会报以下错误C:\Users\10343\Desktop\方向调研\报错记录.png

报错记录.png (22.65 KB, 下载次数 Times of downloads: 41)

报错记录.png

159

帖子

2

威望

3789

eV
积分
3988

Level 5 (御坂)

10#
发表于 Post on 2024-7-30 10:53:08 | 只看该作者 Only view this author
user0203 发表于 2024-7-30 09:40
你好,请问你用这个指令能成功指定节点吗?我按照该指令提交会报以下错误

你这个命令简直写得一塌糊涂。看命令的用法啊,-nb 后接个参数,还有-gpu_5 这是什么写法?
  1. gmx mdrun -deffnm md_0_1 -nb gpu -gpu_id 0
复制代码

20

帖子

0

威望

140

eV
积分
160

Level 3 能力者

11#
发表于 Post on 2024-7-30 14:33:59 | 只看该作者 Only view this author
Santz 发表于 2024-7-30 10:53
你这个命令简直写得一塌糊涂。看命令的用法啊,-nb 后接个参数,还有-gpu_5 这是什么写法?

是,开始上手还有很多不会,刚用你的指令已经成功交上去啦。谢谢!

本版积分规则 Credits rule

手机版 Mobile version|北京科音自然科学研究中心 Beijing Kein Research Center for Natural Sciences|京公网安备 11010502035419号|计算化学公社 — 北京科音旗下高水平计算化学交流论坛 ( 京ICP备14038949号-1 )|网站地图

GMT+8, 2026-2-19 08:31 , Processed in 0.176903 second(s), 23 queries , Gzip On.

快速回复 返回顶部 返回列表 Return to list