Issues about LKPROJ tag

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


Moderators: Global Moderator, Moderator

Post Reply
Message
Author
yujia_teng
Newbie
Newbie
Posts: 17
Joined: Thu May 25, 2023 6:24 pm

Issues about LKPROJ tag

#1 Post by yujia_teng » Thu Jul 03, 2025 3:01 am

Dear admin,
I'm using band4vasp to do band and fermi surface unfolding, which requires the LKPROJ tag. But I have 2 problems that i can't solve:

1.How much memory is required for a node to perform such job? I tested it in some systems. It only works for graphene. For the 2 other examples I attached below (one of them is with SOC+U), 'forrtl: severe (174): SIGSEGV, segmentation fault occurred' is found in the log file, which means not enough memory. So OUTCAR, PROCAR and some other output files were not finished.

2.In PRJCAR file, I found the high symmetry M point isn't correct. I set 0.5 0 but it becomes -0.5 0 in the file (see GdAuGe PRJCAR file). So the plotted unfolded band has unusual long M-K path because of this jump, which is obviously wrong (band is also attatched).

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

andreas.singraber
Global Moderator
Global Moderator
Posts: 308
Joined: Mon Apr 26, 2021 7:40 am

Re: Issues about LKPROJ tag

#2 Post by andreas.singraber » Fri Jul 04, 2025 2:47 pm

Hello!

Since the band4vasp and UnfoldingPatch4vasp software were new to me I had a discussion today with my colleagues about this topic. Unfortunately it seems the patch never made it into the maintained VASP source code. Hence, we officially cannot offer support for the modified code and its post-processing tool. It may be a good idea to also contact the developers directly (e.g. via Github issues) to resolve your problems.

However, there is an interest from our side to integrate the additional features offered by this patch finally into future VASP versions. Also, we would like to know whether the issues you observed are coming from patched code or official VASP source code:

  1. The segmentation fault can indeed be a sign of running out of memory. However, this is not the only possible cause and we would like to understand the origins of this error.

  2. As with the other issue we want to know whether this problem is introduced by the patch or already present in the regular VASP code.

In case the maintained VASP source is responsible for the issues we may be able to give useful advice to avoid them.

In order to be able to accurately reproduce the behavior I would like to ask you to provide some more data:

  • Please describe any preparatory steps you carry out,

  • upload all relevant input and output files (also for preparatory steps),

  • describe on which machines you where executing VASP (ideally add a submit script) and

  • which compilers and libraries were used to build VASP (ideally add a makefile.include)

I am sorry for insisting on this rather detailed information but without it we have to do a lot of guessing and may never be able to reproduce the problems.

Thank you!

All the best,
Andreas Singraber


yujia_teng
Newbie
Newbie
Posts: 17
Joined: Thu May 25, 2023 6:24 pm

Re: Issues about LKPROJ tag

#3 Post by yujia_teng » Sun Jul 06, 2025 11:25 pm

Dear Andreas,
I attach the additional files you required here. More detailed explanation is provided in the README.md file in it. CHGCAR file from 1st scf step is too large to be uploaded here.

I just do usual self-consistent calculation first, then the CHGCAR from this step is used for the following band calculations.

From my tests, I think the problem is from official VASP source code because 6.4.1 also has this problem.

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

andreas.singraber
Global Moderator
Global Moderator
Posts: 308
Joined: Mon Apr 26, 2021 7:40 am

Re: Issues about LKPROJ tag

#4 Post by andreas.singraber » Thu Jul 17, 2025 10:58 pm

Hello!

First of all, thanks a lot for the well-structured and nicely documented archive you sent, I really do appreciate that!

I have not finished investigating all issues yet but I have some preliminary results which I want to share with you. With two minor modifications to the already patched VASP 6.2.1 I was able to complete the run in the "1 scf/2 band/6.2.1 patched" directory and got the PRJCAR and other files:

  1. In src/poscar.F line 1505 remove or comment out (add ! in front) the expression, so it looks like this:

    Code: Select all

    !write(iu0,*) 'charac =',charac
    

    In my tests this line caused an immediate crash of VASP because the file unit iu0 is not opened on all MPI tasks. You did not report this problem, maybe your compiler was more forgiving and you did not encounter this at all. Anyway, this line seems to be just a debugging expression and it is safe to remove it. After fixing this I was able to proceed to the segmentation fault which happens just before writing the output files.

  2. I found that the segmentation fault must occur inside the XML_KPROJ() procedure called inside KPROJ() in the file k-proj.F. Since this subroutine seems to be solely responsible for writing the output data to an XML file I just commented it out for testing. Hence, in src/k-proj.F line 921 comment out (add ! in front) the expression, so it looks like this:

    Code: Select all

    !CALL XML_KPROJ(KAPPA, W%CELTOT, W%FERTOT, W%WDES%NB_TOT, W%WDES%NKPTS, W%WDES%ISPIN, NKPTS_IRZ)
    

After recompiling VASP the run finished without errors and produces the desired output files. The exact reason for the segmentation fault is still unknown at this point, this requires further investigation. There does not seem to be a memory issue, the consumption is moderate with roughly 9 GB in total (summed over 48 MPI ranks).

It would be great if you could also test these modifications and check if the output is as desired (I have not tested this). Thanks!!

All the best,
Andreas Singraber


yujia_teng
Newbie
Newbie
Posts: 17
Joined: Thu May 25, 2023 6:24 pm

Re: Issues about LKPROJ tag

#5 Post by yujia_teng » Mon Jul 21, 2025 1:48 pm

Dear Andreas,
Thanks very much for your help. I've done lots of tests and now jobs can finish with all output file complete after recompiling vasp according to what you said.

As for the 2nd problem of point jump, I'm attaching 2 bands below. These are unfolded bands from band4vasp, which is based on PRJCAR file. Use M(0.5,0) has jump because 0.5 becomes -0.5 in PRJCAR file, so M-K is from (-0.5,0) to (0.333,0.333,0), rather than from (0.5) to (0.333,0.333,0), which gives a very long path. Currently I solve it by replacing 0.5 with 0.49999. But this is inconvenient and in our usual band calculation, there's no problem with using M(0.5,0).

Best regards.

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

yujia_teng
Newbie
Newbie
Posts: 17
Joined: Thu May 25, 2023 6:24 pm

Re: Issues about LKPROJ tag

#6 Post by yujia_teng » Wed Jul 23, 2025 3:05 pm

Dear Andreas,
I would like to update that the jump problem above in band is also solved by using recompiled vasp. So the jump problem is also due to the incomplete output files caused by the bug.

Best regards.

Last edited by yujia_teng on Wed Jul 23, 2025 3:06 pm, edited 1 time in total.

Post Reply