taucmdr.cf.software.tau_installation module¶
TAU software installation management.
TAU is the core software package of TAU Commander.
-
class
taucmdr.cf.software.tau_installation.
TauInstallation
(sources, target_arch, target_os, compilers, minimal=False, application_linkage='dynamic', openmp_support=False, pthreads_support=False, tbb_support=False, mpi_support=False, mpi_libraries=None, openacc_support=False, caf_support=False, cuda_support=False, cuda_prefix=None, opencl_support=False, opencl_prefix=None, shmem_support=False, shmem_libraries=None, mpc_support=False, max_threads=None, uses_python=False, source_inst='never', compiler_inst='never', keep_inst_files=False, reuse_inst_files=False, select_file=None, baseline=False, profile='tau', trace='none', sample=False, metrics=None, measure_io=False, measure_mpi=False, measure_openmp='ignore', measure_opencl=False, measure_cuda=False, measure_level_zero=False, measure_shmem=False, measure_heap_usage=False, measure_system_load=False, measure_memory_alloc=False, measure_comm_matrix=False, measure_callsite=False, callpath_depth=100, throttle=True, metadata_merge=True, throttle_per_call=10, throttle_num_calls=100000, sample_resolution='line', sampling_period=0, track_memory_footprint=False, update_nightly=False, ptts=False, ptts_post=False, ptts_sample_flags=None, ptts_restart=False, ptts_start=None, ptts_stop=None, ptts_report_flags=None, tags=None, forced_makefile=None, dyninst=False, mpit=False, unwinder='libunwind', unwind_depth=0)[source]¶ Bases:
taucmdr.cf.software.installation.Installation
Encapsulates a TAU installation.
TAU is an enormous, organic, complex piece of software so this class is unusually complex to consider all the corner cases. This is where most of the systemization of TAU is actually implemented so it can get ugly.
Returns a set of makefile tags incompatible with the specified config.
-
_prep_data_analysis_tools
()[source]¶ Checks that data analysis tools are installed, or installs them if needed.
-
static
_sanitize_environment
(env)[source]¶ Unsets any TAU environment variables that were set by the user.
A user’s preexisting TAU configuration may conflict with the configuration specified by the TAU Commander project. This routine lets us work in a clean environment without disrupting the user’s shell environment.
Parameters: env (dict) – Environment variables. Returns: env without TAU environment variables. Return type: dict
-
classmethod
check_env_compat
()[source]¶ Checks the current shell environment for incompatible libraries or modules.
Other instrumentation packages like Darshan can conflict with TAU. This routine checks that no conflicting packages are active in the current environment.
Raises: ConfigurationError
– TAU cannot be used in the current environment.
-
compile
(compiler, compiler_args)[source]¶ Executes a compilation command.
Sets TAU environment variables and configures TAU compiler wrapper command line arguments to match specified configuration, then executes the compiler command.
Parameters: - compiler (InstalledCompiler) – A compiler command.
- compiler_args (list) – Compiler command line arguments.
Raises: ConfigurationError
– Compilation failed.Returns: Compiler return value (always 0 if no exception raised).
Return type:
-
compiletime_config
(compiler, opts=None, env=None)[source]¶ Configures environment for compilation with TAU.
Modifies incoming command line arguments and environment variables for the TAU compiler wrapper scripts.
Parameters: Returns: (opts, env) updated to support TAU.
Return type:
-
configure
()[source]¶ Configures TAU
Executes TAU’s configuration script with appropriate arguments to support the specified configuration.
Raises: SoftwareConfigurationError
– TAU’s configure script failed.
-
create_ppk_file
(dest, src, remove_existing=True)[source]¶ Write a PPK file at
dest
from the data atsrc
.Parameters:
-
get_application_command
(launcher_cmd, application_cmds)[source]¶ Build a command line to launch an application under TAU.
Sometimes TAU needs to use tau_exec, sometimes not. This routine also handles backend launch commands like
aprun
.application_cmds may be an empty list if the application is launched via a configuration file, e.g.
mpirun --app myapp.cfg
.Parameters: Returns: (cmd, env) where cmd is the new command line and env is a dictionary of environment variables to set before running the application command.
Return type:
-
get_compiler_command
(compiler)[source]¶ Get the compiler wrapper command for the given compiler.
Parameters: compiler (InstalledCompiler) – A compiler to find a wrapper for. Returns: Command for TAU compiler wrapper without path or arguments. Return type: str
-
static
get_data_format
(path)[source]¶ Guess the data format of a file path.
Look at a file’s extension and guess what kind of performance data it might be.
Parameters: path (str) – File path. Returns: String indicating the data format. Return type: str Raises: ConfigurationError
– Cannot determine the file’s data format.
-
get_makefile
()[source]¶ Returns an absolute path to a TAU_MAKEFILE.
The file returned should supply all requested measurement features and application support features specified in the constructor.
Returns: A file path that could be used to set the TAU_MAKEFILE environment variable, or None if a suitable makefile couldn’t be found. Return type: str
-
classmethod
get_minimal
()[source]¶ Creates a minimal TAU configuration for working with legacy data analysis tools.
Returns: Object handle for the TAU installation. Return type: TauInstallation
Get the shared library directory that corresponds to a given TAU Makefile
Parameters: tau_makefile (str) – path to a TAU Makefile Returns: the path to a TAU shared library directory containing the shared libraries that would be used by the TAU configuration represented by the Makefile. Return type: str
Get tags for this TAU installation.
Each TAU configuration (makefile, library, Python bindings, etc.) is identified by its tags. Tags can appear in the makefile name in any order so the order of the tags returned by this function will likely not match the order they appear in the makefile name or tau_exec command line.
Returns: Makefile tags, e.g. set(‘papi’, ‘pdt’, ‘icpc’) Return type: set
-
install
(force_reinstall=False)[source]¶ Installs TAU.
Configures, compiles, and installs TAU with all necessary makefiles and libraries.
Parameters: force_reinstall (bool) – Set to True to force reinstall even if TAU is already installed and working. Raises: SoftwarePackageError
– TAU failed installation or did not pass verification after it was installed.
-
static
is_profile_format
(fmt)[source]¶ Return True if
fmt
is a string indicating a profile data format.
-
make_install
()[source]¶ Installs TAU to
self.install_prefix
.Executes ‘make install’ to build and install TAU.
Raises: SoftwarePackageError
– ‘make install’ failed.
-
merge_tau_trace_files
(prefix)[source]¶ Use tau_treemerge.pl to merge multiple TAU trace files into a single edf and a single trc file.
The new edf file and trc file are written to
prefix
.Parameters: prefix (str) – Path to the directory containing *.trc
and*.edf
files.
-
runtime_config
(opts=None, env=None)[source]¶ Configures environment for execution with TAU.
Modifies incoming command line arguments and environment variables for the TAU library and tau_exec script.
Parameters: Returns: (opts, env) updated to support TAU.
Return type:
-
show_data_files
(dataset, profile_tools=None, trace_tools=None)[source]¶ Displays profile and trace data.
Opens one more more data analysis tools to display the specified data files.
Parameters: - dataset (dict) – Lists of paths to data files indexed by data format. See
get_data_format
. - profile_tools (list) – Visualization or data processing tools for profiles.
- trace_tools (list) – Visualization or data processing tools for traces.
Raises: ConfigurationError
– An error occurred while displaying a data file.- dataset (dict) – Lists of paths to data files indexed by data format. See
-
tau_metrics
()[source]¶ List TAU metrics available on this target.
Returns a list of (name, description) tuples.
Returns: List of event name/description tuples. Return type: list