计算化学公社

标题: 运行gmx时如何指定GPU [打印本页]

作者
Author:
xpyp    时间: 2018-4-4 15:04
标题: 运行gmx时如何指定GPU
一台服务器里装了两块GPU, 跑gmx时能否指定用其中的一块GPU ?


作者
Author:
laoman    时间: 2018-4-4 19:01
以下是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开始
作者
Author:
tomwong4253    时间: 2018-4-10 21:26
-gpu_id <string>
     List of GPU device id-s to use, specifies the per-node PP rank to GPU

这么明显的提示都没看到啊
作者
Author:
lonemen    时间: 2018-5-31 09:33
那请问能够不是用gpu吗?应该如何使用命令控制?谢谢!
作者
Author:
syjohn    时间: 2018-5-31 17:41
lonemen 发表于 2018-5-31 09:33
那请问能够不是用gpu吗?应该如何使用命令控制?谢谢!

你的意思是不使用GPU?
如果是这样的话 命令后面加 -nb cpu
作者
Author:
sobereva    时间: 2018-5-31 17:43
lonemen 发表于 2018-5-31 09:33
那请问能够不是用gpu吗?应该如何使用命令控制?谢谢!

编译一个非GPU版,不用GPU就调用那个就完了
作者
Author:
lonemen    时间: 2018-6-5 08:43
sobereva 发表于 2018-5-31 17:43
编译一个非GPU版,不用GPU就调用那个就完了

谢谢sob!本来想偷懒来着,看来还是再编译一个才妥当。
作者
Author:
lonemen    时间: 2018-6-5 08:55
syjohn 发表于 2018-5-31 17:41
你的意思是不使用GPU?
如果是这样的话 命令后面加 -nb cpu

好的,谢谢指点!我去试试看。
作者
Author:
user0203    时间: 2024-7-30 09:40
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
作者
Author:
Santz    时间: 2024-7-30 10:53
user0203 发表于 2024-7-30 09:40
你好,请问你用这个指令能成功指定节点吗?我按照该指令提交会报以下错误

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

作者
Author:
user0203    时间: 2024-7-30 14:33
Santz 发表于 2024-7-30 10:53
你这个命令简直写得一塌糊涂。看命令的用法啊,-nb 后接个参数,还有-gpu_5 这是什么写法?

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




欢迎光临 计算化学公社 (http://bbs.keinsci.com/) Powered by Discuz! X3.3