计算化学公社

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

[任务提交/队列管理] Slurm并行调度会把进程跑到超线程上,怎样配置?

[复制链接 Copy URL]

260

帖子

0

威望

631

eV
积分
891

Level 4 (黑子)

本帖最后由 KazusaT 于 2025-9-29 22:50 编辑

在一台双路E5 36核72线程的Ubuntu 20.04机器上尝试配置Slurm来运行QE,安装后slurm配置文件如下
  1. # slurm.conf file generated by configurator easy.html.
  2. # Put this file on all nodes of your cluster.
  3. # See the slurm.conf man page for more information.
  4. #
  5. SlurmctldHost=localhost
  6. #
  7. #MailProg=/bin/mail
  8. MpiDefault=none
  9. #MpiParams=ports=#-#
  10. ProctrackType=proctrack/cgroup
  11. ReturnToService=1
  12. SlurmctldPidFile=/var/run/slurmctld.pid
  13. #SlurmctldPort=6817
  14. SlurmdPidFile=/var/run/slurmd.pid
  15. #SlurmdPort=6818
  16. SlurmdSpoolDir=/var/spool/slurm/slurmd
  17. SlurmUser=slurm
  18. #SlurmdUser=root
  19. StateSaveLocation=/var/spool/slurm
  20. SwitchType=switch/none
  21. TaskPlugin=task/affinity
  22. #
  23. #
  24. # TIMERS
  25. #KillWait=30
  26. #MinJobAge=300
  27. #SlurmctldTimeout=120
  28. #SlurmdTimeout=300
  29. #
  30. #
  31. # SCHEDULING
  32. SchedulerType=sched/backfill
  33. SelectType=select/cons_tres
  34. SelectTypeParameters=CR_Core
  35. #
  36. #
  37. # LOGGING AND ACCOUNTING
  38. AccountingStorageType=accounting_storage/none
  39. ClusterName=cluster
  40. #JobAcctGatherFrequency=30
  41. JobAcctGatherType=jobacct_gather/none
  42. #SlurmctldDebug=info
  43. #SlurmctldLogFile=
  44. #SlurmdDebug=info
  45. #SlurmdLogFile=
  46. #
  47. #
  48. # COMPUTE NODES
  49. NodeName=CZK-E5 CPUs=36 Boards=1 SocketsPerBoard=2 CoresPerSocket=18 ThreadsPerCore=1 RealMemory=128000 State=idle
  50. # NodeName=linux[1-32] CPUs=1 State=UNKNOWN
  51. # NodeName=linux1 NodeAddr=128.197.115.158 CPUs=4 State=UNKNOWN
  52. # NodeName=linux2 NodeAddr=128.197.115.7 CPUs=4 State=UNKNOWN

  53. PartitionName=coc Nodes=CZK-E5 Default=YES MaxTime=INFINITE State=UP
  54. # PartitionName=test Nodes=CZK-E5,linux[1-32] Default=YES MaxTime=INFINITE State=UP

  55. # DefMemPerNode=1000
  56. # MaxMemPerNode=1000
  57. # DefMemPerCPU=4000
  58. # MaxMemPerCPU=4096
复制代码
超线程是开启的,但为了防止slurm用超线程跑我设定了CPUs=36和ThreadsPerCore=1,随后使用社长的测试文件来测试QE,测试脚本如下
  1. #!/bin/bash
  2. #SBATCH -p coc
  3. #SBATCH -J test
  4. #SBATCH --nodes=1
  5. #SBATCH --ntasks-per-node=36
  6. #SBATCH --cpus-per-task=1

  7. module load openmpi4.1.8
  8. export OMPI_ALLOW_RUN_AS_ROOT=1
  9. export OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
  10. export PATH=$PATH:/home/czk/software/qe741/bin
  11. export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/intel/oneapi/mkl/2025.2/lib


  12. export OMP_NUM_THREADS=1
  13. mpirun -n 36 pw.x < pwscf.in > pwscf.out
复制代码
随后在运行时htop发现貌似用超线程跑了,这里我哪里配置不正确?



73

帖子

0

威望

1341

eV
积分
1414

Level 4 (黑子)

2#
发表于 Post on 2025-9-29 22:10:51 | 只看该作者 Only view this author
脚本里开绑核 试试 OMP_PROC_BIND=spread OMP_PLACES=cores

260

帖子

0

威望

631

eV
积分
891

Level 4 (黑子)

3#
 楼主 Author| 发表于 Post on 2025-9-29 23:02:03 | 只看该作者 Only view this author
lmch 发表于 2025-9-29 22:10
脚本里开绑核 试试 OMP_PROC_BIND=spread OMP_PLACES=cores

好像不行,这样的话他给我绑定到两个核上然后开了36个进程,每个占用个位数%的CPU,好奇怪。

494

帖子

11

威望

4231

eV
积分
4945

Level 6 (一方通行)

4#
发表于 Post on 2025-9-30 09:14:27 | 只看该作者 Only view this author
KazusaT 发表于 2025-9-29 23:02
好像不行,这样的话他给我绑定到两个核上然后开了36个进程,每个占用个位数%的CPU,好奇怪。

没关超线程的话ThreadsPerCore就写2试试
自由发挥,野蛮生长

2422

帖子

1

威望

6155

eV
积分
8597

Level 6 (一方通行)

5#
发表于 Post on 2025-9-30 12:29:38 | 只看该作者 Only view this author
关闭超线程。

最简单可靠的方案。
High-Performance Computing for You
为您专属定制的高性能计算解决方案

更多讯息,请访问:
https://labitc.top
http://tophpc.top:8080
电邮: ask@hpc4you.top

260

帖子

0

威望

631

eV
积分
891

Level 4 (黑子)

6#
 楼主 Author| 发表于 Post on 2025-9-30 13:38:21 | 只看该作者 Only view this author
丁越 发表于 2025-9-30 09:14
没关超线程的话ThreadsPerCore就写2试试

试过了,也不行

260

帖子

0

威望

631

eV
积分
891

Level 4 (黑子)

7#
 楼主 Author| 发表于 Post on 2025-9-30 13:39:53 | 只看该作者 Only view this author
abin 发表于 2025-9-30 12:29
关闭超线程。

最简单可靠的方案。

是的,折腾了一番没能成功我就把超线程关了。。。

本版积分规则 Credits rule

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

GMT+8, 2026-1-23 20:26 , Processed in 0.441622 second(s), 23 queries , Gzip On.

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