epfl-theos / koopmans

Implementation of Koopmans-compliant functionals in Quantum ESPRESSO
https://koopmans-functionals.org
GNU General Public License v2.0
13 stars 5 forks source link

Error when running koopmans from within a directory that is a symlink #214

Open similt opened 11 months ago

similt commented 11 months ago

I am running tutorial_1 job in koopman tutorial folder and getting error:

ValueError: "pseudo_dir" and "pseudo_library" are conflicting; please do not provide "pseudo_dir"

Do you know how to solve this issue?

elinscott commented 11 months ago

:wave: thanks for reaching out and creating an issue. These two settings are mutually exclusive -- you should only specify one of pseudo_library and pseudo_dir.

I am surprised that you encountered this error while completing the tuturials. Can you please provide a few more details about what you were doing when you encountered the error? Can you also provide the python traceback of the error, please? You can obtain this by running koopmans with the --traceback flag.

similt commented 11 months ago

@elinscott Thanks for the quick response.

koopmans --traceback si.json

SyntaxWarning: "is not" with a literal. Did you mean "!="? Traceback (most recent call last): File "/project/k1641/koopmans/bin/koopmans", line 8, in sys.exit(main()) File "/project/k1641/koopmans/src/koopmans/cli/main.py", line 26, in main workflow = read(args.json) File "/project/k1641/koopmans/src/koopmans/io/_generic.py", line 36, in read out = read_json(fd, kwargs) File "/project/k1641/koopmans/src/koopmans/io/_json.py", line 54, in read_json return workflow_cls.fromjson(fd.name, override) File "/project/k1641/koopmans/src/koopmans/workflows/_workflow.py", line 995, in fromjson wf = cls._fromjsondct(bigdct, override) File "/project/k1641/koopmans/src/koopmans/workflows/_workflow.py", line 1114, in _fromjsondct wf = cls(atoms, parameters=parameters, kpoints=kpts, calculator_parameters=calculator_parameters, kwargs, File "/project/k1641/koopmans/src/koopmans/workflows/_wannierize.py", line 34, in init super().init(*args, **kwargs) File "/project/k1641/koopmans/src/koopmans/workflows/_workflow.py", line 217, in init raise ValueError( ValueError: "pseudo_dir" and "pseudo_library" are conflicting; please do not provide "pseudo_dir"

I don't have a pseudo_dir keyword in my si.json.

elinscott commented 11 months ago

OK, strange. Can you please...

similt commented 11 months ago

si.json

Here is the output of pip show koopmans

Name: koopmans Version: 1.0.1 Summary: Koopmans spectral functional calculations with python and Quantum ESPRESSO Home-page: Author: Author-email: Edward Linscott edward.linscott@epfl.ch, Riccardo De Gennaro riccardo.degennaro@epfl.ch, Nicola Colonna nicola.colonna@psi.ch License: Location: /lustre2/project/k1641/koopmans/lib/python3.9/site-packages Editable project location: /lustre2/project/k1641/koopmans Requires: argparse, ase-koopmans, cloudpickle, deepdiff, iniconfig, matplotlib, numpy, pandas, pybtex, scikit-learn, scipy, spglib, toml, typing, upf-to-json Required-by:

elinscott commented 11 months ago

I am struggling to reproduce the error. I assume you have installed koopmans by cloning the git repo rather than via PyPI. If so, what is the hash of the most recent commit to koopmans? You can get this by running git rev-parse HEAD in /lustre2/project/k1641/koopmans.

similt commented 11 months ago

Yes. I cloned the git repo. Hash value is

bbefdfcda97ce005ebdd1341d5e9a8d0c77e9930

These are the loaded modules while installing:

module switch intel intel-classic/2021.4.0 module load cray-python/3.9.4.1

elinscott commented 11 months ago

I cannot reproduce the error with the same input file and the same version of the code. Very mysterious! I would sincerely hope that the particular modules will not affect things.

Are you able to reproduce this issue on a different machine? You would not need to compile QE in order to reproduce the bug -- all you should need to do is clone the repo again, create a virtual environment, activate the virtual environment, pip install ., and then try running koopmans si.json.

Sorry for the hassle, but what is going wrong in this instance is not obvious!

similt commented 11 months ago

@elinscott Thank you very much for your assistance. Our computational scientist, who is in charge of installing the software, has identified and resolved the issue. The problem was traced back to line #216 of 'src/koopmans/workflows/_workflow.py

Our installation path is “/project” is a symlink to “/lustre2/project”. The value of “pseudo_dir” after “.resolve()” is “/lustre2/project”, which is different from the one before “.resolve()”: “/project”. And that is why we got the error message “"pseudo_dir" and "pseudo_library" are conflicting; please do not provide "pseudo_dir"”.

elinscott commented 11 months ago

OK, thanks for the information. I am reopening this issue (and giving it a more informative title) because I think it would be good for koopmans to be robust to being run in a directory is a symlink, and when I have the time I will try and fix this.