Skip to content

Commit 61b9284

Browse files
authored
Merge pull request easybuilders#21512 from sassy-crick/20241001162332_new_pr_VASP643
{phys}[intel/2024a] VASP v6.4.3
2 parents 76fb42b + 33dcf5a commit 61b9284

2 files changed

Lines changed: 175 additions & 0 deletions

File tree

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# This build enables both HDF5 and Wannier-90, both are optional but recommended
2+
# It also upgrades the build to Intel's OneAPI
3+
# Furthermore, it sets the vdw_kernel as an external file (courtesy of Mikael Öhman)
4+
# Author: J. Saßmannshausen (Imperial College London/UK)
5+
6+
easyblock = 'MakeCp'
7+
8+
name = 'VASP'
9+
version = '6.4.3'
10+
11+
homepage = 'http://www.vasp.at'
12+
description = """The Vienna Ab initio Simulation Package (VASP) is a
13+
computer program for atomic scale materials modelling, e.g. electronic
14+
structure calculations and quantum-mechanical molecular dynamics,
15+
from first principles.
16+
17+
This build includes HDF5 and the Wannier-90 functions."""
18+
19+
toolchain = {'name': 'intel', 'version': '2024a'}
20+
toolchainopts = {'usempi': True}
21+
22+
download_instructions = """
23+
VASP is proprietary software,
24+
see http://www.vasp.at/index.php/faqs
25+
on how to obtain a license for the software."""
26+
sources = [
27+
'%(namelower)s.%(version)s.tgz',
28+
'vdw_kernel.bindat.gz', # Big-endian version of vdw_kernel.bindat, gzip-compressed.
29+
]
30+
patches = [
31+
# This patch replaces the hardcoded path with the environment variable VDW_KERNEL
32+
# This patch also addes HDF5 and Wannier-90
33+
'vasp-6.4.3_vdw_kernel_file-HDF5-Wannier.patch',
34+
]
35+
checksums = [
36+
{'vasp.6.4.3.tgz': 'fe30e773f2a3e909b5e0baa9654032dfbdeff7ec157bc348cee7681a7b6c24f4'},
37+
{'vdw_kernel.bindat.gz': '650c6a194ab077676a834902ef68e2f4fe426be813ef12b3963c4198d3324f86'},
38+
{'vasp-6.4.3_vdw_kernel_file-HDF5-Wannier.patch':
39+
'5836a805be4e331105d53c8be80ae29a9d2b7549bd457d6d95b4f8dde1e97b73'},
40+
]
41+
42+
dependencies = [
43+
('HDF5', '1.14.5'),
44+
('Wannier90', '3.1.0'),
45+
]
46+
47+
prebuildopts = 'cp arch/makefile.include.intel ./makefile.include && '
48+
# Increase MPI block size (from Micketeer):
49+
prebuildopts += 'sed -i "s|MPI_BLOCK=8000|MPI_BLOCK=65536|" makefile.include && '
50+
51+
# VASP uses LIBS as a list of folders
52+
prebuildopts += 'unset LIBS && '
53+
54+
buildopts = 'all ' # building std gam and ncl
55+
buildopts += 'DEPS=1 ' # required for VASP parallel builds
56+
57+
# Testing, can take a long time!
58+
# This section has been taken from VASP-6.3.2-nvofbf-2022.07.eb
59+
# The important bit seems to be to set ulimit -s to unlimited, as else segfaults
60+
# will occure during some of the tests.
61+
# https://www.vasp.at/wiki/index.php/Validation_tests
62+
63+
# it is recommended to run the testsuite with 4 MPI processes,
64+
# but it's also recommended to use only 1 MPI process per GPU,
65+
# so running the test on GPUs requires 4 GPUs?
66+
local_test_mpiprocs = 4
67+
68+
pretestopts = 'export MPIRUN="mpirun -np %s " && ' % local_test_mpiprocs
69+
pretestopts += 'export OMP_NUM_THREADS=1 && export OMP_STACKSIZE=512m && ulimit -s unlimited && '
70+
pretestopts += 'export VASP_TESTSUITE_EXE_STD="$MPIRUN %(builddir)s/vasp.%(version)s/bin/vasp_std" && '
71+
pretestopts += 'export VASP_TESTSUITE_EXE_NCL="$MPIRUN %(builddir)s/vasp.%(version)s/bin/vasp_ncl" && '
72+
pretestopts += 'export VASP_TESTSUITE_EXE_GAM="$MPIRUN %(builddir)s/vasp.%(version)s/bin/vasp_gam" && '
73+
74+
# skip tests that are too long
75+
local_test_skip = 'HEG_333_LW '
76+
77+
pretestopts += 'export VASP_TESTSUITE_SKIP_TESTS="%s" && ' % local_test_skip
78+
runtest = 'test'
79+
80+
files_to_copy = [
81+
(['bin/vasp_std', 'bin/vasp_gam', 'bin/vasp_ncl'], 'bin'),
82+
(['../vdw_kernel.bindat'], '.'),
83+
]
84+
85+
sanity_check_paths = {
86+
'files': ['bin/vasp_std', 'bin/vasp_gam', 'bin/vasp_ncl'],
87+
'dirs': [],
88+
}
89+
90+
# This environment variable works together with the vasp-6.4.3_vdw_kernel_file-HDF5-Wannier.patch
91+
# so that it can be used without having to copy this file around.
92+
modextravars = {
93+
'VDW_KERNEL': '%(installdir)s/vdw_kernel.bindat',
94+
}
95+
96+
moduleclass = 'phys'
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
Enables HDF5 and Wannier, sets up MKL root, switch to icx and icpx
2+
Author: J. Saßmannshausen (Imperial College London)
3+
Makes VDW_kernel.bindat loadable externally (courtesy of Mikael Öhman)
4+
diff --git a/vasp.6.4.3.org/arch/makefile.include.intel b/vasp.6.4.3/arch/makefile.include.intel
5+
index 1d18232..2b8696e 100644
6+
--- a/vasp.6.4.3.org/arch/makefile.include.intel
7+
+++ b/vasp.6.4.3/arch/makefile.include.intel
8+
@@ -29,7 +29,7 @@ OBJECTS_O2 += fft3dlib.o
9+
# For what used to be vasp.5.lib
10+
CPP_LIB = $(CPP)
11+
FC_LIB = $(FC)
12+
-CC_LIB = icc
13+
+CC_LIB = icx
14+
CFLAGS_LIB = -O
15+
FFLAGS_LIB = -O1
16+
FREE_LIB = $(FREE)
17+
@@ -37,7 +37,7 @@ FREE_LIB = $(FREE)
18+
OBJECTS_LIB = linpack_double.o
19+
20+
# For the parser library
21+
-CXX_PARS = icpc
22+
+CXX_PARS = icpx
23+
LLIBS = -lstdc++
24+
25+
##
26+
@@ -54,17 +54,17 @@ FFLAGS += $(VASP_TARGET_CPU)
27+
# Intel MKL (FFTW, BLAS, LAPACK, and scaLAPACK)
28+
# (Note: for Intel Parallel Studio's MKL use -mkl instead of -qmkl)
29+
FCL += -qmkl=sequential
30+
-MKLROOT ?= /path/to/your/mkl/installation
31+
-LLIBS += -L$(MKLROOT)/lib/intel64 -lmkl_scalapack_lp64 -lmkl_blacs_intelmpi_lp64
32+
-INCS =-I$(MKLROOT)/include/fftw
33+
+# MKLROOT += ${EBROOTIMKL}
34+
+LLIBS += -L$(MKLROOT)/mkl/latest/lib -lmkl_scalapack_lp64 -lmkl_blacs_intelmpi_lp64
35+
+INCS = -I$(MKLROOT)/include/fftw
36+
37+
# HDF5-support (optional but strongly recommended)
38+
-#CPP_OPTIONS+= -DVASP_HDF5
39+
-#HDF5_ROOT ?= /path/to/your/hdf5/installation
40+
-#LLIBS += -L$(HDF5_ROOT)/lib -lhdf5_fortran
41+
-#INCS += -I$(HDF5_ROOT)/include
42+
+CPP_OPTIONS += -DVASP_HDF5
43+
+HDF5_ROOT += ${EBROOTHDF5}
44+
+LLIBS += -L$(HDF5_ROOT)/lib -lhdf5_fortran
45+
+INCS += -I$(HDF5_ROOT)/include
46+
47+
# For the VASP-2-Wannier90 interface (optional)
48+
-#CPP_OPTIONS += -DVASP2WANNIER90
49+
-#WANNIER90_ROOT ?= /path/to/your/wannier90/installation
50+
-#LLIBS += -L$(WANNIER90_ROOT)/lib -lwannier
51+
+CPP_OPTIONS += -DVASP2WANNIER90
52+
+WANNIER90_ROOT += ${EBROOTWANNIER90}
53+
+LLIBS += -L$(WANNIER90_ROOT)/lib -lwannier
54+
diff --git a/vasp.6.4.3.org/src/vdw_nl.F b/vasp.6.4.3/src/vdw_nl.F
55+
index 1f1f11c..4c1ec83 100644
56+
--- a/vasp.6.4.3.org/src/vdw_nl.F
57+
+++ b/vasp.6.4.3/src/vdw_nl.F
58+
@@ -449,13 +449,19 @@ CONTAINS
59+
SUBROUTINE PHI_GENERATE(GRIDC,IVDW_NL,GAMMA_VDW,ALPHA_VDW)
60+
logical :: lkern,lkern_new
61+
integer :: IVDW_NL,IVDW_NL_TMP,NINTG_TMP,nmesh,IOstatus
62+
+ character(len=255) :: vdwkernel
63+
real(q) :: GAMMA_VDW,GAMMA_VDW_TMP,ALPHA_VDW,ALPHA_VDW_TMP
64+
TYPE (grid_3d) GRIDC
65+
66+
!ok if the kernel table is here read it
67+
- inquire( file='vdw_kernel.bindat', exist=lkern)
68+
+ vdwkernel = 'vdw_kernel.bindat'
69+
+ inquire( file=vdwkernel, exist=lkern)
70+
+ IF (.NOT. lkern) then
71+
+ call get_environment_variable("VDW_KERNEL", vdwkernel)
72+
+ inquire( file=trim(vdwkernel), exist=lkern)
73+
+ ENDIF
74+
IF (lkern) then
75+
- open (unit=10, file='vdw_kernel.bindat', form='unformatted')
76+
+ open (unit=10, file=trim(vdwkernel), form='unformatted', action='READ')
77+
read(10,IOSTAT=IOstatus) IVDW_NL_TMP,GAMMA_VDW_TMP,ALPHA_VDW_TMP,NINTG_TMP,nmesh
78+
IF (IOstatus.EQ.0) THEN
79+
lkern_new=.true.

0 commit comments

Comments
 (0)