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

Added support for OpenACC #416

Merged
merged 11 commits into from
Jun 30, 2022
4 changes: 2 additions & 2 deletions packages/taucmdr/cf/software/installation.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ class AutotoolsInstallation(MakeInstallation):
make [flags] install [options]
"""

def configure(self, flags):
def configure(self, flags, env=None):
"""Invoke `configure`.

Args:
Expand All @@ -578,7 +578,7 @@ def configure(self, flags):
LOGGER.debug("Configuring %s at '%s'", self.name, self._src_prefix)
cmd = ['./configure', '--prefix=%s' % self.install_prefix] + flags
LOGGER.info("Configuring %s...", self.title)
if util.create_subprocess(cmd, cwd=self._src_prefix, stdout=False, show_progress=True):
if util.create_subprocess(cmd, cwd=self._src_prefix, stdout=False, show_progress=True, env=None):
nchaimov marked this conversation as resolved.
Show resolved Hide resolved
util.add_error_stack(self._src_prefix)
raise SoftwarePackageError('%s configure failed' % self.title)

Expand Down
8 changes: 1 addition & 7 deletions packages/taucmdr/cf/software/libelf_installation.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,5 @@ def __init__(self, sources, target_arch, target_os, compilers):

def configure(self, flags):
flags.extend(['--disable-debuginfod'])
cc = None
# Libelf's configure script requires CC to be a GNU compiler, so we have to set the environment variable before running the configure script
if 'CC' in os.environ :
cc = os.environ['CC']
os.environ['CC'] = GNU.installation()[CC].unwrap().info.command
super().configure(flags)
if cc is not None:
os.environ['CC'] = cc
super().configure(flags, env={'CC':GNU.installation()[CC].unwrap().absolute_path})
vikram8128 marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion packages/taucmdr/cf/software/papi_installation.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def _prepare_src(self, *args, **kwargs):
if os.path.basename(src_prefix) != 'src':
src_prefix = os.path.join(src_prefix, 'src')

# Modify PAPI's config.mk script to not use -Werror
# Modify PAPI's config.mk script to not use -Werror due to upstream bug when using NVHPC
for line in fileinput.input(os.path.join(src_prefix, 'libpfm4/config.mk'), inplace=True):
# fileinput.input with inplace=1 redirects stdout to the input file ... freaky
sys.stdout.write(line.replace('-Werror',''))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
Functions used for unit tests of papi_installation.py.
"""

from taucmdr import logger
from taucmdr.tests import TestCase
from taucmdr.model.project import Project

Expand Down
6 changes: 4 additions & 2 deletions packages/taucmdr/cli/commands/trial/tests/test_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,10 @@ def test_export_tau_profile(self):
export_file = expr['name'] + '.trial0.ppk'
self.assertTrue(os.path.exists(export_file))

@tests.skipIf(util.which('nvc'), "NVHPC compilers do not work with sqlite (due to a compiler bug in NVHPC)")
def test_export_sqlite_profile(self):
self.reset_project_storage(['--profile', 'sqlite', '--trace', 'none'])
if util.which('nvc') and self.getCompiler(CC) == util.which('nvc') :
self.skipTest("NVHPC compilers do not work with sqlite (due to a compiler bug in NVHPC)")
util.mkdirp(os.getcwd())
expr = Project.selected().experiment()
meas = expr.populate('measurement')
Expand All @@ -82,9 +83,10 @@ def test_export_merged_profile(self):
self.assertTrue(os.path.exists(export_file))

@tests.skipUnlessHaveCompiler(MPI_CC)
@tests.skipIf(util.which('nvc'), "This test cannot be run with NVHPC compilers (ScoreP cannot be configured with NVHPC compilers)")
def test_export_cubex(self):
self.reset_project_storage(['--mpi', '--profile', 'cubex', '--trace', 'none'])
if util.which('nvc') and self.getCompiler(CC) == util.which('nvc') :
self.skipTest("This test cannot be run with NVHPC compilers (ScoreP cannot be configured with NVHPC compilers)")
expr = Project.selected().experiment()
meas = expr.populate('measurement')
self.assertEqual(meas['profile'], 'cubex')
Expand Down
16 changes: 12 additions & 4 deletions packages/taucmdr/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,13 +283,21 @@ def copy_testfile(self, src, dst=None):
LOGGER.info(f"Copying test file {test_src} to {test_dst}")
shutil.copy(test_src, test_dst)

def assertCompiler(self, role, target_name='targ1'):
def getCompiler(self, role, target_name='targ1'):
from taucmdr.model.target import Target
targ_ctrl = Target.controller(PROJECT_STORAGE)
targ = targ_ctrl.one({'name': target_name})
try:
return targ.populate(role.keyword)['path']
except KeyError:
inf = targ.populate(role.keyword)
if 'path' in inf :
return inf['path']
else :
return None

def assertCompiler(self, role, target_name='targ1'):
path = self.getCompiler(role, target_name)
if path is not None :
return path
else :
self.fail(f"No {role} compiler in target '{target_name}'")

def assertCommandReturnValue(self, return_value, cmd, argv):
Expand Down