Skip to content
19 changes: 18 additions & 1 deletion easybuild/easyblocks/i/impi.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
@author: Pieter De Baets (Ghent University)
@author: Jens Timmerman (Ghent University)
@author: Damian Alvarez (Forschungszentrum Juelich GmbH)
@author: Alex Domingo (Vrije Universiteit Brussel)
"""
import os
from distutils.version import LooseVersion
Expand Down Expand Up @@ -210,7 +211,23 @@ def sanity_check_step(self):
'dirs': [],
}

super(EB_impi, self).sanity_check_step(custom_paths=custom_paths)
# Add minimal test program to sanity checks
try:
fake_mod_data = self.load_fake_module()
except EasyBuildError as err:
self.log.debug("Loading fake module failed: %s" % err)

impi_testsrc = os.path.join(self.installdir, 'test/test.c')
impi_testexe = os.path.join(self.builddir, 'mpi_test')
self.log.info("Building minimal MPI test program: %s", impi_testsrc)
build_test = "mpiicc %s -o %s" % (impi_testsrc, impi_testexe)
run_cmd(build_test, log_all=True, simple=True)

self.clean_up_fake_module(fake_mod_data) # unload build environment

custom_commands = ['mpirun -n %s %s' % (self.cfg['parallel'], impi_testexe)]

super(EB_impi, self).sanity_check_step(custom_paths=custom_paths, custom_commands=custom_commands)

def make_module_req_guess(self):
"""
Expand Down