Skip to content

Commit

Permalink
Merge pull request #1164 from geimer/fix_mpi_family
Browse files Browse the repository at this point in the history
Let mpi_family return None if MPI is not supported by a toolchain
  • Loading branch information
boegel committed Feb 15, 2015
2 parents d6a1354 + 9ca4efb commit 24e9553
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 4 deletions.
6 changes: 4 additions & 2 deletions easybuild/tools/toolchain/toolchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,5 +454,7 @@ def comp_family(self):
raise NotImplementedError

def mpi_family(self):
""" Return type of MPI library used in this toolchain (abstract method)."""
raise NotImplementedError
""" Return type of MPI library used in this toolchain or 'None' if MPI is not
supported.
"""
return None
28 changes: 26 additions & 2 deletions test/framework/toolchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,30 @@ def test_comp_family(self):
tc.prepare()
self.assertEqual(tc.comp_family(), "GCC")

def test_mpi_family(self):
"""Test determining MPI family."""
# check subtoolchain w/o MPI
tc = self.get_toolchain("GCC", version="4.7.2")
tc.prepare()
self.assertEqual(tc.mpi_family(), None)
modules.modules_tool().purge()

# check full toolchain including MPI
tc = self.get_toolchain("goalf", version="1.1.0-no-OFED")
tc.prepare()
self.assertEqual(tc.mpi_family(), "OpenMPI")
modules.modules_tool().purge()

# check another one
tmpdir, imkl_module_path, imkl_module_txt = self.setup_sandbox_for_intel_fftw()
tc = self.get_toolchain("ictce", version="4.1.13")
tc.prepare()
self.assertEqual(tc.mpi_family(), "IntelMPI")

# cleanup
shutil.rmtree(tmpdir)
write_file(imkl_module_path, imkl_module_txt)

def test_goolfc(self):
"""Test whether goolfc is handled properly."""
tc = self.get_toolchain("goolfc", version="1.3.12")
Expand Down Expand Up @@ -479,7 +503,7 @@ def test_ictce_toolchain(self):

# cleanup
shutil.rmtree(tmpdir)
open(imkl_module_path, 'w').write(imkl_module_txt)
write_file(imkl_module_path, imkl_module_txt)

def test_toolchain_verification(self):
"""Test verification of toolchain definition."""
Expand Down Expand Up @@ -520,7 +544,7 @@ def test_mpi_cmd_for(self):

# cleanup
shutil.rmtree(tmpdir)
open(imkl_module_path, 'w').write(imkl_module_txt)
write_file(imkl_module_path, imkl_module_txt)

def tearDown(self):
"""Cleanup."""
Expand Down

0 comments on commit 24e9553

Please sign in to comment.