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

Let mpi_family return None if MPI is not supported by a toolchain #1164

Merged
merged 3 commits into from
Feb 15, 2015
Merged
Show file tree
Hide file tree
Changes from 2 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
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
24 changes: 24 additions & 0 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)
open(imkl_module_path, 'w').write(imkl_module_txt)
Copy link
Member

Choose a reason for hiding this comment

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

use write_file here, and please also include this in the other places where the imkl module is being fiddled with...

the problem is: if the test fails, the imkl module will not be restored (this issue was already there, it's not something you're causing)


def test_goolfc(self):
"""Test whether goolfc is handled properly."""
tc = self.get_toolchain("goolfc", version="1.3.12")
Expand Down