Memory allocation error when running hybrid functional band structure with KPOINTS_OPT (WRK ALLOCATE: ERROR)

Queries about input and output files, running specific calculations, etc.


Moderators: Global Moderator, Moderator

Post Reply
Message
Author
shihao_tu
Newbie
Newbie
Posts: 3
Joined: Thu Oct 30, 2025 4:45 pm

Memory allocation error when running hybrid functional band structure with KPOINTS_OPT (WRK ALLOCATE: ERROR)

#1 Post by shihao_tu » Wed Nov 12, 2025 4:16 pm

Dear VASP developers and users,

I am trying to perform a hybrid functional (PBE0) band structure calculation for a supercell, using KPOINTS (Gamma-only) for the SCF step and KPOINTS_OPT for the band structure step.

The SCF part runs well, but when the calculation enters the KPOINTS_OPT stage, it immediately crashes with the following error message:

WRK ALLOCATE: ERROR: could not allocate enough workspace. Try reducing NBLOCK_FOCK.

Even after I set: KPOINTS_OPT_NKBATCH = 1 NBLOCK_FOCK = 32 , the error still appears.

I understand that NCORE = 1 is required for the hybrid band-structure step with KPOINTS_OPT, but even when following this, the memory allocation error persists. Is there any other recommended combination of parallelization parameters for hybrid-functional band-structure runs using KPOINTS_OPT?

Best,
Shihao


marie-therese.huebsch
Sr. Member
Sr. Member
Posts: 285
Joined: Tue Jan 19, 2021 12:01 am

Re: Memory allocation error when running hybrid functional band structure with KPOINTS_OPT (WRK ALLOCATE: ERROR)

#2 Post by marie-therese.huebsch » Thu Nov 13, 2025 7:46 am

Dear Shihao,

Thank you for bringing this to our attention. Could you please share a minimal reproducible example including the technical details of your hardware? From the top of my head, I am not sure how to fix this problem, but we will look into it.


shihao_tu
Newbie
Newbie
Posts: 3
Joined: Thu Oct 30, 2025 4:45 pm

Re: Memory allocation error when running hybrid functional band structure with KPOINTS_OPT (WRK ALLOCATE: ERROR)

#3 Post by shihao_tu » Thu Nov 13, 2025 10:57 pm

I previously mentioned that the problem could be alleviated by increasing the number of nodes to reduce the memory load, but now I’ve encountered a new issue. This time, it’s a bug that I need to report to the developers. When I use a hybrid functional to calculate the supercell band structure, it can run a few steps of the KPOINTS_OPT band calculation, but then it stops midway and crashes with an error!

The bug said
internal error in: mkpoints_full.F at line: 992
internal error in CHECK_GEN_LAYOUT: G-vectors changed 8 1034 -35
-36 17 17 0 0
If you are not a developer, you should not encounter this problem.
Please submit a bug report.

Actually, when I compute the primitive cell (3 atoms), I don’t meet this problem!

Here is a reproducible example.

You do not have the required permissions to view the files attached to this post.

marie-therese.huebsch
Sr. Member
Sr. Member
Posts: 285
Joined: Tue Jan 19, 2021 12:01 am

Re: Memory allocation error when running hybrid functional band structure with KPOINTS_OPT (WRK ALLOCATE: ERROR)

#4 Post by marie-therese.huebsch » Mon Dec 01, 2025 8:19 am

Sorry for the long scilence. Unfortunately the forum had a system change and we did not notice that the notification where not send for quite some time. So I totally missed your response. I will look into it this week and get back to you with an update asap.


marie-therese.huebsch
Sr. Member
Sr. Member
Posts: 285
Joined: Tue Jan 19, 2021 12:01 am

Re: Memory allocation error when running hybrid functional band structure with KPOINTS_OPT (WRK ALLOCATE: ERROR)

#5 Post by marie-therese.huebsch » Mon Dec 01, 2025 10:16 am

Some comments and questions I have before I can reproduce the bug :

  • Did you try to run a simple LDA or PBE calculation first?

  • Do you really want to initialize a magnetic moment of 1 muB on every site?

  • It's better to remove tags that are not required for your calculation. E.g. for a static calculation, you don't need EDIFFG.

  • EDIFF = 1E-3 is just to create a quick test calculation, right? I am unsure since you left other tags in like LORBIT, EDIFFG and ALGO=All. I'd rather set NELM to stop after a few steps (e.g. 6) and ALGO=Fast to test the setup.

  • Why are you reducing NELMDL?

  • Was that a restart from a previous WAVECAR? There is no stdout so I don't see it. But with ISTART = 1, ICHARG = 0 I cannot start this calculation without a WAVECAR. It will be total nonesense to initialize the Kohn-Sham orbitals with random numbers and then generate a density based on that.

Sorry for the random order. Please be so kind and share your thoughts on the above and I will continue working on this issue (without delay, I promise).


Post Reply