Page 1 of 1

Error in piloting DOS

Posted: Sun Jan 15, 2023 9:06 am
by Sherif_Yehia1
Dear Users and experts

I am new users in vasp and need your help
Please see following I am trying to Use py4vasp to plot the DOS as written in the tutorial part2 and keep getting the following error
Any advisable comments would appreciated
Thank you

1- (base) [sherifyehia@192 e07_CO-partial-dos]$ conda activate py4vasp-env
2- (py4vasp-env) [sherifyehia@192 e07_CO-partial-dos]$ ls
CHG CONTCAR EIGENVAL INCAR OSZICAR PCDAT POTCAR py4vasp vasprun.xml XDATCAR
CHGCAR DOSCAR IBZKPT KPOINTS OUTCAR POSCAR PROCAR REPORT WAVECAR
(py4vasp-env) [sherifyehia@192 e07_CO-partial-dos]$ python
Python 3.8.15 (default, Nov 24 2022, 15:19:38)
[GCC 11.2.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import py4vasp
>>> my_calc = py4vasp.Calculation.from_path("./e07_CO-partial-dos")
>>> my_calc.dos.plot()
Traceback (most recent call last):
File "/home/sherifyehia/anaconda3/envs/py4vasp-env/lib/python3.8/site-packages/py4vasp/raw/file.py", line 44, in __init__
self._h5f = h5py.File(filename, "r")
File "/home/sherifyehia/anaconda3/envs/py4vasp-env/lib/python3.8/site-packages/h5py/_hl/files.py", line 533, in __init__
fid = make_fid(name, mode, userblock_size, fapl, fcpl, swmr=swmr)
File "/home/sherifyehia/anaconda3/envs/py4vasp-env/lib/python3.8/site-packages/h5py/_hl/files.py", line 226, in make_fid
fid = h5f.open(name, flags, fapl=fapl)
File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "h5py/h5f.pyx", line 106, in h5py.h5f.open
FileNotFoundError: [Errno 2] Unable to open file (unable to open file: name = '/home/sherifyehia/TUTORIALS/molecules-part2/e07_CO-partial-dos/e07_CO-partial-dos', errno = 2, error message = 'No such file or directory', flags = 0, o_flags = 0)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/sherifyehia/anaconda3/envs/py4vasp-env/lib/python3.8/site-packages/py4vasp/data/_base.py", line 121, in wrapper
with instance._data_dict_from_context() as data_dict:
File "/home/sherifyehia/anaconda3/envs/py4vasp-env/lib/python3.8/contextlib.py", line 113, in __enter__
return next(self.gen)
File "/home/sherifyehia/anaconda3/envs/py4vasp-env/lib/python3.8/site-packages/py4vasp/data/_base.py", line 95, in _from_file
context = raw.File(file)
File "/home/sherifyehia/anaconda3/envs/py4vasp-env/lib/python3.8/site-packages/py4vasp/raw/file.py", line 53, in __init__
raise exception.FileAccessError(error_message) from err
py4vasp.exceptions.exceptions. FileAccessError: Error opening /home/sherifyehia/TUTORIALS/molecules-part2/e07_CO-partial-dos/e07_CO-partial-dos to read the data. Please check that you already completed the Vasp calculation and that the file is indeed in the directory. Please also check whether you are running the Python script in the same directory or pass the appropriate filename including the path.

Re: Error in piloting DOS

Posted: Mon Jan 23, 2023 9:33 am
by andreas.singraber
Hello!

I think you are missing the HDF5 output file which VASP generates when you compile it with -DVASP_HDF5 (see blue info box here). Although there are output files in your example folder, I do not see the .h5 files which are read by py4vasp.

Please try recompiling VASP with HDF5 support and try to run the example again!

Best,
Andreas Singraber

Re: Error in piloting DOS

Posted: Mon Jan 23, 2023 3:08 pm
by Sherif_Yehia1
Thank you very much

May be I am doing something wrong but I just send another inquires

because when I put CPP_OPTIONS on i.e.

# HDF5-support (optional but strongly recommended)
CPP_OPTIONS += -DVASP_HDF5
HDF5_ROOT ?= /usr/local/hdf5
LLIBS += -L$(HDF5_ROOT)/lib -lhdf5_fortran -lhdf5
INCS += -I$(HDF5_ROOT)/include

I am keep getting the following error I am using

vhdf5_base.o: In function `vhdf5_base_mp_vh5_start_':
vhdf5_base.f90:(.text+0x46): undefined reference to `h5lib_mp_h5open_f_'
vhdf5_base.f90:(.text+0x52): undefined reference to `h5global_mp_h5p_link_create_f_'
vhdf5_base.f90:(.text+0x60): undefined reference to `h5p_mp_h5pcreate_f_'
vhdf5_base.f90:(.text+0x7a): undefined reference to `h5p_mp_h5pset_create_inter_group_f_'
vhdf5_base.o: In function `vhdf5_base_mp_vh5_end_':
vhdf5_base.f90:(.text+0x96): undefined reference to `h5lib_mp_h5close_f_'
vhdf5_base.o: In function `vhdf5_base_mp_vh5_file_open_read_':
vhdf5_base.f90:(.text+0xa8): undefined reference to `h5global_mp_h5f_acc_rdonly_f_'
vhdf5_base.f90:(.text+0xb4): undefined reference to `h5f_mp_h5fopen_f_'

My hdf5 is hdf5-1.13.3 system Centos8 Intel FORTRAN compiler

Please see part my makefile.include the rest NO change

VASP_TARGET_CPU ?= -march=core-avx2
FFLAGS += $(VASP_TARGET_CPU)

# Intel MKL (FFTW, BLAS, LAPACK, and scaLAPACK)
# (Note: for Intel Parallel Studio's MKL use -mkl instead of -qmkl)
FCL += -qmkl
MKLROOT ?= /opt/intel/oneapi/mkl/2023.0.0/lib/intel64
LLIBS += -L$(MKLROOT)/lib/intel64 -lmkl_scalapack_lp64 -lmkl_blacs_intelmpi_lp64 -lmkl_intel_lp64 -lmkl_intel_thread
INCS =-I$(MKLROOT)/include/fftw

# HDF5-support (optional but strongly recommended)
CPP_OPTIONS += -DVASP_HDF5
HDF5_ROOT ?= /usr/local/hdf5
LLIBS += -L$(HDF5_ROOT)/lib -lhdf5_fortran -lhdf5
INCS += -I$(HDF5_ROOT)/include

# For the VASP-2-Wannier90 interface (optional)
#CPP_OPTIONS += -DVASP2WANNIER90
#WANNIER90_ROOT ?= /path/to/your/wannier90/installation
#LLIBS += -L$(WANNIER90_ROOT)/lib -lwannier

# For the fftlib library (hardly any benefit in combination with MKL's FFTs)
FCL = mpiifort fftlib.o -qmkl
CXX_FFTLIB = icpc -qopenmp -std=c++11 -DFFTLIB_USE_MKL -DFFTLIB_THREADSAFE
INCS_FFTLIB = -I./include -I$(MKLROOT)/include/fftw
LIBS += fftlib

Thank for your effort and time