Skip to content

Commit 08512c5

Browse files
committed
Merge pull request #8 from boegel/module-append-text
fix conflict with develop
2 parents 19fdd33 + d35a799 commit 08512c5

22 files changed

Lines changed: 385 additions & 127 deletions

File tree

easybuild/framework/easyblock.py

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -915,16 +915,19 @@ def load_module(self, mod_paths=None, purge=True):
915915
"""
916916
Load module for this software package/version, after purging all currently loaded modules.
917917
"""
918+
modtool = modules_tool()
919+
if mod_paths is not None:
920+
for mod_path in mod_paths:
921+
modtool.prepend_module_path(mod_path)
918922
# self.mod_name might not be set (e.g. during unit tests)
919923
if self.mod_name is not None:
920-
m = modules_tool(mod_paths=mod_paths)
921924
# purge all loaded modules if desired
922925
if purge:
923-
m.purge()
926+
modtool.purge()
924927
# restore original environment
925928
modify_env(os.environ, self.orig_environ)
926-
m.check_module_path() # make sure MODULEPATH is set correctly after purging
927-
m.load([self.mod_name])
929+
modtool.check_module_path() # make sure MODULEPATH is set correctly after purging
930+
modtool.load([self.mod_name])
928931
else:
929932
self.log.warning("Not loading module, since self.mod_name is not set.")
930933

@@ -940,35 +943,29 @@ def load_fake_module(self, purge=False):
940943
fake_mod_path = self.make_module_step(True)
941944

942945
# load fake module
943-
mod_paths = [fake_mod_path]
944-
mod_paths.extend(self.orig_modulepath.split(':'))
945-
self.log.debug("mod_paths: %s" % mod_paths)
946-
947-
self.load_module(mod_paths=mod_paths, purge=purge)
946+
modtool = modules_tool()
947+
modtool.prepend_module_path(fake_mod_path)
948+
self.load_module(purge=purge)
948949

949950
return (fake_mod_path, orig_env)
950951

951952
def clean_up_fake_module(self, fake_mod_data):
952953
"""
953954
Clean up fake module.
954955
"""
955-
956956
fake_mod_path, orig_env = fake_mod_data
957-
958957
# unload module and remove temporary module directory
959-
if fake_mod_path:
958+
# self.mod_name might not be set (e.g. during unit tests)
959+
if fake_mod_path and self.mod_name is not None:
960960
try:
961-
mod_paths = [fake_mod_path]
962-
mod_paths.extend(self.modules_tool.mod_paths)
963-
m = modules_tool(mod_paths=mod_paths)
964-
# self.mod_name might not be set (e.g. during unit tests)
965-
if self.mod_name is not None:
966-
m.unload([self.mod_name])
967-
else:
968-
self.log.warning("Not unloading module, since self.mod_name is not set.")
961+
modtool = modules_tool()
962+
modtool.unload([self.mod_name])
963+
modtool.remove_module_path(fake_mod_path)
969964
rmtree2(os.path.dirname(fake_mod_path))
970965
except OSError, err:
971966
self.log.error("Failed to clean up fake module dir: %s" % err)
967+
elif self.mod_name is None:
968+
self.log.warning("Not unloading module, since self.mod_name is not set.")
972969

973970
# restore original environment
974971
modify_env(os.environ, orig_env)

easybuild/main.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
import subprocess
4141
import sys
4242
import tempfile
43+
import traceback
4344
from vsc.utils import fancylogger
4445
from vsc.utils.missing import any
4546

@@ -88,6 +89,7 @@ def build_and_install_software(ecs, init_session_state, exit_on_failure=True):
8889
# purposely catch all exceptions
8990
ec_res['success'] = False
9091
ec_res['err'] = err
92+
ec_res['traceback'] = traceback.format_exc()
9193

9294
# keep track of success/total count
9395
if ec_res['success']:
@@ -104,7 +106,10 @@ def build_and_install_software(ecs, init_session_state, exit_on_failure=True):
104106
write_file(test_report_fp, test_report_txt)
105107

106108
if not ec_res['success'] and exit_on_failure:
107-
_log.error(test_msg)
109+
if 'traceback' in ec_res:
110+
_log.error(ec_res['traceback'])
111+
else:
112+
_log.error(test_msg)
108113

109114
res.append((ec, ec_res))
110115

@@ -234,6 +239,7 @@ def main(testing_data=(None, None, None)):
234239
'ignore_dirs': options.ignore_dirs,
235240
'modules_footer': options.modules_footer,
236241
'only_blocks': options.only_blocks,
242+
'optarch': options.optarch,
237243
'recursive_mod_unload': options.recursive_module_unload,
238244
'regtest_output_dir': options.regtest_output_dir,
239245
'retain_all_deps': retain_all_deps,
@@ -245,6 +251,7 @@ def main(testing_data=(None, None, None)):
245251
'skip_test_cases': options.skip_test_cases,
246252
'sticky_bit': options.sticky_bit,
247253
'stop': options.stop,
254+
'test_report_env_filter': options.test_report_env_filter,
248255
'umask': options.umask,
249256
'valid_module_classes': module_classes(),
250257
'valid_stops': [x[0] for x in EasyBlock.get_steps()],

easybuild/toolchains/foss.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
##
2+
# Copyright 2013 Ghent University
3+
#
4+
# This file is part of EasyBuild,
5+
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
6+
# with support of Ghent University (http://ugent.be/hpc),
7+
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
8+
# the Hercules foundation (http://www.herculesstichting.be/in_English)
9+
# and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en).
10+
#
11+
# http://github.com/hpcugent/easybuild
12+
#
13+
# EasyBuild is free software: you can redistribute it and/or modify
14+
# it under the terms of the GNU General Public License as published by
15+
# the Free Software Foundation v2.
16+
#
17+
# EasyBuild is distributed in the hope that it will be useful,
18+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
19+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20+
# GNU General Public License for more details.
21+
#
22+
# You should have received a copy of the GNU General Public License
23+
# along with EasyBuild. If not, see <http://www.gnu.org/licenses/>.
24+
##
25+
"""
26+
EasyBuild support for foss compiler toolchain (includes GCC, OpenMPI, OpenBLAS, LAPACK, ScaLAPACK and FFTW).
27+
28+
@author: Kenneth Hoste (Ghent University)
29+
"""
30+
31+
from easybuild.toolchains.compiler.gcc import Gcc
32+
from easybuild.toolchains.fft.fftw import Fftw
33+
from easybuild.toolchains.linalg.openblas import OpenBLAS
34+
from easybuild.toolchains.linalg.scalapack import ScaLAPACK
35+
from easybuild.toolchains.mpi.openmpi import OpenMPI
36+
37+
38+
class Foss(Gcc, OpenMPI, OpenBLAS, ScaLAPACK, Fftw):
39+
"""Compiler toolchain with GCC, OpenMPI, OpenBLAS, ScaLAPACK and FFTW."""
40+
NAME = 'foss'

easybuild/toolchains/ictce.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
##
2525
"""
2626
EasyBuild support for ictce compiler toolchain (includes Intel compilers (icc, ifort), Intel MPI,
27-
Intel Math Kernel Library (MKL), and Intel FFTW wrappers.
27+
Intel Math Kernel Library (MKL), and Intel FFTW wrappers).
2828
2929
@author: Stijn De Weirdt (Ghent University)
3030
@author: Kenneth Hoste (Ghent University)

easybuild/toolchains/intel.py

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
##
2+
# Copyright 2012-2013 Ghent University
3+
#
4+
# This file is part of EasyBuild,
5+
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
6+
# with support of Ghent University (http://ugent.be/hpc),
7+
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
8+
# the Hercules foundation (http://www.herculesstichting.be/in_English)
9+
# and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en).
10+
#
11+
# http://github.com/hpcugent/easybuild
12+
#
13+
# EasyBuild is free software: you can redistribute it and/or modify
14+
# it under the terms of the GNU General Public License as published by
15+
# the Free Software Foundation v2.
16+
#
17+
# EasyBuild is distributed in the hope that it will be useful,
18+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
19+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20+
# GNU General Public License for more details.
21+
#
22+
# You should have received a copy of the GNU General Public License
23+
# along with EasyBuild. If not, see <http://www.gnu.org/licenses/>.
24+
##
25+
"""
26+
EasyBuild support for intel compiler toolchain (includes Intel compilers (icc, ifort), Intel MPI,
27+
Intel Math Kernel Library (MKL), and Intel FFTW wrappers).
28+
29+
@author: Stijn De Weirdt (Ghent University)
30+
@author: Kenneth Hoste (Ghent University)
31+
"""
32+
33+
from easybuild.toolchains.compiler.inteliccifort import IntelIccIfort
34+
from easybuild.toolchains.fft.intelfftw import IntelFFTW
35+
from easybuild.toolchains.mpi.intelmpi import IntelMPI
36+
from easybuild.toolchains.linalg.intelmkl import IntelMKL
37+
38+
39+
class Intel(IntelIccIfort, IntelMPI, IntelMKL, IntelFFTW):
40+
"""
41+
Compiler toolchain with Intel compilers (icc/ifort), Intel MPI,
42+
Intel Math Kernel Library (MKL) and Intel FFTW wrappers.
43+
"""
44+
NAME = 'intel'

easybuild/tools/config.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
'ignore_dirs': None,
8585
'modules_footer': None,
8686
'only_blocks': None,
87+
'optarch': None,
8788
'recursive_mod_unload': False,
8889
'regtest_output_dir': None,
8990
'retain_all_deps': False,
@@ -95,6 +96,7 @@
9596
'skip_test_cases': False,
9697
'sticky_bit': False,
9798
'stop': None,
99+
'test_report_env_filter': None,
98100
'umask': None,
99101
'valid_module_classes': None,
100102
'valid_stops': None,

0 commit comments

Comments
 (0)