|
本帖最后由 papercup 于 2023-6-4 23:11 编辑
请教各位老师们和各位高手们,如果运行GROMACS以GPU跑MD时,出现以下提示,是否有必要修改,使thread能pin到CPU core上(来进一步提速)呢?
(目前GPU利用率约为70%~80%)
如果有必要,应当如何做出修改呢?
例如,我通过下列命令运行GROMACS跑PROD阶段MD:
- Command line:
- gmx mdrun -ntmpi 1 -pin on -v -stepout 1000 -s prod.tpr -deffnm prod -c prod.pdb -nb gpu -pme gpu -pmefft gpu -bonded gpu -update gpu
复制代码
程序会出现下述提示:
- Using 1 MPI thread
- Using 20 OpenMP threads
- NOTE: OS CPU limit is lower than logical cpu count, thread pinning disabled.
- starting mdrun 'Protein in water'
复制代码
我谷歌了这句话(NOTE: OS CPU limit is lower than logical cpu count, thread pinning disabled.),并没有搜到讨论,于是只好去看看GROMACS提示这句话的源代码:
https://github.com/gromacs/groma ... adaffinity.cpp#L183
注释里写道:
- // Don't pin on things that look like containers with shared resources
- // where we are limited to only using a fraction of them
复制代码
好像大概是在说,GROMACS发现我好像在一个container里,于是就不把thread给pin到cpu core上了。
以及代码中的判断条件是:hwMaxThreads小于hwTop.machine().logicalProcessors.size()。
我确实是在一个GPU服务器的container里跑MD的,那我是否还有必要把thread给pin到cpu core上呢?如果有必要,应当如何操作呢?
看着代码判断条件的大意,我尝试修改了环境变量:
- OMP_THREAD_LIMIT="200"
- OMP_NUM_THREADS="200"
复制代码
但并无效果,新的程序提示如下,可以看到因为环境变量的生效,thread数量增大到了128,可是还是没能通过pin的判断条件。
- 2023-06-04 22:02:13.300 Using 1 MPI thread
- 2023-06-04 22:02:13.300 Using 128 OpenMP threads
- 2023-06-04 22:02:13.300 WARNING: Oversubscribing the recommended max load of 20 logical CPUs with 128 threads.
- 2023-06-04 22:02:13.300 This will cause considerable performance loss.
- 2023-06-04 22:02:13.300 NOTE: OS CPU limit is lower than logical cpu count, thread pinning disabled.
复制代码
虽然现在GPU利用率看上去还可以(约70%~80%),但我还是想把thread给pin到CPU core上,看看是否能进一步提速。
请教各位老师们这是否有必要呢?如有必要又应如何操作呢?
|
|