ValueError: Incorrect value of vasp_type given (None). Please open an issue if you are certain this WAVECAR was generated with the given vasp_type

Dear developer,

I find a bug in the amset wave.

amset wave
******* Getting wavefunction coefficients *******

Including bands 37—51

Traceback (most recent call last):
  File "/home/user/.local/bin/amset", line 8, in <module>
    sys.exit(cli())
  File "/home/user/Zhibin/software/ENTER/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/user/Zhibin/software/ENTER/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/user/Zhibin/software/ENTER/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/user/Zhibin/software/ENTER/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/user/Zhibin/software/ENTER/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/user/.local/lib/python3.8/site-packages/amset/tools/wavefunction.py", line 91, in wave
    coeffs, gpoints = _wavefunction_vasp(
  File "/home/user/.local/lib/python3.8/site-packages/amset/tools/wavefunction.py", line 112, in _wavefunction_vasp
    wf = get_wavefunction(wavecar=wavecar, directory=directory, vasp_type=vasp_type)
  File "/home/user/.local/lib/python3.8/site-packages/amset/wavefunction/vasp.py", line 28, in get_wavefunction
    return Wavecar(wavecar, vasp_type=vasp_type)
  File "/home/user/Zhibin/software/ENTER/lib/python3.8/site-packages/pymatgen/io/vasp/outputs.py", line 5081, in __init__
    raise ValueError(
ValueError: Incorrect value of vasp_type given (None). Please open an issue if you are certain this WAVECAR was generated with the given vasp_type.

In this situation, I used kmesh is 10x10x10, when I reduced to 5x5x5, everything is OK. I am sure my memory is sufficient.

Thanks a lot!

Best wishes,
Zhibin

This is a limitation of the pymatgen Wavecar class. See this issue for more details and also this thread discussing the same problem. This seems to occur when the WAVECAR file is too large to be read into memory.

Just to confirm, how large is your WAVECAR file?

The best options are:

  1. Ensure that your calculation is using symmetry (ISYM = 2 for GGA calculations and ISYM = 3 for hybrids). This will reduce the number of k-points and dramatically minimise the file size.
  2. Use a smaller k-point mesh; technically, the wavefunction.h5 file does not have to be from the same calculation as the vasprun.xml used to interpolate the band structure.

Other, less ideal options are:

  1. Ensure the number of empty bands is not too large.
  2. Use a smaller ENCUT.

Best,
Alex

Thanks for your great help!

I want to report a typo in the website: https://hackingmaterials.lbl.gov/amset/inputs/
in the Elastic constants part, the title is: “VASP settings for dielectric constants and phonon frequency” should be “VASP settings for Elastic constants”. I am not sure…

Best wishes,
Zhibin

1 Like

Thank you! I will update the website now.

Dear Alex,
I hope you are doing well.
I trying to do amset calculation as follow:
1- I have calculated the wavefunction coefficients using a small k-mesh.
2- I am using the vasprun.xml using the dense mesh but I am getting the following error message:
“Overlap calculator does not have the correct number of
bands\n”
RuntimeError: Overlap calculator does not have the correct number
of bands
If using wavefunction coefficients, ensure they were generated
using the same energy_cutoff (not encut)
I have checked that the number of bands in both cases are equal. Can you help me how to solve this problem. I have used the same INCAR file for both calculations.

Hi Aamir,

Apologies, this is not very clear in the documentation. The issue is not whether the WAVECAR and vasprun.xml calculations have the same number of bands, but rather if the same number of bands fall in the energy-cutoff used in the scattering rate calculation (default is 1.5 eV). In semiconductors, this cut-off is defined separately for the valence band maximum and conduction band minimum (i.e., any bands that have an energy within 1.5 of either band edge will be included in the transport calculations).

The k-point mesh used can change the number of bands that fall within the energy cutoff, as at denser k-point meshes you may find a different minima/maxima and you may also see greater dispersion of the eigenvalues away from the band edge.

When you run amset wave or amset deform read the number of bands within the energy cutoff is written at the top of the output. I.e.,

******* Getting wavefunction coefficients *******

Including bands 14—19

This should match the number of bands that falls within the cutoff when doing amset run. This is printed in the interpolation section, i.e:

  ~~~~~~~~~~~~~~~~~~~~~~~~~~ INTERPOLATION ~~~~~~~~~~~~~~~~~~~~~~~~~~

  Getting band interpolation coefficients
    └── time: 15.4102 s

  Interpolation parameters:
    ├── k-point mesh: 183x183x97
    └── energy cutoff: 1.5 eV

  Interpolating spin-up bands 14-19
    └── time: 41.0465 s

If you see the error message RuntimeError: Overlap calculator does not have the correct number of bands then you have two options:

  1. You can try and adjust the --energy-cutoff option in amset wave and amset deform to get the number of bands to match the number from amset run. (This is not recommended).
  2. The better method is to use the --bands option to select exactly which bands to extract. For example, if you want to extract the bands 18 to 25 (inclusive and 1-indexed), you should run amset wave --bands 18:25 or similarly amset deform read ... --bands 18:25.

I just noticed that the --bands option was not enabled for amset wave, so I have just added it in and released a new version. Therefore you should upgrade to v0.4.7 before trying the above commands.

Please let me know if that fixes your problem.

Best,
Alex

Dear Alex,
Thank your help. Can we control the number of bands in amset run calculation?
If we include more bands in the amset wave calculation it gives the previous error message mentioned in the subject.

Dear Aamir,

Currently you can’t control the number of bands in the amset run calculation. However, I don’t understand your question? Which error message are you seeing?

The error: ValueError: Incorrect value of vasp_type given (None). Please open an issue if you are certain this WAVECAR was generated with the given vasp_type. cannot be triggered by changing the number of bands to extract. That is only caused by the size of the WAVECAR file.

Are you sure you ran the amset wave command on the correct WAVECAR file?

Best,
Alex

Dear Alex,
Yes, you are correct I have successfully extracted the wavefunction coefficients. I was using the other WAVECAR file. I have another question regarding the memory issue:
I am trying to calculate the transport properties using the following setting file:
scattering_type: [ADP, POP]
doping: 1E17
temperatures: [300]
bandgap: 0.24

electronic_structure settings

interpolation_factor: 1

materials properties

deformation_potential: deformation.h5
elastic_constant:

  • [59.4286, 31.2180, 25.7319, -9.3846, 4.9133, -5.5087]
  • [31.2180, 79.3093, 15.7337, 6.1558, -8.4698, -16.9524]
  • [25.7319, 15.7337, 84.9620, 1.6238, 3.4072, 21.5190]
  • [-9.3846, 6.1558, 1.6238, 40.4734, -17.0359, 4.9001]
  • [4.9133, -8.4698, 3.4072, -17.0359, 25.8793, 1.4816]
  • [-5.5087, -16.9524, 21.5190, 4.9001, 1.4816, 35.0019]
    static_dielectric:
  • [76.322326, -7.936934, -4.659721]
  • [-7.936985, 125.197334, -.736586]
  • [-4.659809, -.736631, 126.026956]
    high_frequency_dielectric:
  • [45.367510, -0.305902, -0.179430]
  • [-0.305953, 47.251433, -0.028394]
  • [-0.179518, -0.028439, 47.283183]
    pop_frequency: 2.31

performance settings

cache_wavefunction: false
write_mesh: true

Can you suggest to me how to solve the memory issue? I am using 1 core per node (memory is 128 GB).

Hi Aamir.

I am an unsure of the error? I can you post the full log, please.

File "/lustre/project/k1388/shafiq/CSLD-

AMSET/install4/lib/python3.7/site-packages/click/core.py", line
782, in main
rv = self.invoke(ctx)
File “/lustre/project/k1388/shafiq/CSLD-
AMSET/install4/lib/python3.7/site-packages/click/core.py”, line
1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/lustre/project/k1388/shafiq/CSLD-
AMSET/install4/lib/python3.7/site-packages/click/core.py”, line
1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/lustre/project/k1388/shafiq/CSLD-
AMSET/install4/lib/python3.7/site-packages/click/core.py”, line
610, in invoke
return callback(*args, **kwargs)
File “/lustre/project/k1388/shafiq/CSLD-
AMSET/install4/amset/amset/tools/run.py”, line 139, in run
runner.run()
File “/lustre/project/k1388/shafiq/CSLD-
AMSET/install4/amset/amset/core/run.py”, line 67, in run
multiprocess=True,
File “/lustre/project/k1388/shafiq/CSLD-
AMSET/install4/lib/python3.7/site-packages/memory_profiler.py”,
line 336, in memory_usage
returned = f(*args, **kw)
File “/lustre/project/k1388/shafiq/CSLD-
AMSET/install4/amset/amset/core/run.py”, line 116, in _run_wrapper
amset_data, scattering_time = self._do_scattering(amset_data)
File “/lustre/project/k1388/shafiq/CSLD-
AMSET/install4/amset/amset/core/run.py”, line 270, in
_do_scattering
scatter.calculate_scattering_rates(), scatter.scatterer_labels
File “/lustre/project/k1388/shafiq/CSLD-
AMSET/install4/amset/amset/scattering/calculate.py”, line 367, in
calculate_scattering_rates
) = self.calculate_band_rates(spin, b_idx)
File “/lustre/project/k1388/shafiq/CSLD-
AMSET/install4/amset/amset/scattering/calculate.py”, line 437, in
calculate_band_rates
ir_idx, elastic_rates[…, ir_idx] =
self._get_rate_from_queue()
File “/lustre/project/k1388/shafiq/CSLD-
AMSET/install4/amset/amset/scattering/calculate.py”, line 496, in
_get_rate_from_queue
return self._get_rate_from_queue()
File “/lustre/project/k1388/shafiq/CSLD-
AMSET/install4/amset/amset/scattering/calculate.py”, line 496, in
_get_rate_from_queue
return self._get_rate_from_queue()
File “/lustre/project/k1388/shafiq/CSLD-
AMSET/install4/amset/amset/scattering/calculate.py”, line 492, in
_get_rate_from_queue
"Some subprocessess were killed unexpectedly. Could be OOM "
MemoryError: Some subprocessess were killed unexpectedly. Could be
OOM Killer?
Try reducing nworkers.
semaphore_tracker: process died unexpectedly, relaunching. Some semaphores might leak.
^M ├── elastic: 0%| | 00:30<?

Hi Aamir,

Would you be able to post the full log message? Just so I can see what else happened before this?

One possibility is that you are using too many workers. The default is nworkers: -1 which is to use all available processors. However, sometimes this gets set too high and causes crashes such as this. To start with you can try setting nworkers: 1, and then increase the number until you get the memory error.

Best,
Alex

Actually, I have just reread your original message. If you are selecting 1 core per node, then you must set nworkers: 1 otherwise it will try and use all the cores the node has and crash.

Dear Alex,
Thank you for your help. It starts working when I used nworkers: 1.

Dear Alex,
I have solved the memory issue by reducing the nwokers value but now the calculation takes a very long time. When I doubled the number of nodes and double the nworkers I get the memory problem again. Can you suggest to me how to speed up the calculation.

Hi Aamir,

Just to check, when you say nodes do you mean cores or nodes?

AMSET can only be run on a single node, but it can use up to all of the processors on that node. I.e., if the node has 16 cores, then the max you can set is nworkers: 16, and you should request 1 node with 16 cores per node.

Best,
Alex