计算化学公社

 找回密码 Forget password
 注册 Register
Views: 15231|回复 Reply: 30

[Amber] 基于xtb的amberQM/MM模拟

[复制链接 Copy URL]

375

帖子

2

威望

1525

eV
积分
1940

Level 5 (御坂)

发表于 Post on 2019-11-11 04:35:35 | 显示全部楼层 Show all |阅读模式 Reading model
本帖最后由 wuzhiyi 于 2019-11-11 04:43 编辑

我知道可能很多人觉得用amber来跑QM/MM效率不是很高。但有些人就是懒,不想用别的,而且很多时候并不是想做非常严谨的QM,而是用一些半经验的方法试试看。
除掉那些历史悠久的半经验方法的话,amber自带的半经验能用的只有PM6和dftb3。amber的PM6只有DFT-D矫正,氢键矫正的形式有点怪。amber的dftb3又是连DFT-D矫正都没有。
所以我就想可以用现在大热的xtb来描述QM部分,无奈amber的QM/MM部分八百年没更新了,虽然有Holger Kruse写了一个amber/xtb的interface,但我记得是争对amber14的,现在再用可能会被审稿人欺负。
但从orca4.2开始,orca就支持xtb了,而amber支持orca,所以就可以串起来,搞一个amber/orca/xtb来用xtb。
可惜如果用orca/xtb的interface来调用xtb的话,point charge gradient文件pcgrad是以xtb的形式而非orca的形式输出,具体来说就是少了第一行point charge的个数和具体的小数点的个数也有点区别。
导致用orca/xtb生成的pcgrad文件无法被amber的amber/orca/的interface读取。
这个问题9月13号就被人提出在orca论坛上(https://orcaforum.kofo.mpg.de/viewtopic.php?f=11&t=5181&p=22867&hilit=xtb#p22867),不过没人理。于是我就修改的xtb一下(https://github.com/xiki-tempula/xtb),使其生成的pcgrad可以被amber的amber/orca来读取。发现我提供修改过的xtb之后,christoph.riplinger光速表示,我们会在下个版本修正这个问题,所以let‘s see。

具体操作就是把我修改过的xtb(https://github.com/xiki-tempula/xtb)下载下来,然后编译用intel编译器,meson(>0.49)和ninja编译。

  1. export FC=ifort CC=icc CXX=icpc
复制代码


注意meson要新版的,直接git就行,meson不需要编译。

因为xtb强制静态编译,所以可能会遇到没有静态pthread库问题,我有一个修改版的xtb(https://github.com/xiki-tempula/xtb/tree/dendrite)用一种丑陋的方式解决了这个问题,不过据说xtb的人在改了。

然后把编译完成的xtb放到orca下面命名为otool_xtb
然后普通的用amber调用orca,提供名为orc_job.tpl的模版就行,注意修改内存和线程数。以及适当的定义qmcut,都用半经验了,就把整个蛋白都包进去吧,省的审稿人BB。
amber的输入文件 ua_equil.in (1.38 KB, 下载次数 Times of downloads: 47)

评分 Rate

参与人数
Participants 6
eV +26 收起 理由
Reason
bobosiji + 3 好物!
zsu007 + 5 赞!
16aDream + 5 好物!
yjmaxpayne + 5 好物!
plus + 3
puzhongji + 5 精品内容

查看全部评分 View all ratings

13

帖子

0

威望

75

eV
积分
88

Level 2 能力者

发表于 Post on 2019-11-16 20:49:02 | 显示全部楼层 Show all
赞一个!

13

帖子

0

威望

75

eV
积分
88

Level 2 能力者

发表于 Post on 2019-11-16 20:52:40 | 显示全部楼层 Show all
具体操作就是把我修改过的xtb(https://github.com/xiki-tempula/xtb)下载下来,---------------- 请问,下回来是 xtb-master.zip 文件吗?

375

帖子

2

威望

1525

eV
积分
1940

Level 5 (御坂)

 楼主 Author| 发表于 Post on 2019-11-16 22:14:58 | 显示全部楼层 Show all
纪山 发表于 2019-11-16 20:52
具体操作就是把我修改过的xtb(https://github.com/xiki-tempula/xtb)下载下来,---------------- 请问, ...

应该是
我一般就git clone https://github.com/xiki-tempula/xtb.git

13

帖子

0

威望

75

eV
积分
88

Level 2 能力者

发表于 Post on 2019-11-17 08:18:33 | 显示全部楼层 Show all
wuzhiyi 发表于 2019-11-16 22:14
应该是
我一般就git clone https://github.com/xiki-tempula/xtb.git

用git clone的话又要安装一堆软件,好麻烦的说。

307

帖子

1

威望

5739

eV
积分
6066

Level 6 (一方通行)

发表于 Post on 2019-11-17 09:35:01 | 显示全部楼层 Show all
谢谢分享!

147

帖子

0

威望

1039

eV
积分
1186

Level 4 (黑子)

发表于 Post on 2019-12-25 14:03:03 | 显示全部楼层 Show all
厉害,能否写一个相关教程,付费也可。

375

帖子

2

威望

1525

eV
积分
1940

Level 5 (御坂)

 楼主 Author| 发表于 Post on 2019-12-25 18:41:14 | 显示全部楼层 Show all
ChaosChiao 发表于 2019-12-25 14:03
厉害,能否写一个相关教程,付费也可。

我觉得该有的信息都有了啊 你还要什么的教程啊?

292

帖子

0

威望

1813

eV
积分
2105

Level 5 (御坂)

发表于 Post on 2019-12-26 16:06:35 | 显示全部楼层 Show all
编译时出了以下错误,请教楼主

xtb编译命令是按照社长写的编译xtb的教程:http://sobereva.com/521

[root@localhost xtb-master]# export FC=ifort CC=icc CXX=icpc
[root@localhost xtb-master]# meson setup build_intel --optimization=2
The Meson build system
Version: 0.52.1
Source dir: /mnt/hgfs/xtb_for_orca/xtb-master
Build dir: /mnt/hgfs/xtb_for_orca/xtb-master/build_intel
Build type: native build
Project name: xtb
Project version: 6.2.1
Fortran compiler for the host machine: ifort (intel 12.1.0 "ifort (IFORT) 12.1.0 20110811")
Fortran linker for the host machine: xild 12.1.0
C compiler for the host machine: icc (intel 12.1.0 "icc (ICC) 12.1.0 20110811")
C linker for the host machine: xild 12.1.0
C++ compiler for the host machine: icpc (intel 12.1.0 "icpc (ICC) 12.1.0 20110811")
C++ linker for the host machine: xild 12.1.0
Host machine cpu family: x86_64
Host machine cpu: x86_64
Program git found: YES (/usr/bin/git)
Program date found: YES (/usr/bin/date)
Program whoami found: YES (/usr/bin/whoami)
Program hostname found: YES (/usr/bin/hostname)
Configuring xtb_version.fh using configuration
WARNING: Consider using the builtin option for language standard version rather than adding flags by hand.
WARNING: Consider using the builtin option for language standard version rather than adding flags by hand.
Library pthread found: YES
Library m found: YES
Library dl found: YES
Library mkl_intel_lp64 found: YES
Library mkl_intel_thread found: YES
Library mkl_core found: YES
Library iomp5 found: YES
Library mkl_rt found: YES
Run-time dependency threads found: YES
Program a2x found: NO
Program pytest found: NO
Program mypy found: NO
Program pylint found: NO
Program flake8 found: NO
Build targets in project: 5
Found ninja-1.7.2 at /usr/bin/ninja-build


[root@localhost xtb-master]# ninja -C build_intel
bash: ninja: command not found...

因为前面ninja的安装没有报错,所以我尝试将ninja改为ninja-build:会不会是这步的问题?


[root@localhost xtb-master]# ninja-build -C build_intel
ninja: Entering directory `build_intel'
[1/279] Compiling Fortran object 'xtb@sta/xtb_tbdef_param.f90.o'.
FAILED: xtb@sta/xtb_tbdef_param.f90.o
ifort -Ixtb@sta -I. -I.. -I../include -warn general -warn truncated_source -O2 -g -axAVX2 -r8 -traceback -qopenmp -D_FILE_OFFSET_BITS=64 -fPIC -module xtb@sta '-gen-dep='xtb@sta/xtb_tbdef_param.f90.o'' -gen-depformat=make -o 'xtb@sta/xtb_tbdef_param.f90.o' -c ../xtb/tbdef_param.f90
ifort: command line warning #10130: unknown extension 'A' ignored in option '-ax'
ifort: command line warning #10130: unknown extension 'V' ignored in option '-ax'
ifort: command line warning #10130: unknown extension 'X' ignored in option '-ax'
ifort: command line warning #10130: unknown extension '2' ignored in option '-ax'
ifort: command line warning #10006: ignoring unknown option '-qopenmp'
../xtb/tbdef_param.f90(79): error #8040: Invalid type-name in a derived type definition.   [GFN_PARAMETER]
   type gfn_parameter(nelem,nshell)
--------^
../xtb/tbdef_param.f90(80): error #6659: Not an attribute-spec keyword   [LEN]
      integer, len :: nelem  = max_elem
---------------^
../xtb/tbdef_param.f90(81): error #6659: Not an attribute-spec keyword   [LEN]
      integer, len :: nshell = max_shell
---------------^
../xtb/tbdef_param.f90(83): error #6530: The array spec for this component must be of explicit shape and each bound must be an initialization expression.   [EN]
      real(wp) :: en(nelem)
------------------^
../xtb/tbdef_param.f90(84): error #6530: The array spec for this component must be of explicit shape and each bound must be an initialization expression.   [MC]
      real(wp) :: mc(nelem)
------------------^
../xtb/tbdef_param.f90(85): error #6530: The array spec for this component must be of explicit shape and each bound must be an initialization expression.   [GAM]
      real(wp) :: gam(nelem)
------------------^
../xtb/tbdef_param.f90(86): error #6530: The array spec for this component must be of explicit shape and each bound must be an initialization expression.   [GAM3]
      real(wp) :: gam3(nelem)
------------------^
../xtb/tbdef_param.f90(87): error #6530: The array spec for this component must be of explicit shape and each bound must be an initialization expression.   [RAD]
      real(wp) :: rad(nelem)
------------------^
../xtb/tbdef_param.f90(88): error #6530: The array spec for this component must be of explicit shape and each bound must be an initialization expression.   [WLL]
      real(wp) :: wll(nelem,nshell)
------------------^
../xtb/tbdef_param.f90(89): error #6530: The array spec for this component must be of explicit shape and each bound must be an initialization expression.   [REP]
      real(wp) :: rep(2,nelem)
------------------^
../xtb/tbdef_param.f90(90): error #6530: The array spec for this component must be of explicit shape and each bound must be an initialization expression.   [POLYR]
      real(wp) :: polyr(4,nelem)
------------------^
../xtb/tbdef_param.f90(91): error #6530: The array spec for this component must be of explicit shape and each bound must be an initialization expression.   [CXB]
      real(wp) :: cxb(nelem)
------------------^
../xtb/tbdef_param.f90(92): error #6530: The array spec for this component must be of explicit shape and each bound must be an initialization expression.   [AO_EXP]
      real(wp) :: ao_exp(nshell,nelem)
------------------^
../xtb/tbdef_param.f90(93): error #6530: The array spec for this component must be of explicit shape and each bound must be an initialization expression.   [AO_LEV]
      real(wp) :: ao_lev(nshell,nelem)
------------------^
../xtb/tbdef_param.f90(94): error #6530: The array spec for this component must be of explicit shape and each bound must be an initialization expression.   [LPAR]
      real(wp) :: lpar(0:2,nelem)
------------------^
../xtb/tbdef_param.f90(95): error #6530: The array spec for this component must be of explicit shape and each bound must be an initialization expression.   [KPAIR]
      real(wp) :: kpair(nelem,nelem)
------------------^
../xtb/tbdef_param.f90(96): error #6530: The array spec for this component must be of explicit shape and each bound must be an initialization expression.   [KCNAT]
      real(wp) :: kcnat(0:2,nelem)
------------------^
../xtb/tbdef_param.f90(97): error #6530: The array spec for this component must be of explicit shape and each bound must be an initialization expression.   [RADAES]
      real(wp) :: radaes(nelem)
------------------^
../xtb/tbdef_param.f90(98): error #6530: The array spec for this component must be of explicit shape and each bound must be an initialization expression.   [DPOLC]
      real(wp) :: dpolc(nelem)
------------------^
../xtb/tbdef_param.f90(99): error #6530: The array spec for this component must be of explicit shape and each bound must be an initialization expression.   [QPOLC]
      real(wp) :: qpolc(nelem)
------------------^
../xtb/tbdef_param.f90(100): error #6530: The array spec for this component must be of explicit shape and each bound must be an initialization expression.   [AO_PQN]
      integer  :: ao_pqn(nshell,nelem)
------------------^
../xtb/tbdef_param.f90(101): error #6530: The array spec for this component must be of explicit shape and each bound must be an initialization expression.   [AO_L]
      integer  :: ao_l(nshell,nelem)
------------------^
../xtb/tbdef_param.f90(102): error #6530: The array spec for this component must be of explicit shape and each bound must be an initialization expression.   [AO_N]
      integer  :: ao_n(nelem)
------------------^
../xtb/tbdef_param.f90(103): error #6530: The array spec for this component must be of explicit shape and each bound must be an initialization expression.   [AO_TYP]
      integer  :: ao_typ(nshell,nelem)
------------------^
../xtb/tbdef_param.f90(104): error #6530: The array spec for this component must be of explicit shape and each bound must be an initialization expression.   [METAL]
      integer  :: metal(nelem)
------------------^
../xtb/tbdef_param.f90(105): error #6530: The array spec for this component must be of explicit shape and each bound must be an initialization expression.   [CNVAL]
      integer  :: cnval(nelem)
------------------^
../xtb/tbdef_param.f90(106): error #6530: The array spec for this component must be of explicit shape and each bound must be an initialization expression.   [TIMESTP]
      character(len=30) :: timestp(nelem)
---------------------------^
../xtb/tbdef_param.f90(83): error #6279: A specification expression object must be a dummy argument, a COMMON block object, or an object accessible through host or use association   [NELEM]
      real(wp) :: en(nelem)
---------------------^
../xtb/tbdef_param.f90(88): error #6279: A specification expression object must be a dummy argument, a COMMON block object, or an object accessible through host or use association   [NSHELL]
      real(wp) :: wll(nelem,nshell)
----------------------------^
compilation aborted for ../xtb/tbdef_param.f90 (code 1)
[2/279] Compiling Fortran object 'xtb@sta/xtb_tbdef_setvar.f90.o'.
ifort: command line warning #10130: unknown extension 'A' ignored in option '-ax'
ifort: command line warning #10130: unknown extension 'V' ignored in option '-ax'
ifort: command line warning #10130: unknown extension 'X' ignored in option '-ax'
ifort: command line warning #10130: unknown extension '2' ignored in option '-ax'
ifort: command line warning #10006: ignoring unknown option '-qopenmp'
[3/279] Compiling Fortran object 'xtb@sta/xtb_tbdef_data.f90.o'.
ifort: command line warning #10130: unknown extension 'A' ignored in option '-ax'
ifort: command line warning #10130: unknown extension 'V' ignored in option '-ax'
ifort: command line warning #10130: unknown extension 'X' ignored in option '-ax'
ifort: command line warning #10130: unknown extension '2' ignored in option '-ax'
ifort: command line warning #10006: ignoring unknown option '-qopenmp'
[4/279] Compiling Fortran object 'xtb@sta/xtb_tbdef_wavefunction.f90.o'.
ifort: command line warning #10130: unknown extension 'A' ignored in option '-ax'
ifort: command line warning #10130: unknown extension 'V' ignored in option '-ax'
ifort: command line warning #10130: unknown extension 'X' ignored in option '-ax'
ifort: command line warning #10130: unknown extension '2' ignored in option '-ax'
ifort: command line warning #10006: ignoring unknown option '-qopenmp'
[5/279] Compiling Fortran object 'xtb@sta/xtb_tbdef_basisset.f90.o'.
ifort: command line warning #10130: unknown extension 'A' ignored in option '-ax'
ifort: command line warning #10130: unknown extension 'V' ignored in option '-ax'
ifort: command line warning #10130: unknown extension 'X' ignored in option '-ax'
ifort: command line warning #10130: unknown extension '2' ignored in option '-ax'
ifort: command line warning #10006: ignoring unknown option '-qopenmp'
[6/279] Compiling Fortran object 'xtb@sta/xtb_tbdef_solvent.f90.o'.
ifort: command line warning #10130: unknown extension 'A' ignored in option '-ax'
ifort: command line warning #10130: unknown extension 'V' ignored in option '-ax'
ifort: command line warning #10130: unknown extension 'X' ignored in option '-ax'
ifort: command line warning #10130: unknown extension '2' ignored in option '-ax'
ifort: command line warning #10006: ignoring unknown option '-qopenmp'
ninja: build stopped: subcommand failed.


另外请教一下,网站直接打包下载的xtb-master.zip解压之后6.9MB,git clone下来的目录为8.5MB,而Grimme提供的编译好的xtb有30多MB,是不是不对?是不是两种方式下载的source code都不完整?(按理说编译成二进制可执行文件之后体积会大大缩小)


375

帖子

2

威望

1525

eV
积分
1940

Level 5 (御坂)

 楼主 Author| 发表于 Post on 2019-12-28 02:30:45 | 显示全部楼层 Show all
霜晨月 发表于 2019-12-26 16:06
编译时出了以下错误,请教楼主

xtb编译命令是按照社长写的编译xtb的教程:http://sobereva.com/521

你把ninja加进path没有啊
xtb静态编译 体积变大不奇怪

292

帖子

0

威望

1813

eV
积分
2105

Level 5 (御坂)

发表于 Post on 2019-12-28 22:32:38 | 显示全部楼层 Show all
wuzhiyi 发表于 2019-12-28 02:30
你把ninja加进path没有啊
xtb静态编译 体积变大不奇怪

正确设置了ninja的soft link,这次可以直接找到ninja了,但第三步的报错跟原来一样
怀疑可能是我的ifort的问题
申请了个2019的intel编译包,四五天了还没消息。。

375

帖子

2

威望

1525

eV
积分
1940

Level 5 (御坂)

 楼主 Author| 发表于 Post on 2019-12-30 04:49:59 | 显示全部楼层 Show all
霜晨月 发表于 2019-12-28 22:32
正确设置了ninja的soft link,这次可以直接找到ninja了,但第三步的报错跟原来一样
怀疑可能是我的ifort ...

ifort居然会有问题,我建议你去github上提个issue

292

帖子

0

威望

1813

eV
积分
2105

Level 5 (御坂)

发表于 Post on 2020-1-6 14:26:49 | 显示全部楼层 Show all
折腾了N天,终于编译出来了,简单报告一下结果。

ifort和icc尝试了好几个版本,最后用的是Intel compilers_and_libraries_2019.1.144(就是2019 update 1)。
编译出来的xtb 18MB,比官方的版本小了不少,不知道怎么回事。
这个xtb运行时还要依赖Intel compilers_and_libraries_2019.1.144,看来这个6.7GB的toolkit只能一直留着了。

测速结果:
硬件Xeon E5-2699 v4 双路,主频 2.20GHz
Amber18,gfortran编译(之前我也用ifort编译过,但速度与gfortran版本无明显差别,且MM/PBSA工具无法使用,后来被我删了)
orca版本是 4.2.1
sander都用串行版单核运行。步长 1 fs。
QM region 102 atoms: 43 ps/day
QM region 144 atoms: 25.6 ps/day
感觉并行效率很差,单核和2核(%pal nprocs 2 end)速度看不出差别。其实,即便是单核运行时,sander和otool_xtb的CPU占用也达不到100%,连70%都很难达到。估计是三个程序来回调用,大部分时间花费在中间的折腾上了。

粗测结果仅供参考哈,如果我的设置有什么问题敬请达人指正^_^

375

帖子

2

威望

1525

eV
积分
1940

Level 5 (御坂)

 楼主 Author| 发表于 Post on 2020-1-7 01:46:08 | 显示全部楼层 Show all
霜晨月 发表于 2020-1-6 14:26
折腾了N天,终于编译出来了,简单报告一下结果。

ifort和icc尝试了好几个版本,最后用的是Intel compile ...

我也觉得效率差,主要时间都在读写文件上了,不过我感兴趣的东西一般20ps就好收敛,挂一晚上第二天就好。。。所有也没动力。

13

帖子

0

威望

75

eV
积分
88

Level 2 能力者

发表于 Post on 2020-1-15 10:22:37 | 显示全部楼层 Show all
wuzhiyi 发表于 2019-11-16 22:14
应该是
我一般就git clone https://github.com/xiki-tempula/xtb.git

,虽然有Holger Kruse写了一个amber/xtb的interface,   ------------------  请问,Holger Kruse 的这篇关于amber/xtb的interface 文献 名字叫什么呀?  

本版积分规则 Credits rule

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

GMT+8, 2023-2-7 04:29 , Processed in 0.226817 second(s), 25 queries .

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