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

Add external pio option for ESMF versions greater than 8.4.0 #2923

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 26 additions & 1 deletion easybuild/easyblocks/e/esmf.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ class EB_ESMF(ConfigureMake):
def extra_options():
"""Custom easyconfig parameters for ESMF"""
extra_vars = {
'disable_lapack': [False, 'Disable external LAPACK - True or False', CUSTOM]
'disable_lapack': [False, 'Disable external LAPACK - True or False', CUSTOM],
'external_pio': [False, 'Use external ParallelIO instead of internal - True or False', CUSTOM]
}
return ConfigureMake.extra_options(extra_vars)

Expand Down Expand Up @@ -126,6 +127,30 @@ def configure_step(self):
netcdf_libs.append('-lnetcdf_c++')
env.setvar('ESMF_NETCDF_LIBS', ' '.join(netcdf_libs))

if self.cfg['external_pio']:
if LooseVersion(self.version) >= LooseVersion('8.4.0'):
pio = get_software_root('ParallelIO')
if pio:
if LooseVersion(get_software_version('ParallelIO')) >= LooseVersion('2.5.9'):
env.setvar('ESMF_PIO', 'external')
Comment on lines +130 to +135
Copy link
Contributor

Choose a reason for hiding this comment

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

There is no real need for an explicit 'external_pio' option here, just change the code to something like

pio = get_software_root('ParallelIO')
if pio:
  if LooseVersion(self.version) >= LooseVersion('8.4.0'):
    check pio version etc
  else:
     msg = "External PIO is not supported for EMSF versions < 8.4.0"
    ...

Copy link
Author

Choose a reason for hiding this comment

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

@akesandgren Oh, ok. I just wanted this to be a bit more explicit than specifying one dependency in the config file. external LAPACK can be done the same way.
Also, quick question: do I understand that env.setvar() is passing these vars as build_opts for CMake?

Copy link
Contributor

Choose a reason for hiding this comment

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

LAPACK is different since it is part of the toolchain (foss/intel) and will always be there, hence there needs to be a way to disable it.

env.setenv just sets an environment variable.
The EMSF easyblock does not (currently) use the CMake building of ESMF, just the plain Makefile

env.setvar('ESMF_PIO_INCLUDE', pio + '/include')
env.setvar('ESMF_PIO_LIBPATH', pio + '/lib')
pnetcdf = get_software_root('PnetCDF')
if pnetcdf:
env.setvar('ESMF_PNETCDF', 'pnetcdf-config')
else:
msg = "external_pio is specified but PnetCDF is not found"
raise EasyBuildError(msg)
else:
msg = "ParallelIO version (%s) is less than required (2.5.9) for external_pio option"
raise EasyBuildError(msg, get_software_version('ParallelIO'))
else:
msg = "external_pio is specified but no ParallelIO provided"
raise EasyBuildError(msg)
else:
msg = "External PIO is not supported for EMSF versions < 8.4.0"
raise EasyBuildError(msg)

# 'make info' provides useful debug info
cmd = "make info"
run_cmd(cmd, log_all=True, simple=True, log_ok=True)
Expand Down