Open mbarbry opened 4 years ago
Looks new to me. I will try to have a look.
El sáb., 30 nov. 2019 9:55, mbarbry notifications@github.com escribió:
Dear @masmansouri https://github.com/masmansouri and @kovalp https://github.com/kovalp
Here is the error that I get when setting rescf=True in gw_iter. However, it occurred at the moment only with this specific system. It did not give issues for small molecules.
AttributeError: 'gw_iter' object has no attribute '_add_suffix' Exception ignored in: <function VHFOpt.del at 0x7f7a23aaba60> Traceback (most recent call last): File "/home/marc/programs/pyscf/pyscf/scf/_vhf.py", line 92, in del libcvhf.CVHFdel_optimizer(ctypes.byref(self._this)) AttributeError: 'VHFOpt' object has no attribute '_this'
gw_iter_error.zip https://github.com/cfm-mpc/pyscf/files/3906925/gw_iter_error.zip
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/cfm-mpc/pyscf/issues/15?email_source=notifications&email_token=ACAKSHHAHJXSXALAJLT24A3QWITANA5CNFSM4JTFVW62YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H47S2XQ, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACAKSHFH6AOZPPESU2AEMETQWITANANCNFSM4JTFVW6Q .
It is probably caused by some changes after the rebase with upstream. I get this error on nao2 branch.
Can you help me with compilation?
I follow the instructions in nao/README.md
copied the cmake.user.inc cd build cmake .. cmake finds FFTW3 /usr/lib/x86_64-linux-gnu
I compile, go to nao/test
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu
trying to run the first test.
____ ERROR collecting pyscf/nao/test/test_0001_nao.py
/home/kovalp/envs/py37-pyside2/lib/python3.7/site-packages/py/_path/local.py:701:
in pyimport
import(modname)
../init.py:25: in
On Sat, Nov 30, 2019 at 10:12 AM mbarbry notifications@github.com wrote:
It is probably caused by some changes after the rebase with upstream. I get this error on nao2 branch.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/cfm-mpc/pyscf/issues/15?email_source=notifications&email_token=ACAKSHFIRT7ATMLDITUF5WDQWIVBHA5CNFSM4JTFVW62YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFP6HUY#issuecomment-559932371, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACAKSHF7CACZPAPB5W7F6ETQWIVBHANCNFSM4JTFVW6Q .
@mbarbry
To compile I usually use (ubuntu 18.04),
export CC=gcc && export FC=gfortran && export CXX=g++
cd pyscf && git fetch && git checkout nao2 && cd pyscf/lib
cp cmake_user_inc_examples/cmake.user.inc-singularity.anaconda.gnu.mkl cmake.arch.inc
mkdir build && cd build && cmake .. && make VERBOSE=1
Then I export
export PYTHONPATH=/opt/pyscf:$PYTHONPATH
export LD_LIBRARY_PATH=/opt/pyscf/pyscf/lib/deps/lib:${LD_LIBRARY_PATH}
Hi, by following the above procedure which is a standard way to compile pyscf, I just successfully installed it. I used to compile with another arch file like cmake.user.inc-nao-gnu that no longer works due to the inaccessible link for cloning the libxc in tddft.org webpage. After installation using mkl root as you mentioned, when I tried to import pyscf.nao modules, for example in Ipython, it gives an error as follows:
Python 3.7.3 (default, Mar 27 2019, 22:11:17) Type 'copyright', 'credits' or 'license' for more information IPython 7.6.1 -- An enhanced Interactive Python. Type '?' for help.
OSError Traceback (most recent call last)
Looks like it does not find the library somehow. I will give a try in a virtualbox. Could you send me the cmake.arch that you use.
I downgraded the gcc to the older version, i.e. g++ (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0. I also tried different mkl roots in the arch file, but all failed to import modules.
Dear @masmansouri and @kovalp
I managed to install and run pyscf-nao on a clean system (linux mint 19.2) following the instructions below
apt-get update
apt-get upgrade
apt-get -y install git wget curl htop gcc gfortran vim build-essential liblapack-dev libfftw3-dev make cmake zlib1g-dev
wget https://repo.anaconda.com/archive/Anaconda3-2019.10-Linux-x86_64.sh
bash Anaconda3-2019.10-Linux-x86_64.sh
bash
mkdir -p anaconda3/lib/mkl/lib
ln -s ~/anaconda3/lib/libmkl_* ~/anaconda3/lib/mkl/lib/
export CC=gcc && export FC=gfortran && export CXX=g++
git clone https://github.com/cfm-mpc/pyscf.git
cd pyscf
git fetch
git checkout nao2
cd pyscf/lib
cp cmake_user_inc_examples/cmake.user.inc-singularity.anaconda.gnu.mkl cmake.arch.inc
Edit the cmake.arch.inc that it properly find mkl
Use a full path for MKLROOT, and don't use ~
for your home folder path, it could not compile in my case
export LD_LIBRARY_PATH=~/anaconda3/lib/mkl/lib:{LD_LIBRARY_PATH}
mkdir build && cd build
cmake .. && make
Once pyscf is build, add the following variable to your bash
export PYTHONPATH=~/pyscf:${PYTHONPATH}
export LD_LIBRARY_PATH=~/pyscf/pyscf/lib/deps/lib:${LD_LIBRARY_PATH}
then you can go to nao test folder, and you should be able to run the tests
Thank you. I was not able to do anything so far. I have made a bad experience with anaconda. Therefore, I will try it differently. The best would be to have a pip package.
El dom., 1 dic. 2019 12:12, mbarbry notifications@github.com escribió:
Dear @masmansouri https://github.com/masmansouri and @kovalp https://github.com/kovalp
I managed to install and run pyscf-nao on a clean system (linux mint 19.2) following the instructions below Instruction to install pyscf-nao
apt-get update apt-get upgrade apt-get -y install git wget curl htop gcc gfortran vim build-essential liblapack-dev libfftw3-dev make cmake zlib1g-dev wget https://repo.anaconda.com/archive/Anaconda3-2019.10-Linux-x86_64.sh bash Anaconda3-2019.10-Linux-x8664.sh bash mkdir -p anaconda3/lib/mkl/lib ln -s ~/anaconda3/lib/libmkl* ~/anaconda3/lib/mkl/lib/
export CC=gcc && export FC=gfortran && export CXX=g++ git clone https://github.com/cfm-mpc/pyscf.git cd pyscf git fetch git checkout nao2 cd pyscf/lib cp cmake_user_inc_examples/cmake.user.inc-singularity.anaconda.gnu.mkl cmake.arch.inc
Edit the cmake.arch.inc that it properly find mkl Use a full path for MKLROOT, and don't use ~ for your home folder path, it could not compile in my case
export LD_LIBRARY_PATH=~/anaconda3/lib/mkl/lib:{LD_LIBRARY_PATH} mkdir build && cd build cmake .. && make
Once pyscf is build, add the following variable to your bash
export PYTHONPATH=~/pyscf:${PYTHONPATH} export LD_LIBRARY_PATH=~/pyscf/pyscf/lib/deps/lib:${LD_LIBRARY_PATH}
then you can go to nao test folder, and you should be able to run the tests
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/cfm-mpc/pyscf/issues/15?email_source=notifications&email_token=ACAKSHCJDISGFWZJMZ5ZWNLQWOL2JA5CNFSM4JTFVW62YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFRFTAY#issuecomment-560093571, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACAKSHC4RO7IEXEBAMJL3LTQWOL2JANCNFSM4JTFVW6Q .
Thanks @mbarbry One clarification, which version of gcc you used to compile?
@mbarbry by following your recipe and gcc 7.4.0 installed and successfully passed tests.
I received a lot of "NumbaPerformanceWarning: np.dot() is faster on contiguous arrays, called on (array(float64, 2d, C), array(float64, 2d, A))" in most of the tests in gw class, e.g. test 0055-0058 calling rf0_den. Tests passed much much slower than the former algorithm! Also, a few tests mostly in tddft failed.
Hi @kovalp, I agree a pip package would be nice, but difficult to achieve with the number of dependencies.
I think docker is easier for such cases with many dependencies. You should try the singularity packages I wrote. https://gitlab.com/mbarbry/AbInitioToolkit
The recipe buildPySCF-NAO-Siesta.mkl.gpu
is the latest up to date.
@masmansouri I will try to see if I get also the warnings for the tests. I did not see any in the tests I run thought.
=============> Report: 142 succeeded and 14 failed.<================= FAILED TEST are: test_0044_h2_scf_gto_vs_nao_nao.py test_0046_tddft_gto_h2.py test_0049_high_telec.py test_0053_gw_si_ref.py test_0068_gw_f_atom.py test_0077_chlocal_water.py test_0079_recomp_hamilt_water.py test_0081_bse_nonin_gto_be.py test_0082_bse_gw_gto_be.py test_0083_gw_bse_h2_ae.py test_0085_mn_scf.py test_0095_h2_ae_fp_rescf.py test_0100_fireball.py test_0160_bse_h2b_uhf_gw.py =======================FINISHED! AT 15:10:24 ===================
Tests which are failed, mostly have problems with this new algorithm si_correlation in m_rf0 and a few have problems in original pyscf kernel like test 44 for which scf no longer has former attributes. "AttributeError: 'scf' object has no attribute 'incore_anyway".
test_0087_o2_gw.py
Branch nao: Ran 1 test in 15.622s
Branch nao2: Ran 1 test in 76.021s
A lot of warnings from Numba
/home/kovalp/programs/pyscf/pyscf/nao/m_rf0_den.py:122: NumbaPerformanceWarning: np.dot() is faster on contiguous arrays, called on (array(float64, 2d, A), array(float64, 2d, C))
Can we solve problems one-by-one, please? Namely, the improvements by Numba prove to be equivocal. So, why not merge from upstream first and then start to improve things.
Could I have nao2 without the performance degrading changes?
I will have a look at what goes wrong. In the tests I did, the numba changes were accelerating quite a lot the calculations.
To deactivate it you can set use_numba=False
in gw.py
There is a trouble with use_numba=False
pyscf.nao.gw dtype <class 'numpy.float64'>
pyscf.nao.gw 108
pyscf.nao.gw 113
pyscf.nao.gw 125
pyscf.nao.gw 138
pyscf.nao.m_kmat_den sm0_sum
E
======================================================================
ERROR: test_o2_gw_0087 (__main__.KnowValues)
----------------------------------------------------------------------
Traceback (most recent call last):
File "test_0087_o2_gw.py", line 21, in test_o2_gw_0087
gw.kernel_gw()
File "/home/kovalp/programs/pyscf/pyscf/nao/gw.py", line 427, in make_mo_g0w0
if not hasattr(self,'sn2eval_gw'): self.sn2eval_gw=self.g0w0_eigvals() # Comp. GW-corrections
File "/home/kovalp/programs/pyscf/pyscf/nao/gw.py", line 393, in g0w0_eigvals
sn2i = self.gw_corr_int(sn2eval_gw)
File "/home/kovalp/programs/pyscf/pyscf/nao/gw.py", line 279, in gw_corr_int
self.snmw2sf = self.get_snmw2sf()
File "/home/kovalp/programs/pyscf/pyscf/nao/gw.py", line 236, in get_snmw2sf
wpq2si0 = self.si_c(ww = 1j*self.ww_ia).real
File "/home/kovalp/programs/pyscf/pyscf/nao/gw.py", line 207, in si_c
si_correlation(rf0(self, ww), si0, ww, self.kernel_sq, self.nprod)
NameError: name 'rf0' is not defined
----------------------------------------------------------------------
Ran 1 test in 7.461s
FAILED (errors=1)
Moreover, this part of the code does not need to be optimized. It is to produce a reference result, not necessarily the fastest one.
@masmansouri which version do you normally use for production runs?
Ok, in the example that I have this function was always used and is the bottleneck by far.
gw_iter
is not calling it, but somehow is way slower than the non-iterative one I used.
The non-iterative code (not calling kernel_gw_iter
)
from __future__ import division
import os
import numpy as np
from pyscf.nao import gw_iter
dname = os.getcwd()
gw = gw_iter(label='siesta', cd=dname, verbosity=3, rescf=True, niter_max_ev=50,
write_w=True, gw_iter_tol=1e-4, tol_ev=1.0e-3)
gw.kernel_gw()
gw.report()
The iterative code (calling kernel_gw_iter
as pointed by Massoud)
from __future__ import division
import os
import numpy as np
from pyscf.nao import gw_iter
dname = os.getcwd()
gw = gw_iter(label='siesta', cd=dname, verbosity=3, rescf=True, niter_max_ev=50,
write_w=True, gw_iter_tol=1e-4, tol_ev=1.0e-3)
gw.kernel_gw_iter()
gw.report()
The first code needed 4.95e3 s, while the second 8.65e4 s.
Any idear why the iterative version is way slower in this case?
I agree with you @kovalp that it will be smarter to get the code to upstream before to start to play further. However, there are several issues that must be solved before to be able to merge with upstream.
scf
must be resolved@kovalp I still run my calculations using my repository
which had been pushed to nao branch on this commit's SHA:
555e061c347c8d2e49ffbd00d9f1c54eaddc9e99
on the weekend I tried nao2
on my laptop and errors and numba warnings are related to this branch.
I see. I need to explain how I started the merge from the upstream. I cannot promise I can finish it.
On Tue, Dec 3, 2019 at 11:12 AM Masoud Mansouri notifications@github.com wrote:
on the weekend I tried nao2 on my laptop and errors and numba warnings are related to this branch.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/cfm-mpc/pyscf/issues/15?email_source=notifications&email_token=ACAKSHC2TLPYNAPSK335SJ3QWYWG7A5CNFSM4JTFVW62YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFY2ONI#issuecomment-561096501, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACAKSHHWQCTTLYNG2HEA5HDQWYWG7ANCNFSM4JTFVW6Q .
Dear @masmansouri and @kovalp
Here is the error that I get when setting
rescf=True
in gw_iter. However, it occurred at the moment only with this specific system. It did not give issues for small molecules.gw_iter_error.zip