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

update WIEN2k easyblock to handle new Intel versions, WIEN2k v21, Perl dependency, and tuning of dimension parameters #2558

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 39 additions & 9 deletions easybuild/easyblocks/w/wien2k.py
Original file line number Diff line number Diff line change
@@ -74,6 +74,8 @@ def extra_options():
'mpi_remote': [False, "Whether to initiate MPI calls locally or remotely", CUSTOM],
'wien_granularity': [True, "Granularity for parallel execution (see manual)", CUSTOM],
'taskset': [None, "Specifies an optional command for binding a process to a specific core", CUSTOM],
'nmatmax': [19000, "Specifies the maximum matrix size", CUSTOM],
'nume': [6000, "Specifies the number of states to output.", CUSTOM],
}
return EasyBlock.extra_options(extra_vars)

@@ -103,7 +105,11 @@ def configure_step(self):
# toolchain-dependent values
comp_answer = None
if self.toolchain.comp_family() == toolchain.INTELCOMP: # @UndefinedVariable
if LooseVersion(get_software_version("icc")) >= LooseVersion("2011"):
if get_software_root('icc'):
intelver = get_software_version('icc')
elif get_software_root('intel-compilers'):
intelver = get_software_version('intel-compilers')
if LooseVersion(intelver) >= LooseVersion("2011"):
if LooseVersion(self.version) < LooseVersion("17"):
comp_answer = 'I' # Linux (Intel ifort 12.0 compiler + mkl )
else:
@@ -184,6 +190,11 @@ def configure_step(self):
# configure with patched configure script
self.log.debug('%s part I (configure)' % self.cfgscript)

perlroot = get_software_root('Perl')
if perlroot is None:
raise EasyBuildError("Perl is a required dependency of WIEN2k")
akesandgren marked this conversation as resolved.
Show resolved Hide resolved
self.perlbin = os.path.join(perlroot, 'bin', 'perl')

cmd = "./%s" % self.cfgscript
qanda = {
'Press RETURN to continue': '',
@@ -194,7 +205,7 @@ def configure_step(self):
'and you need to know details about your installed mpi ..) (y/n)': 'y',
'Q to quit Selection:': 'Q',
'A Compile all programs (suggested) Q Quit Selection:': 'Q',
' Please enter the full path of the perl program: ': '',
'Please enter the full path of the perl program: ': self.perlbin,
'continue or stop (c/s)': 'c',
'(like taskset -c). Enter N / your_specific_command:': 'N',
}
@@ -232,16 +243,22 @@ def configure_step(self):
libxcquestion2 = 'Do you want to automatically search for LIBXC installations? (Y,n):'
libxcquestion3 = 'Please enter the %sdirectory of your LIBXC-installation!:' % libxcstr3
libxcquestion4 = 'Please enter the lib-directory of your LIBXC-installation (usually lib or lib64)!:'
libxcquestion5 = 'LIBXC (usually not needed, ONLY for experts who want to play with different DFT options. '
libxcquestion5 += 'It must have been installed before)? (y,N):'

if libxcroot:
qanda.update({
libxcquestion1: 'y',
libxcquestion2: 'n',
libxcquestion3: libxcroot,
libxcquestion4: 'lib'
libxcquestion4: 'lib',
libxcquestion5: 'y',
})
else:
qanda.update({libxcquestion1: ''})
qanda.update({
libxcquestion1: 'N',
libxcquestion5: 'N',
})

if LooseVersion(self.version) >= LooseVersion("17"):
scalapack_libs = os.getenv('LIBSCALAPACK').split()
@@ -298,8 +315,11 @@ def configure_step(self):
'Please specify the ROOT-path of your ELPA installation (like /usr/local/elpa/) '
'or accept present path (Enter):': elparoot,
'Please specify the lib-directory of your ELPA installation (e.g. lib or lib64)!:': 'lib',
'Please specify the lib-directory of your ELPA installation (e.g. lib or lib64):': 'lib',
'Please specify the name of your installed ELPA library (e.g. elpa or elpa_openmp)!:':
elpa_dict['variant'],
'Please specify the name of your installed ELPA library (e.g. elpa or elpa_openmp):':
elpa_dict['variant'],
})
else:
qanda.update({'Do you want to use ELPA? (y,N):': 'n'})
@@ -320,7 +340,6 @@ def configure_step(self):
"%s[ \t]*.*" % os.getenv('F90'),
"%s[ \t]*.*" % os.getenv('CC'),
".*SRC_.*",
"Please enter the full path of the perl program:",
]

std_qa.update({
@@ -362,6 +381,15 @@ def configure_step(self):

self.log.debug("Patched file %s: %s", parallel_options_fp, read_file(parallel_options_fp))

# Set configurable parameters for size of problems.
param_subs = [
(r'\s+PARAMETER\s+\(\s*NMATMAX\s*=\s*\d+\)', r' PARAMETER (NMATMAX=%s)' % self.cfg['nmatmax']),
(r'\s+PARAMETER\s+\(\s*NUME\s*=\s*\d+\)', r' PARAMETER (NUME=%s)' % self.cfg['nume']),
]
self.log.debug("param_subs = %s" % param_subs)
apply_regex_substitutions('SRC_lapw1/param.inc', param_subs)
self.log.debug("Patched file %s: %s", 'SRC_lapw1/param.inc', read_file('SRC_lapw1/param.inc'))

def build_step(self):
"""Build WIEN2k by running siteconfig_lapw script again."""

@@ -371,7 +399,7 @@ def build_step(self):

qanda = {
'Press RETURN to continue': '\nQ', # also answer on first qanda pattern with 'Q' to quit
' Please enter the full path of the perl program: ': '',
'Please enter the full path of the perl program: ': self.perlbin,
}

if LooseVersion(self.version) < LooseVersion("17"):
@@ -394,7 +422,6 @@ def build_step(self):
".*: warning .*",
".*Stop.",
"Compile time errors (if any) were:",
"Please enter the full path of the perl program:",
]

self.log.debug("no_qa for %s: %s" % (cmd, no_qa))
@@ -542,8 +569,11 @@ def sanity_check_step(self):
"""Custom sanity check for WIEN2k."""

lapwfiles = []
for suffix in ['0', '0_mpi', '1', '1_mpi', '1c', '1c_mpi', '2', '2_mpi', '2c', '2c_mpi',
'3', '3c', '5', '5c', '7', '7c', 'dm', 'dmc', 'so']:
parasuff = '_mpi'
if LooseVersion(self.version) >= LooseVersion('21'):
parasuff = 'para'
for suffix in ['0', '0%s' % parasuff, '1', '1%s' % parasuff, '1c', '1c%s' % parasuff, '2', '2%s' % parasuff,
'2c', '2c%s' % parasuff, '3', '3c', '5', '5c', '7', '7c', 'dm', 'dmc', 'so']:
p = os.path.join(self.installdir, "lapw%s" % suffix)
lapwfiles.append(p)