Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read NBANDS in io.vasp.outputs.Outcar init #4195

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

DanielYang59
Copy link
Contributor

@DanielYang59 DanielYang59 commented Nov 25, 2024

Summary

VASP version stability

  • 5.2.11 (unit test)
  • 5.4.4 (unit test)
  • 6.3.0 (unit test)
  • 6.3.2 (unit test, overridden)

Reason for using current pattern instead of NBANDS = (\d+)

As mentioned in #3843 (comment), the NBANDS could be modified to be "number of cores compatible". More specifically:

When executed on multiple CPUs, VASP automatically increases the number of bands, so that NBANDS is divisible by the number of CPU cores. If NCORE > 1, NBANDS is increased until it is divisible by the number of cores in a group (NCORE). If KPAR > 1, NBANDS is increased until it is divisible by the number of cores in a group.

For example if I set NBANDS to 30 on a 64-core job, it would be modified to 32 with the following message:

>>> grep NBANDS OUTCAR_set_30_but_changed_to_32 
   NBANDS = 30
|     I found NBANDS = 30. Now, NBANDS = 32.                                  |
   k-points           NKPTS =    126   k-points in BZ     NKDIM =    126   number of bands    NBANDS=     32


# Test VASP 6.3.0
assert Outcar(f"{VASP_OUT_DIR}/OUTCAR_vasp_6.3.gz").data["nbands"] == 64

def test_nplwvs(self):
outcar = Outcar(f"{VASP_OUT_DIR}/OUTCAR.gz")
assert outcar.data["nplwv"] == [[34560]]
Copy link
Contributor Author

@DanielYang59 DanielYang59 Nov 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question

Why would the "total number of plane waves (NPLWV)" value take a nested list format (added in #1757)?

# Read "total number of plane waves", NPLWV:
self.read_pattern(
{"nplwv": r"total plane-waves NPLWV =\s+(\*{6}|\d+)"},
terminate_on_match=True,
)
try:
self.data["nplwv"] = [[int(self.data["nplwv"][0][0])]]
except ValueError:
self.data["nplwv"] = [[None]]

def test_nplwvs(self):
outcar = Outcar(f"{VASP_OUT_DIR}/OUTCAR.gz")
assert outcar.data["nplwv"] == [[34560]]

@DanielYang59
Copy link
Contributor Author

@Andrew-S-Rosen Is currently implementation looking good to you? :)

@Andrew-S-Rosen
Copy link
Member

Due to time commitments, I can just say that I trust you. 👍 Happy to report if something comes up.

@DanielYang59
Copy link
Contributor Author

DanielYang59 commented Nov 25, 2024

Thanks for saying that, I tested on multiple VASP versions (included in unit test) and didn't find any issue for now, do let me know if you notice any :)

@DanielYang59 DanielYang59 marked this pull request as ready for review November 25, 2024 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support parsing of NBANDS from a VASP OUTCAR file
2 participants