taucmdr.cf.software.tests.test_tau_installation module

Test functions.

Functions used for unit tests of tau_installation.py.

class taucmdr.cf.software.tests.test_tau_installation.CompilerOptionsTest(methodName='runTest')[source]

Bases: TestCase

Tests for the TAU_OPTIONS given to TAU’s compiler wrappers.

_classSetupFailed = False
_class_cleanups = []
static _tau_options(target_os, **kwargs)[source]

On Linux, I/O is also measured by wrapping I/O calls when the application is linked.

Apple’s linker can’t wrap I/O calls, so on macOS I/O is measured only under tau_exec.

class taucmdr.cf.software.tests.test_tau_installation.CompleteNightlyNamesTest(methodName='runTest')[source]

Bases: TestCase

Tests for complete_nightly_names.

_classSetupFailed = False
_class_cleanups = []
static _contents(src)[source]
static _src(**files)[source]
test_copy_replaced()[source]

A copy of a dated archive under the plain name is replaced by a link to the newest.

test_download()[source]

A download under the plain name is dated by its modification time, and the plain name links to it.

test_no_nightly()[source]
test_older_download()[source]

An archive under the plain name that’s older than the newest dated archive keeps its own date.

class taucmdr.cf.software.tests.test_tau_installation.ExportDynamicConfigureTest(methodName='runTest')[source]

Bases: TestCase

Tests for exporting TAU’s symbols from statically linked applications, which TAU’s plugins call.

static _argv(target_arch, target_os)[source]
_classSetupFailed = False
_class_cleanups = []
test_export_dynamic_default()[source]

TAU’s configure is left to its own choice where it already exports TAU’s symbols, or can’t.

test_export_dynamic_requested()[source]

TAU is asked to export its symbols where its configure doesn’t by default.

class taucmdr.cf.software.tests.test_tau_installation.LauncherAppfileTest(methodName='runTest')[source]

Bases: TestCase

Tests for rewriting launcher application files (mpirun –app, srun –multi-prog) to use tau_exec.

_TAU_EXEC = ['tau_exec', '-T', 'mpi']
_classSetupFailed = False
_class_cleanups = []
static _read_lines(path)[source]
static _write_appfile(*lines)[source]
test_appfile_flag_with_equals()[source]

The –flag=file spelling is rewritten in place, keeping the equals form.

test_line_without_executable_rejected()[source]

A command line that names no executable is a configuration error, not silently passed through.

test_missing_appfile_flag_rejected()[source]

A space-separated flag at the end of the command has no value, so the command cannot be parsed.

test_mpirun_appfile_rewritten()[source]

Each command line gets tau_exec in front of its executable; comments and blank lines are dropped.

test_other_flags_with_equals_ignored()[source]

A –key=value flag that is not the application-file flag is skipped, not mistaken for it.

test_rewritten_appfile_in_temporary_directory()[source]

The rewritten file goes to a new directory, never beside or over the user’s file, for any path form.

test_srun_multi_prog_inserts_after_rank_spec()[source]

Slurm multi-prog lines start with a task range, so tau_exec always goes in second position.

test_unknown_launcher_rejected()[source]

Launchers without a known application-file flag cannot be rewritten.

class taucmdr.cf.software.tests.test_tau_installation.NightlyInstallTagTest(methodName='runTest')[source]

Bases: TestCase

Tests for the installation tag and source archive of a TAU nightly build.

_classSetupFailed = False
_class_cleanups = []
_nightly(name, toplevel, date=None)[source]
_tag_and_source(update_nightly=False)[source]
setUp()[source]

Hook method for setting up the test fixture before exercising it.

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

test_new_download()[source]

An archive just downloaded under the plain name is built instead of an older dated one.

test_tag_from_built_archive()[source]

The tag has the TAU version of the archive that is built, not of an outdated archive under the plain name.

test_undated_readonly()[source]

An archive only under the plain name in a read-only directory is dated by its modification time.

test_update_nightly()[source]

Updating downloads a new archive without overwriting the one the plain name links to.

test_update_nightly_daily()[source]

Updating doesn’t download again on the day of the last download.

class taucmdr.cf.software.tests.test_tau_installation.OmptConfigurationTest(methodName='runTest')[source]

Bases: TestCase

Tests for the TAU configuration that measures OpenMP with OMPT.

_classSetupFailed = False
_class_cleanups = []
static _src_with_configure(name, text)[source]
static _tau(**kwargs)[source]
test_ompt_tags()[source]

An OMPT configuration asks only for the tags TAU puts in its makefile name.

test_ompt_tags_match_makefile()[source]

The OMPT makefile TAU writes is the one an OMPT configuration selects.

test_useropts_ompt_include()[source]

TAU is given the OMPT header directory only when its configure won’t copy the header itself.

class taucmdr.cf.software.tests.test_tau_installation.PdtUseTest(methodName='runTest')[source]

Bases: TestCase

Tests for when a TAU configuration uses PDT.

_classSetupFailed = False
_class_cleanups = []
static _tau(target_os, **kwargs)[source]
test_shmem_on_darwin()[source]
test_source_inst_on_darwin()[source]
test_source_inst_on_linux()[source]
class taucmdr.cf.software.tests.test_tau_installation.PythonBuildPathsTest(methodName='runTest')[source]

Bases: TestCase

Tests for python_build_paths.

_classSetupFailed = False
_class_cleanups = []
test_free_threaded()[source]

For a free-threaded Python interpreter the library with ABI flags is chosen.

test_libdir()[source]

The library is found in the LIBDIR that the Python interpreter reports.

test_other_version()[source]

Another Python version’s library isn’t used.

test_python_build_paths()[source]

The header and library directories of the running Python and of /usr/bin/python3 are found.

test_python_build_paths_no_headers()[source]

A Python without C headers, such as a distro Python without the corresponding development package, is refused.

test_relocated()[source]

A relocated Python, whose LIBDIR still has its build prefix, is found beside its standard library.

test_static_interpreter()[source]

A Python whose interpreter links libpython statically but still provides a shared one is detected.

class taucmdr.cf.software.tests.test_tau_installation.RuntimeSelectFileTest(methodName='runTest')[source]

Bases: TestCase

Tests for applying a select file when a dynamically linked application runs.

_classSetupFailed = False
_class_cleanups = []
_env(select_file, **kwargs)[source]
_select_file(name)[source]
test_filter_plugin()[source]

TAU’s filter plugin is loaded with the select file, alongside any other plugin.

test_long_path()[source]

A select file whose path makes TAU_PLUGINS too long for TAU is refused.

test_path_separators()[source]

A select file whose path holds a character that separates TAU_PLUGINS entries is refused.

test_static_linkage()[source]

A statically linked application’s select file is applied when it’s built, not when it runs.

class taucmdr.cf.software.tests.test_tau_installation.TauConfigurationHashTest(methodName='runTest')[source]

Bases: TestCase

Tests for what makes TAU configurations share a hash.

_classSetupFailed = False
_class_cleanups = []
static _tau(**kwargs)[source]
test_uid_ignores_cpu_count()[source]

A TAU configured on one host matches the same configuration on a host with a different core count.

test_uid_metrics_clamped()[source]
test_uid_separates_threading()[source]

A non-threaded configuration never shares a hash with one that asks TAU for pthreads.

test_useropts_metrics()[source]
class taucmdr.cf.software.tests.test_tau_installation.TauInstallationTest(methodName='runTest')[source]

Bases: TestCase

Tests for TauInstallation CUPTI detection and tagging.

_classSetupFailed = False
_class_cleanups = []
_fake_self(cuda_prefix)[source]
_make_cupti_header(*path_parts)[source]

Create a fake cupti_events.h under the per-test cuda tmpdir.

setUp()[source]

Hook method for setting up the test fixture before exercising it.

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

test_find_cupti_orig_layout()[source]

extras/CUPTI.orig/include/cupti_events.h — fourth candidate.

test_find_cupti_returns_none_when_missing()[source]

No headers present: returns None.

test_find_cupti_returns_none_when_no_cuda_prefix()[source]

No cuda_prefix: returns None without touching filesystem.

test_find_cupti_standard_sdk_layout()[source]

extras/CUPTI/include/cupti_events.h — first candidate.

test_find_cupti_system_packaged_layout()[source]

<cuda>/include/cupti_events.h — third candidate (e.g. /usr).

class taucmdr.cf.software.tests.test_tau_installation.TauMakefileTargetTest(methodName='runTest')[source]

Bases: TestCase

Tests for tau_makefile_target.

_classSetupFailed = False
_class_cleanups = []
test_arch_syntax()[source]

TAU_ARCH is read as make reads it: the last setting wins, and # starts a comment.

test_caf()[source]

TAU_F90=caf sets the coarray Fortran compiler to caf and the Fortran compiler to its gfortran.

test_cray_cc()[source]

A Cray cc in FULL_CC is the host C compiler, though Cray’s UPC compiler is also cc.

The cc wraps a GNU gcc, which is also a host C compiler, but the wrapper stays the C compiler.

test_directory()[source]

A directory given as the makefile is a configuration error.

test_makefile_syntax()[source]

Lines without = are skipped, and $(TAU_R) in a compiler path is expanded.

test_makefile_variables()[source]

Variables are expanded as make does, comments are dropped, and the last setting wins.

TAU’s makefiles set TAU_F90 twice, the second time from FULL_FORTRAN, which names the compiler TAU was configured with. A variable may be set after the line that uses it, and one that refers to itself expands to nothing.

test_packages()[source]

Package directories in the makefile are used if they exist, and an empty one means no package.

test_shared_arch()[source]

A TAU_ARCH that several platforms share is the host’s; on another host the error lists them.

test_skipped_compilers()[source]

A compiler that isn’t there, or that TAU Commander doesn’t know, is left out with no error.

class taucmdr.cf.software.tests.test_tau_installation.TauNightlySourceTest(methodName='runTest')[source]

Bases: TestCase

Tests for the sources of a TAU installation given the ‘nightly’ keyword.

_classSetupFailed = False
_class_cleanups = []
test_nightly_resolves_to_url()[source]

‘nightly’ downloads the nightly archive, and error messages name its URL rather than the keyword.

class taucmdr.cf.software.tests.test_tau_installation.UnwinderConfigureTest(methodName='runTest')[source]

Bases: TestCase

Tests for the stack unwinder options given to TAU’s configure.

_CONFIGURE = '    if [ "x$unwinder" = "xlibunwind" ] ; then\n          if [ %s ] ; then\n            unwind_lib_flag="-framework#System"\n'
_classSetupFailed = False
_class_cleanups = []
static _configure_argv(tau, configure=None)[source]
static _tau(target_os, target_arch=None)[source]
test_darwin_configure_maps_unwinder()[source]

On Apple silicon, TAU uses macOS’s own libunwind when its configure knows how to link it.

test_darwin_configure_without_unwinder_mapping()[source]

On Apple silicon, TAU isn’t asked for libunwind when its configure would link a bare -lunwind.

test_darwin_without_libunwind()[source]

On macOS, where TAU Commander provides no libunwind, TAU isn’t asked to link one.

test_linux_with_libunwind()[source]

With its own libunwind, TAU gets both the unwinder and libunwind’s location.

test_minimal_without_libunwind()[source]

Minimal TAU, which has no libunwind, isn’t asked to link one.

taucmdr.cf.software.tests.test_tau_installation._fake_python(headers=True, **config)[source]

Make a fake Python 3.99 installed in a new directory for testing purposes.

Parameters:
  • headers (bool) – If True then the installation has Python.h.

  • **config – sysconfig configuration variables to override.

Returns:

(installation root, path to the interpreter).

Return type:

tuple

taucmdr.cf.software.tests.test_tau_installation._has_headers(python_path)[source]

Return True if the Python interpreter at python_path has its C headers installed.

taucmdr.cf.software.tests.test_tau_installation._metrics(count)[source]
taucmdr.cf.software.tests.test_tau_installation._script(path: str, body: str) → str[source]

Write an executable shell script to path that runs body, and return path.

taucmdr.cf.software.tests.test_tau_installation._set_mtime(path, date)[source]
taucmdr.cf.software.tests.test_tau_installation._target_arch(target_os)[source]

Return the target architecture for target_os: Apple silicon for macOS, which has no ppc64le TauMagic.

taucmdr.cf.software.tests.test_tau_installation._touch(*parts)[source]