Instinkt的个人博客分享 http://blog.sciencenet.cn/u/Instinkt

博文

Linux下gromacs设置线程绑定逻辑核心

已有 4257 次阅读 2020-11-10 19:51 |系统分类:科研笔记

今天在ubuntu 18.04下直接跑三个gromacs,提示如下

NOTE: The number of threads is not equal to the number of (logical) cores
      and the -pin option is set to auto: will not pin threads to cores.
      This can lead to significant performance degradation.
      Consider using -pin on (and -pinoffset in case you run multiple jobs).

说明三个进程互相干扰了,需要在gromacs层面设置一下,因为有时候taskset是无效的


首先查看一下到底有几个core(核)

$cat /proc/cpuinfo| grep "cpu cores"| uniq
cpu cores	: 32

32个核


再看一下线程数

cat /proc/cpuinfo| grep "processor"| wc -l
64


设置-pin on可以让gmx自己绑定到固定的逻辑核心上,不过多个gmx进程需要指定一下,用-pinofffset 将第一个线程关联到某个编号的逻辑核心。这样不同的mdrun实例可以区分开。

-pinstride可以设置逻辑核心中线程的关联距离,默认为0不用修改

运行如下

gmx_mpi mdrun -deffnm npt-1 -ntomp 24 -nb gpu -pme gpu -bonded cpu -pin on -pinoffset 1

从cpu编号1起始,24个逻辑核心绑定

然后还可以吧这个进程设置成高优先度。

多个mdrun最好指定不同的GPU

-gpu_id 可使用的GPU ID列表

然后根据cpu和gpu的比例通过-nb -pme和-bonded三个选项指定三种相互作用计算的设备,如果这个mdrun

实例有独立的gpu使用,按照如上设置 -nb gpu -pme gpu -bonded cpu速度最好,前提是你的显卡还过得去。




https://blog.sciencenet.cn/blog-3341717-1257862.html

上一篇:autodock vina 从安装到分子对接
下一篇:WordPress中插入酷炫的鼠标特效代码
收藏 IP: 120.236.162.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...
扫一扫,分享此博文

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-4-27 11:27

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部