Example #1
0
def tau_arch():
    """Detect the TAU architecture "magic keyword" that matches the host.
    
    Mostly relies on Python's platform module but may also probe 
    environment variables and file systems in cases where the arch 
    isn't immediately known to Python.  These tests may be expensive
    so the detected value is cached to improve performance.
    
    Returns:
        TauArch: The matching tau architecture description.
        
    Raises:
        ConfigurationError: Host architecture or operating system not supported.
    """
    try:
        inst = tau_arch.inst
    except AttributeError:
        host_arch = architecture()
        host_os = operating_system()
        try:
            inst = TauArch.get(host_arch, host_os)
        except KeyError:
            raise ConfigurationError("%s on %s is not supported." % (host_os, host_arch))
        tau_arch.inst = inst
    return inst
 def __init__(self, prefix, src, target_arch, target_os, compilers):
     super(PdtInstallation, self).__init__('PDT', prefix, src, compilers[CXX_ROLE].info.family.name, 
                                           target_arch, target_os, compilers, SOURCES, COMMANDS, None)
     self.arch = TauArch.get(target_arch, target_os)
     self.arch_path = os.path.join(self.install_prefix, self.arch.name)
     self.bin_path = os.path.join(self.arch_path, 'bin')
     self.lib_path = os.path.join(self.arch_path, 'lib')
 def __init__(self, prefix, src, target_arch, target_os, compilers, 
              verbose,
              # Source for dependencies
              pdt,
              binutils,
              libunwind,
              papi,
              # Application support features
              openmp_support,
              pthreads_support, 
              mpi_support,
              mpi_include_path,
              mpi_library_path,
              mpi_libraries,
              cuda_support,
              cuda_prefix,
              opencl_support,
              opencl_prefix,
              shmem_support,
              mpc_support,
              # Instrumentation methods and options
              source_inst,
              compiler_inst,
              link_only,
              io_inst,
              keep_inst_files,
              reuse_inst_files,
              # Measurement methods and options
              profile,
              trace,
              sample,
              metrics,
              measure_mpi,
              measure_openmp,
              measure_opencl,
              measure_pthreads,
              measure_cuda,
              measure_shmem,
              measure_mpc,
              measure_memory_usage,
              measure_memory_alloc,
              callpath_depth):
     """Initialize the TAU installation wrapper class.
     
     Args:
         prefix (str): Path to a directory to contain subdirectories for 
                       installation files, source file, and compilation files.
         src (str): Path to a directory where the software has already been 
                    installed, or a path to a source archive file, or the special
                    keyword 'download'.
         host_arch (Architecture): Target architecture description.
         host_os (OperatingSystem): Target operating system description.
         compilers (InstalledCompilerSet): Compilers to use if software must be compiled.
         verbose (bool): True to enable TAU verbose output.
         pdt_source (str): Path to PDT source, installation, or None.
         binutils_source (str): Path to GNU binutils source, installation, or None.
         libunwind_source (str): Path to libunwind source, installation, or None.
         papi_source (str): Path to PAPI source, installation, or None.
         openmp_support (bool): Enable or disable OpenMP support in TAU.
         pthreads_support (bool): Enable or disable pthreads support in TAU.
         mpi_support (bool): Enable or disable MPI support in TAU.
         mpi_include_path (list):  Paths to search for MPI header files. 
         mpi_library_path (list): Paths to search for MPI library files.
         mpi_libraries (list): MPI libraries to include when linking with TAU.
         cuda_support (bool): Enable or disable CUDA support in TAU.
         shmem_support (bool): Enable or disable SHMEM support in TAU.
         mpc_support (bool): Enable or disable MPC support in TAU.
         source_inst (bool): Enable or disable source-based instrumentation in TAU.
         compiler_inst (bool): Enable or disable compiler-based instrumentation in TAU. 
         link_only (bool): True to disable instrumentation and link TAU libraries.
         io_inst (bool): Enable or disable POSIX I/O instrumentation in TAU.
         keep_inst_files (bool): If True then do not remove instrumented source files after compilation.
         reuse_inst_files (bool): If True then reuse instrumented source files for compilation when available.
         profile (bool): Enable or disable profiling.
         trace (bool): Enable or disable tracing.
         sample (bool): Enable or disable event-based sampling.
         metrics (list): Metrics to measure, e.g. ['TIME', 'PAPI_FP_INS']
         measure_mpi (bool): If True then measure time spent in MPI calls. 
         measure_openmp (bool): If True then measure time spent in OpenMP directives.
         measure_pthreads (bool): If True then measure time spent in pthread calls.
         measure_cuda (bool): If True then measure time spent in CUDA calls.
         measure_shmem (bool): If True then measure time spent in SHMEM calls.
         measure_mpc (bool): If True then measure time spent in MPC calls.
         measure_memory_usage (bool): If True then measure memory usage.
         measure_memory_alloc (bool): If True then record memory allocation **and deallocation** events.
         callpath_depth (int): Depth of callpath measurement.  0 to disable.
     """
     super(TauInstallation, self).__init__('TAU', prefix, src, "", target_arch, target_os, compilers, 
                                           SOURCES, COMMANDS, None)
     try:
         self.arch = TauArch.get(target_arch, target_os)
     except KeyError:
         raise InternalError("Invalid target_arch '%s' or target_os '%s'" % (target_arch, target_os))
     self.arch_path = os.path.join(self.install_prefix, self.arch.name)
     self.bin_path = os.path.join(self.arch_path, 'bin')
     self.lib_path = os.path.join(self.arch_path, 'lib')
     self.verbose = verbose
     self.pdt = pdt
     self.binutils = binutils
     self.libunwind = libunwind
     self.papi = papi
     self.openmp_support = openmp_support
     self.opencl_support = opencl_support
     self.opencl_prefix = opencl_prefix
     self.pthreads_support = pthreads_support 
     self.mpi_support = mpi_support
     self.mpi_include_path = mpi_include_path
     self.mpi_library_path = mpi_library_path
     self.mpi_libraries = mpi_libraries
     self.cuda_support = cuda_support
     self.cuda_prefix = cuda_prefix
     self.shmem_support = shmem_support
     self.mpc_support = mpc_support
     self.source_inst = source_inst
     self.compiler_inst = compiler_inst
     self.link_only = link_only
     self.io_inst = io_inst
     self.keep_inst_files = keep_inst_files
     self.reuse_inst_files = reuse_inst_files
     self.profile = profile
     self.trace = trace
     self.sample = sample
     self.metrics = metrics
     self.measure_mpi = measure_mpi
     self.measure_openmp = measure_openmp
     self.measure_opencl = measure_opencl
     self.measure_pthreads = measure_pthreads
     self.measure_cuda = measure_cuda
     self.measure_shmem = measure_shmem
     self.measure_mpc = measure_mpc
     self.measure_memory_usage = measure_memory_usage
     self.measure_memory_alloc = measure_memory_alloc
     self.callpath_depth = callpath_depth