计算化学公社

 找回密码 Forget password
 注册 Register
楼主 Author: sobereva
打印 Print 上一主题 Last thread 下一主题 Next thread

[CP2K] CP2K第一性原理程序在Linux中的安装方法

  [复制链接 Copy URL]

356

帖子

0

威望

2249

eV
积分
2605

Level 5 (御坂)

16#
发表于 Post on 2021-2-19 08:53:40 | 只看该作者 Only view this author
本帖最后由 gog 于 2021-2-19 09:02 编辑
喵星大佬 发表于 2021-2-18 21:07
但是pexsi,quip,plumed和sirius编译会出问题,有的能解决有的解决不了(貌似是全家桶20.4的问题)

pexsi需要两个依赖库,其中的superlu默认版本更新到6.1。superlu对omp支持不好,不管是intelmpi还是openmpi都不编译成功,toolchain中的默认值是不安装该组件。估计得手动关闭omp独立编译该组件。quip是计算原子相互作用的,只支持gcc版本。无法通过的的话, 就选择No,只是少些功能吧。

我编译最成功的的版本,是7.1版本gcc+mkl+opempi编译,用toolchain方法。

356

帖子

0

威望

2249

eV
积分
2605

Level 5 (御坂)

17#
发表于 Post on 2021-2-19 09:01:27 | 只看该作者 Only view this author
sobereva 发表于 2021-2-19 07:29
文中说了,用没用MKL我只是做了简单的对比测试(纯泛函GPW做单点),发现结果是如此,差异没超过10%。如 ...

被整迷糊了,还以为你用的openblas编译。
其实您用的mkl 2018

356

帖子

0

威望

2249

eV
积分
2605

Level 5 (御坂)

18#
发表于 Post on 2021-2-19 09:21:07 | 只看该作者 Only view this author
wth1219 发表于 2021-2-18 22:36
我们课题组也遇到了类似的问题,同样的设置和配置跑64H2O的体系,磕磕绊绊编译的CP2K-8.1.psmp计算用时是 ...

博主用的是 mkl 2018编译的。使用的安装组合 gcc+openmpi+mkl。

105

帖子

0

威望

3423

eV
积分
3528

Level 5 (御坂)

被催的人

19#
发表于 Post on 2021-2-19 09:50:31 | 只看该作者 Only view this author
喵星大佬 发表于 2021-2-18 23:25
同样用toolchain编译的8.1速度大概只有7.1的一半(用openmpi),intelmpi还没测试。

我们尝试用Intel mpi编译popt版本结果失败了,可能是因为集群配置的Intel mpi 2019有问题。祝您好运。

105

帖子

0

威望

3423

eV
积分
3528

Level 5 (御坂)

被催的人

20#
发表于 Post on 2021-2-19 09:52:31 | 只看该作者 Only view this author
sobereva 发表于 2021-2-19 07:35
https://www.cp2k.org/version_history
我觉得算不上很明显的改进

主要想用其中新加的meta-GGA的stress tensor,结果一通操作下来发现那个可能是有问题的,目前正在测试中。

105

帖子

0

威望

3423

eV
积分
3528

Level 5 (御坂)

被催的人

21#
发表于 Post on 2021-2-19 09:55:31 | 只看该作者 Only view this author
sobereva 发表于 2021-2-19 08:40
直接写--with-intelmpi=install会导致报错__INSTALL__ is not supported; please manually install Intel ...

卢老师您编译的CP2K 8.1照比先前的版本(6.1、7.1)有变慢吗?

1657

帖子

5

威望

4558

eV
积分
6315

Level 6 (一方通行)

喵星人

22#
发表于 Post on 2021-2-19 10:18:00 | 只看该作者 Only view this author
sobereva 发表于 2021-2-19 08:40
直接写--with-intelmpi=install会导致报错__INSTALL__ is not supported; please manually install Intel ...

只能写--with-intelmpi=system用已经装好的,但是编译的时候还是会有很多幺蛾子

1104

帖子

0

威望

3952

eV
积分
5056

Level 6 (一方通行)

23#
发表于 Post on 2021-2-19 12:14:52 | 只看该作者 Only view this author
本帖最后由 乐平 于 2021-2-19 09:23 编辑
喵星大佬 发表于 2021-2-19 04:18
只能写--with-intelmpi=system用已经装好的,但是编译的时候还是会有很多幺蛾子

是的,我用的是 gcc9.3.1 + Intel MPI (2018 版) + Intel MKL (2018 版),
  1. scl enable devtoolset-9 bash
复制代码

设置 ./install_cp2k_toolchain.sh --with-mkl=system --with-intelmpi=system ,运行后可以看到如下信息:
  1. ==================== Finding Intel MPI from system paths ====================
  2. path to mpirun is  /public1/apps/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64/bin/mpirun
  3. path to mpiicc is  /public1/apps/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64/bin/mpiicc
  4. path to mpiifort is  /public1/apps/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64/bin/mpiifort
  5. path to mpiicpc is  /public1/apps/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64/bin/mpiicpc
  6. Found include directory /usr/local/include
  7. Found lib directory /public1/apps/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64/lib/release_mt
  8. libmpi is found in ld search path
  9. libmpicxx is found in ld search path
  10. Step intelmpi took 0.00 seconds.
  11. Step valgrind took 0.00 seconds.
  12. Step reflapack took 0.00 seconds.
  13. ==================== Finding MKL from system paths ====================
  14. MKLROOT is found to be /public1/apps/intel/compilers_and_libraries_2018.1.163/linux/mkl
  15. libm is found in ld search path
  16. libdl is found in ld search path
  17. Step mkl took 0.00 seconds.
复制代码


但是 toolchain 中的 install_elpa.sh 报错。
查看报错信息
  1. vi build/elpa-2020.05.001/build/configure.log
复制代码
显示的是:

checking whether Fortran compiler infers interfaces ... no
checking for fc option to support OpenMP... -fopenmp
checking for mpiexec.hydra... mpiexec.hydra
checking whether stdout/stderr file redirect should be enabled... no
checking whether ELPA library should contain also single precision functions... no
checking whether Fortran module iso_fortran_env is available... yes
checking whether we can compile a Fortran program using MKL... no
checking for library containing dgemm... none required
checking whether we can link a program with a blas lib... yes
checking for library containing dlarrv... none required
checking whether we can link a program with a lapack lib... yes
checking whether -lmpiscalapack already contains a BLACS implementation... no
checking whether -lscalapack already contains a BLACS implementation... yes
checking for library containing pdtran... none required
checking whether we can link a Fortran program with all blacs/scalapack... yes
checking whether we can use the intrinsic Fortran function "get_environment_variable"... yes
checking whether BAND_TO_FLULL_BLOCKING is requested... yes
checking whether a GPU compute capability is specified... no
checking whether Fortran mpi module can be used... no
configure: error: Could not compile a Fortran program with an 'use mpi' statement. You can try again with --disable-mpi-module

按照提示,在 scripts/install_elpa.sh 的第 100 行里加上 --disable-mpi-module \  之后,编译继续。然后又遇到 libvdwxc 的报错。
报错信息如下:

checking how MPI parameters have been set... yon
checking whether the MPI C compiler is set... yes
checking whether the MPI C compiler is wrapped... no
checking whether the MPI Fortran compiler is set... yes
checking whether the MPI Fortran compiler is wrapped... no
checking mpi.h usability... yes
checking mpi.h presence... yes
checking for mpi.h... yes
checking for MPI_Init... yes
checking whether the MPI C compiler works... yes
checking for a Fortran MPI module... no
checking whether the MPI Fortran compiler works... no
checking whether we have a full MPI support... no
configure: error: in `/public1/apps/cp2k-8.1/tools/toolchain/build/libvdwxc-0.4.0':
configure: error: MPI support is broken - please check your configuration
See `config.log' for more details





1657

帖子

5

威望

4558

eV
积分
6315

Level 6 (一方通行)

喵星人

24#
发表于 Post on 2021-2-19 13:05:03 | 只看该作者 Only view this author
本帖最后由 喵星大佬 于 2021-2-19 13:07 编辑
乐平 发表于 2021-2-19 12:14
是的,我用的是 gcc9.3.1 + Intel MPI (2018 版) + Intel MKL (2018 版),
设置 ./install_cp2k_toolch ...

写了 --with-intelmpi=system 的情况下默认用的编译器已经是mpiicc,mpiifort,mpiicpc了,所以也不关gcc什么事了。
elpa的问题用http://bbs.keinsci.com/thread-19009-1-1.html这个帖子1楼的方法可解。

1104

帖子

0

威望

3952

eV
积分
5056

Level 6 (一方通行)

25#
发表于 Post on 2021-2-19 15:03:02 | 只看该作者 Only view this author
喵星大佬 发表于 2021-2-19 07:05
写了 --with-intelmpi=system 的情况下默认用的编译器已经是mpiicc,mpiifort,mpiicpc了,所以也不关gcc ...

谢谢回复,但是您给的链接和我的问题不一样。
报错信息显示与 mpi 有关,不是帖子里的 SCALAPACK_LDFLAGS 问题。

1657

帖子

5

威望

4558

eV
积分
6315

Level 6 (一方通行)

喵星人

26#
发表于 Post on 2021-2-19 15:10:10 | 只看该作者 Only view this author
乐平 发表于 2021-2-19 15:03
谢谢回复,但是您给的链接和我的问题不一样。
报错信息显示与 mpi 有关,不是帖子里的 SCALAPACK_LDFLAG ...

已经找到了mpi不应该出mpi的问题,可能是mpi装的有点问题?

不过不知道是啥设置原因咋的,7.1到8.1同样的输入文件速度慢了不少

1104

帖子

0

威望

3952

eV
积分
5056

Level 6 (一方通行)

27#
发表于 Post on 2021-2-19 15:24:46 | 只看该作者 Only view this author
喵星大佬 发表于 2021-2-19 09:10
已经找到了mpi不应该出mpi的问题,可能是mpi装的有点问题?

不过不知道是啥设置原因咋的,7.1到8.1同 ...

谢谢回复。
也许是 Intel MPI 的问题吧……
我再试试用 CP2K 默认的 openmpi 吧。

356

帖子

0

威望

2249

eV
积分
2605

Level 5 (御坂)

28#
发表于 Post on 2021-2-19 17:59:53 | 只看该作者 Only view this author
乐平 发表于 2021-2-19 15:24
谢谢回复。
也许是 Intel MPI 的问题吧……
我再试试用 CP2K 默认的 openmpi 吧。

核心的组件,就四五个吧。其他的,是用来加速计算用的。实在安装不上,可以不安装。

1104

帖子

0

威望

3952

eV
积分
5056

Level 6 (一方通行)

29#
发表于 Post on 2021-2-19 18:35:23 | 只看该作者 Only view this author
本帖最后由 乐平 于 2021-2-19 12:49 编辑
喵星大佬 发表于 2021-2-19 09:10
已经找到了mpi不应该出mpi的问题,可能是mpi装的有点问题?

不过不知道是啥设置原因咋的,7.1到8.1同 ...

用了 --with-openmpi=install 参数,过程中没有什么报错,但是……

  1. ==================== generating arch files ====================
  2. arch files can be found in the /public2/wanghuan/cp2k-8.1/tools/toolchain/install/arch subdirectory
  3. Wrote /public2/wanghuan/cp2k-8.1/tools/toolchain/install/arch/local.ssmp
  4. Wrote /public2/wanghuan/cp2k-8.1/tools/toolchain/install/arch/local.sdbg
  5. Wrote /public2/wanghuan/cp2k-8.1/tools/toolchain/install/arch/local.psmp
  6. Wrote /public2/wanghuan/cp2k-8.1/tools/toolchain/install/arch/local.pdbg
  7. Wrote /public2/wanghuan/cp2k-8.1/tools/toolchain/install/arch/local_warn.psmp
  8. Wrote /public2/wanghuan/cp2k-8.1/tools/toolchain/install/arch/local_coverage.pdbg
  9. ========================== usage =========================
  10. Done!
  11. Now copy:
  12.   cp /public2/wanghuan/cp2k-8.1/tools/toolchain/install/arch/* to the cp2k/arch/ directory
  13. To use the installed tools and libraries and cp2k version
  14. compiled with it you will first need to execute at the prompt:
  15.   source /public2/wanghuan/cp2k-8.1/tools/toolchain/install/setup
  16. To build CP2K you should change directory:
  17.   cd cp2k/
  18.   make -j 16 ARCH=local VERSION="ssmp sdbg psmp pdbg"
复制代码


发现居然没有 popt 版……

按上述步骤,
cp /public2/wanghuan/cp2k-8.1/tools/toolchain/install/arch/* ../../arch/
source /public2/wanghuan/cp2k-8.1/tools/toolchain/install/setup

然后在编译的时候加上 popt,感觉应该是不可能的……,因为上面 Wrote 那几行里没有 popt 版

make -j 16 ARCH=local VERSION="ssmp popt psmp"

编译过程中会有报错信息:

  1.    13 |    USE dbcsr_types, ONLY: dbcsr_data_obj, &
  2.       |       1
  3. Fatal Error: Cannot open module file ‘dbcsr_types.mod’ for reading at (1): No such file or directory
  4. compilation terminated.
  5. make[4]: *** [dbcsr_blas_operations.o] Error 1
  6. make[4]: *** Waiting for unfinished jobs....
  7. /public2/wanghuan/cp2k-8.1/exts/dbcsr/src/tas/dbcsr_tas_types.F:16:7:

  8.    16 |    USE dbcsr_types, ONLY: &
  9.       |       1
  10. Fatal Error: Cannot open module file ‘dbcsr_types.mod’ for reading at (1): No such file or directory
  11. compilation terminated.
  12. make[4]: *** [dbcsr_tas_types.o] Error 1
复制代码


果然,在 exe/local 目录中的结果如下:

cp2k_shell.ssmp  cp2k.sopt  
cp2k.ssmp  
dumpdcd.ssmp  
graph.ssmp  
grid_miniapp.ssmp  
grid_unittest.ssmp  
libcp2k_unittest.ssmp  
memory_utilities_unittest.ssmp  
parallel_rng_types_unittest.ssmp  
xyz2dcd.ssmp

没有 popt 版……

356

帖子

0

威望

2249

eV
积分
2605

Level 5 (御坂)

30#
发表于 Post on 2021-2-19 18:47:46 | 只看该作者 Only view this author
乐平 发表于 2021-2-19 18:35
用了 --with-openmpi=install 参数,过程中没有什么报错,但是……

openmpi 用root权限先编译好啊。

本版积分规则 Credits rule

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

GMT+8, 2025-8-14 09:13 , Processed in 0.215339 second(s), 21 queries , Gzip On.

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