taucmdr.cf.software.tests.test_tau_configure module

Test functions.

Functions used for unit tests of how tau_installation.py configures, selects, and runs TAU. Nothing is built: subprocesses, installation prefixes, and makefile lookups are mocked.

class taucmdr.cf.software.tests.test_tau_configure.ApplicationCommandTest(methodName='runTest')[source]

Bases: TestCase

Tests for TauInstallation.get_application_command without a TAU installation.

_LAUNCHER = ['mpirun', '-np', '4']
_classSetupFailed = False
_class_cleanups = []
static _launch(tau, launcher, apps, makefile=None)[source]
test_appfile_launch_rewrites_appfile()[source]

With no application command the launcher’s application file is rewritten instead.

test_baseline_uses_tau_baseline()[source]

Baseline measurements run everything under tau_baseline without touching the makefile.

test_instrumented_binary_runs_directly()[source]

Source instrumentation, static linkage, or no measurement at all: tau_exec is not needed.

test_managed_makefile_without_uid_is_silent()[source]

The compatibility warning is reserved for unmanaged installations.

test_mpmd_command_without_executable_rejected()[source]

An MPMD command that names no executable cannot be wrapped.

test_mpmd_wraps_each_executable()[source]

Every MPMD command gets its own tau_exec; launcher flags between commands are untouched.

test_python_uses_tau_python()[source]

Python applications run under tau_python with the target interpreter and the python tag stripped.

test_site_launcher_args_appended()[source]

Site-specific launcher arguments from the environment follow the launcher, ahead of tau_exec.

test_unmanaged_makefile_without_uid_warns()[source]

A hand-built TAU whose makefile lacks our UID is used, with a warning.

class taucmdr.cf.software.tests.test_tau_configure.CompiletimeConfigTest(methodName='runTest')[source]

Bases: TestCase

Tests for the TAU_OPTIONS and compiler options from TauInstallation.compiletime_config.

_classSetupFailed = False
_class_cleanups = []
static _compiletime_config(tau, makefile=None)[source]
test_baseline_returns_early()[source]

Baseline builds get no TAU_OPTIONS or TAU_MAKEFILE at all.

test_extra_options_are_added()[source]

Extra TAU options are merged with the derived set.

test_fallback_instrumentation()[source]

Fallback compiler instrumentation reverts to the plain compiler when TAU’s wrapper fails.

test_forced_options_replace_defaults()[source]

Forced TAU options are used verbatim instead of the derived set.

test_full_instrumentation()[source]

Source plus compiler instrumentation turns on every matching TAU compiler option.

test_manual_source_instrumentation()[source]

Manual source instrumentation links only but still defines TAU_ENABLED for the user’s macros.

test_runtime_only_instrumentation()[source]

No source or compiler instrumentation: link only, no compiler options, real makefile exported.

test_warns_on_foreign_makefile()[source]

A makefile that does not carry our UID is used, with a warning.

class taucmdr.cf.software.tests.test_tau_configure.ConfigureTest(methodName='runTest')[source]

Bases: TestCase

Tests for the flags TauInstallation.configure gives TAU’s configure script.

_classSetupFailed = False
_class_cleanups = []
_flags(tau)[source]
static _intel(version)[source]
static _ompt_tau(compilers=None)[source]

An OMPT configuration whose OMPT runtime is installed at /fake/ompt.

_useropts(flags)[source]
test_default_flags()[source]

A serial, single-threaded configuration passes tag, arch, compilers, and the default useropts.

test_failure_raises()[source]

A nonzero exit from TAU’s configure script is a package error for full and minimal builds.

test_feature_flags()[source]

Each measurement or application feature maps to its configure flag.

test_invalid_openmp_measurement()[source]

An unknown OpenMP measurement method is caught before configure runs.

test_level_zero_dependency_prefix()[source]

A managed Level Zero runtime is passed by prefix instead of the bare -level_zero flag.

test_minimal()[source]

The minimal configuration names only the tag, the arch, and the unwinder.

test_ompt_flags()[source]

OMPT points TAU at the OMPT runtime and adds its include path for omp-tools.h.

test_ompt_for_intel_19()[source]

Intel 19 and later ship their own OMPT runtime, so TAU is configured with a bare -ompt.

test_ompt_prefix_for_older_intel()[source]

Intel before 19, or an unknown version, still needs the downloaded OMPT runtime.

test_ompt_without_dependency()[source]

OMPT without a managed OMPT runtime enables OpenMP but passes no OMPT flags.

test_opari_flags()[source]

OPARI measurement configures TAU with -openmp -opari.

test_python_flags()[source]

Python support passes the interpreter’s real path and its header and library directories.

test_threading_flags()[source]

Ignored OpenMP and explicit pthreads both configure TAU with -pthread only.

class taucmdr.cf.software.tests.test_tau_configure.DataFormatTest(methodName='runTest')[source]

Bases: TestCase

Tests for guessing performance data formats from file names.

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

Known extensions map to their formats, including gzipped merged profiles.

test_format_classification()[source]

Every format is either a profile or a trace, never both.

test_tau_profile()[source]

A directory or a profile.<node>.<context>.<thread> file is TAU’s native profile format.

test_unknown_extension_rejected()[source]

Unknown extensions, gzipped or not, are configuration errors.

class taucmdr.cf.software.tests.test_tau_configure.EnvironmentTest(methodName='runTest')[source]

Bases: TestCase

Tests for environment sanitizing and environment compatibility checks.

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

No darshan and a non-Cray programming environment pass.

test_check_env_compat_rejects_cray_compilers()[source]

PrgEnv-cray is rejected regardless of case.

test_check_env_compat_rejects_darshan()[source]

Darshan preloaded or loaded as a module is incompatible with TAU.

test_sanitize_environment_is_silent_when_clean()[source]

Nothing to strip means nothing is logged; a TAU prefix without underscore is not a TAU variable.

test_sanitize_environment_strips_tau_variables()[source]

TAU_*, SCOREP_*, PROFILEDIR and TRACEDIR are dropped and reported; everything else survives.

class taucmdr.cf.software.tests.test_tau_configure.GetMakefileTest(methodName='runTest')[source]

Bases: TestCase

Tests for TauInstallation.get_makefile.

_LIB_PATH = '/tau/lib'
_classSetupFailed = False
_class_cleanups = []
_get_makefile(tau, *makefiles)[source]
test_forced()[source]

A forced makefile is returned as-is and cached.

test_forced_arch_directory()[source]

A forced makefile’s bin and lib are beside it, whatever its architecture directory is named.

test_matches_configuration()[source]

The makefile is found from the configuration tags alone, cached, and carries the configuration’s UID.

test_unknown_tags_raise()[source]

No installed makefile carries an unknown tag, managed or not.

class taucmdr.cf.software.tests.test_tau_configure.RuntimeConfigTest(methodName='runTest')[source]

Bases: TestCase

Tests for the tau_exec options and environment from TauInstallation.runtime_config.

_classSetupFailed = False
_class_cleanups = []
static _runtime_config(tau)[source]
test_cuda_without_cupti()[source]

CUDA measurement without CUPTI headers cannot ask tau_exec for -cupti.

test_defaults_are_minimal()[source]

With no features enabled tau_exec gets no options and TAU sees only the wall clock.

test_feature_options()[source]

Every runtime feature maps to its tau_exec option.

test_openmp()[source]

OMPT measurement adds -ompt and the OMPT environment; ignoring OpenMP adds neither.

test_profile_formats()[source]

Each profile format sets exactly the TAU and Score-P variables it needs.

test_sampling()[source]

Sampling enables -ebs and uses TAU’s default period unless one was given.

test_throttle_and_callpath()[source]

Throttle limits and callpath depth are exported only when enabled.

test_trace_formats()[source]

Each trace format sets exactly the TAU and Score-P variables it needs.

test_unwinding()[source]

Unwind depth is exported only when it is set.

class taucmdr.cf.software.tests.test_tau_configure.TagsTest(methodName='runTest')[source]

Bases: TestCase

Tests for TauInstallation.get_tags and the tags a configuration must not approximate.

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

PDT, PAPI, and Score-P are tagged only when the configuration uses them.

test_features()[source]

Every application feature and user tag appears in the tag set.

test_incompatible_tags_with_features()[source]

Features the configuration uses are never incompatible.

test_incompatible_tags_without_features()[source]

Makefiles for features the configuration lacks must never be approximated.

test_invalid_openmp_measurement()[source]

An unknown OpenMP measurement method is an internal error.

test_opari()[source]

OPARI measurement is tagged openmp+opari.

test_openmp_ignored_uses_pthread()[source]

An OpenMP application whose directives are not measured only needs thread support.

test_pthreads_take_precedence()[source]

Explicit pthread support wins over OpenMP tagging.

class taucmdr.cf.software.tests.test_tau_configure._FakeCompiler(command, family, version=None)[source]

Bases: object

Just enough of InstalledCompiler for configure() to build its flag list.

unwrap()[source]

Fake compilers never wrap anything.

taucmdr.cf.software.tests.test_tau_configure._base_config(opts=None, env=None)[source]

Stand-in for Installation’s compile-time and runtime configuration, which needs an install prefix.

taucmdr.cf.software.tests.test_tau_configure._makefile(*tags)[source]

Return a TAU makefile path whose name carries tags.

taucmdr.cf.software.tests.test_tau_configure._tau(**kwargs)[source]

Return a TauInstallation for the host built with the minimal compilers.