计算化学公社

标题: 学校超算安装CP2K后,读波函数进行多核计算会段错误 [打印本页]

作者
Author:
北大-陶豫    时间: 2025-3-10 21:16
标题: 学校超算安装CP2K后,读波函数进行多核计算会段错误
我在超算服务器上,先按照 http://sobereva.com/451 的流程按照了 openmpi,然后按照 http://sobereva.com/586 安装了量子化学软件 CP2K,然后运行一个测试样例,一个金刚石小晶胞的 PBE 泛函单点能计算。我用 4 核计算(mpirun -np 4 cp2k.popt),在输入文件里设置了读取之前算好的波函数(SCF_GUESS RESTART),结果stderr出现报错:
  1. [l06c41n4:2206753:0:2206753] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x4c00081b)
  2. [l06c41n4:2206750:0:2206750] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x4c00081b)
  3. [l06c41n4:2206751:0:2206751] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x4c00081b)
  4. [l06c41n4:2206752:0:2206752] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x4c00081b)
复制代码

我尝试发现:如果不设置读取之前算好的波函数(注释掉SCF_GUESS RESTART),或者单核运行(mpirun -np 1 cp2k.popt),就不会出现这个报错,计算能正常结束。但就是在既并行又读取波函数时会出现上述报错,out 文件显示无法进入 SCF 流程。这些计算是在学校的服务器上进行的(我没有 root 权限),我将提交任务的 slurm 脚本中,将跟系统申请的核数由4核改成了16核(可用的内存数量大大增加了),但 mpirun -np 4 cp2k.popt 没有改成 16,既并行又读取波函数的计算仍然有相同的报错。我同学在同一个超算系统上(我俩都没有 root 权限),同学就能正常完成多核读取波函数的计算。

这可能是什么原因,我应该如何排查?

我的 .bashrc 内容:
  1. # .bashrc

  2. # Source global definitions
  3. if [ -f /etc/bashrc ]; then
  4.         . /etc/bashrc
  5. fi

  6. # User specific environment
  7. if ! [[ "$PATH" =~ "$HOME/.local/bin:$HOME/bin:" ]]
  8. then
  9.     PATH="$HOME/.local/bin:$HOME/bin:$PATH"
  10. fi
  11. export PATH

  12. # Uncomment the following line if you don't like systemctl's auto-paging feature:
  13. # export SYSTEMD_PAGER=

  14. # User specific aliases and functions

  15. module use ~/.modulefiles

  16. module load vasp/
  17. module load anaconda3/

  18. export PATH="/lustre/home/2001110394/FreqScript:$PATH"
  19. export PATH="/lustre/home/2001110394/vaspkit.1.5.1/bin:$PATH"

  20. #export PATH="/lustre/home/2001110394/cmake-4.0.0-rc1/build/bin:$PATH"

  21. #        mpi
  22. export PATH=/lustre/home/2001110394/openmpi416/bin:$PATH
  23. export LD_LIBRARY_PATH=/lustre/home/2001110394/openmpi416/lib:$LD_LIBRARY_PATH

  24. #        cp2k
  25. source /lustre/home/2001110394/cp2k-2025.1/tools/toolchain/install/setup
  26. export PATH=$PATH:/lustre/home/2001110394/cp2k-2025.1/exe/local


复制代码
我的slurm脚本内容:
  1. #!/bin/bash
  2. #SBATCH -A hpc2006189113
  3. #SBATCH --get-user-env
  4. #SBATCH --partition=C064M0256G
  5. #SBATCH --qos=low
  6. #SBATCH -J test
  7. #SBATCH -N 1
  8. #SBATCH -n 4
  9. #SBATCH -o jobid%j-%N.out
  10. #SBATCH -e jobid%j-%N.error
  11. #SBATCH --time=0:02:00

  12. ulimit -s unlimited
  13. ulimit -l unlimited

  14. source ~/.bashrc

  15. module load gcc/12.2.0

  16. export OMPI_MCA_btl_openib_if_exclude=mlx5_0:1
  17. mpirun -np 4 cp2k.popt test.inp |tee test.out


复制代码


test.inp 内容:
  1. #Generated by Multiwfn
  2. &GLOBAL
  3.   PROJECT test
  4.   PRINT_LEVEL LOW
  5.   RUN_TYPE ENERGY
  6. &END GLOBAL

  7. &FORCE_EVAL
  8.   METHOD Quickstep
  9.   &SUBSYS
  10.     &CELL
  11.       A     7.13358000     0.00000000     0.00000000
  12.       B     0.00000000     7.13358000     0.00000000
  13.       C     0.00000000     0.00000000     7.13358000
  14.     &END CELL
  15.     &COORD
  16.       C     0.00000000    0.00000000    0.00000000
  17.       C     0.89169753    0.89169753    0.89169753
  18.       C     0.00000000    1.78339506    1.78339506
  19.       C     2.67509260    0.89169753    2.67509260
  20.       C     1.78339506    0.00000000    1.78339506
  21.       C     0.89169753    2.67509260    2.67509260
  22.       C     1.78339506    1.78339506    0.00000000
  23.       C     2.67509260    2.67509260    0.89169753
  24.       C     3.56679013    0.00000000    0.00000000
  25.       C     4.45848766    0.89169753    0.89169753
  26.       C     3.56679013    1.78339506    1.78339506
  27.       C     6.24188272    0.89169753    2.67509260
  28.       C     5.35018519    0.00000000    1.78339506
  29.       C     4.45848766    2.67509260    2.67509260
  30.       C     5.35018519    1.78339506    0.00000000
  31.       C     6.24188272    2.67509260    0.89169753
  32.       C     0.00000000    3.56679013    0.00000000
  33.       C     0.89169753    4.45848766    0.89169753
  34.       C     0.00000000    5.35018519    1.78339506
  35.       C     2.67509260    4.45848766    2.67509260
  36.       C     1.78339506    3.56679013    1.78339506
  37.       C     0.89169753    6.24188272    2.67509260
  38.       C     1.78339506    5.35018519    0.00000000
  39.       C     2.67509260    6.24188272    0.89169753
  40.       C     3.56679013    3.56679013    0.00000000
  41.       C     4.45848766    4.45848766    0.89169753
  42.       C     3.56679013    5.35018519    1.78339506
  43.       C     6.24188272    4.45848766    2.67509260
  44.       C     5.35018519    3.56679013    1.78339506
  45.       C     4.45848766    6.24188272    2.67509260
  46.       C     5.35018519    5.35018519    0.00000000
  47.       C     6.24188272    6.24188272    0.89169753
  48.       C     0.00000000    0.00000000    3.56679013
  49.       C     0.89169753    0.89169753    4.45848766
  50.       C     0.00000000    1.78339506    5.35018519
  51.       C     2.67509260    0.89169753    6.24188272
  52.       C     1.78339506    0.00000000    5.35018519
  53.       C     0.89169753    2.67509260    6.24188272
  54.       C     1.78339506    1.78339506    3.56679013
  55.       C     2.67509260    2.67509260    4.45848766
  56.       C     3.56679013    0.00000000    3.56679013
  57.       C     4.45848766    0.89169753    4.45848766
  58.       C     3.56679013    1.78339506    5.35018519
  59.       C     6.24188272    0.89169753    6.24188272
  60.       C     5.35018519    0.00000000    5.35018519
  61.       C     4.45848766    2.67509260    6.24188272
  62.       C     5.35018519    1.78339506    3.56679013
  63.       C     6.24188272    2.67509260    4.45848766
  64.       C     0.00000000    3.56679013    3.56679013
  65.       C     0.89169753    4.45848766    4.45848766
  66.       C     0.00000000    5.35018519    5.35018519
  67.       C     2.67509260    4.45848766    6.24188272
  68.       C     1.78339506    3.56679013    5.35018519
  69.       C     0.89169753    6.24188272    6.24188272
  70.       C     1.78339506    5.35018519    3.56679013
  71.       C     2.67509260    6.24188272    4.45848766
  72.       C     3.56679013    3.56679013    3.56679013
  73.       C     4.45848766    4.45848766    4.45848766
  74.       C     3.56679013    5.35018519    5.35018519
  75.       C     6.24188272    4.45848766    6.24188272
  76.       C     5.35018519    3.56679013    5.35018519
  77.       C     4.45848766    6.24188272    6.24188272
  78.       C     5.35018519    5.35018519    3.56679013
  79.       C     6.24188272    6.24188272    4.45848766
  80.     &END COORD
  81.     &KIND C
  82.       ELEMENT C
  83.       BASIS_SET DZVP-MOLOPT-SR-GTH
  84.       POTENTIAL GTH-PBE
  85.     &END KIND
  86.   &END SUBSYS

  87.   &DFT
  88.     BASIS_SET_FILE_NAME  BASIS_MOLOPT
  89.     POTENTIAL_FILE_NAME  POTENTIAL
  90.     WFN_RESTART_FILE_NAME test-RESTART.wfn
  91.     CHARGE    0 #Net charge
  92.     MULTIPLICITY  1 #Spin multiplicity
  93.     &QS
  94.       EPS_DEFAULT 1E-10 #This is default. Set all EPS_xxx to values such that the energy will be correct up to this value
  95.     &END QS
  96.     &XC
  97.       &XC_FUNCTIONAL PBE
  98.       &END XC_FUNCTIONAL
  99.     &END XC
  100.     &MGRID
  101.       CUTOFF 350 #Use 500 for high accuracy calculation
  102.       REL_CUTOFF 50 #Use 60 for high accuracy calculation
  103.     &END MGRID
  104.     &SCF
  105.       MAX_SCF 128
  106.       EPS_SCF 1E-5 #Target accuracy for SCF convergence
  107.       SCF_GUESS RESTART #Uncomment this can restart from WFN_RESTART_FILE_NAME file
  108.       &DIAGONALIZATION
  109.         ALGORITHM STANDARD #Algorithm for diagonalization. DAVIDSON is faster for large systems
  110.       &END DIAGONALIZATION
  111.       &MIXING
  112.         METHOD BROYDEN_MIXING
  113.         ALPHA 0.4 #Default. Mixing 40% of new density matrix with the old one
  114.         NBROYDEN 5 #Default is 4. Number of previous steps stored for the actual mixing scheme
  115.       &END MIXING
  116.     &END SCF
  117.   &END DFT
  118. &END FORCE_EVAL
复制代码




作者
Author:
Daniel_Arndt    时间: 2025-3-11 09:44
我看不出来有问题的地方。

只看出来几个不规范的地方。一般地,我用“module use”时都会加上“--append”,这样的话,自己写的modulefile就排在集群默认提供的modulefile之后。我也很少混用“module load”和“export PATH”,我在集群上都是尽量使用modulefile的。slurm脚本里面我一般都是写绝对路径的,因为我当时用的集群的文件系统有偶发性的问题。
作者
Author:
Santz    时间: 2025-3-11 09:55
你试试安装时不要手动编译 OpenMPI,在 toolchain 中直接--with-openmpi=install。另外2025.1 默认 toolchain 使用的是 OpenMPI-5.0.6
作者
Author:
北大-陶豫    时间: 2025-3-11 18:14
Santz 发表于 2025-3-11 09:55
你试试安装时不要手动编译 OpenMPI,在 toolchain 中直接--with-openmpi=install。另外2025.1 默认 toolcha ...

这个试过了,并没有什么改善_(:з」∠)_
作者
Author:
北大-陶豫    时间: 2025-3-18 21:07
后续:问题没完全解决但解决了,我请学校的超算管理员装了一个所有用户都可以用的 CP2K,用起来非常好,完全没有我自己装的时候遇到的问题……




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