Chapter 6. Using TAU to Monitor the Performance of Components

$Revision: 1.6 $

$Date: 2004/10/09 00:56:46 $

Table of Contents

6.1. Creating the Proxy Component
6.2. Using the proxy generator
6.3. Using the new proxy component

In this exercise, you will use the TAU performance observation tools to automatically generate a proxy component that monitors all of the method invocations on a port allowing you to track their performance information. While this approach won't provide all of the performance details of what is going on inside each component, it gives you a very simple way to begin analyzing the performance of a CCA-based application in order to identify which components might have performance issues.

We will start by create a proxy component for the integrator.IntegratorPort. Note that you only need to have completed Chapter 3, Sewing CCA Components into an Application: the Driver Component in order to follow these instructions. Though the proxy will be implemented in C++, it can proxy for components implemented in any language.

[Warning] Warning

The following instructions assume that you chose to implement the drivers.CXXDriver rather than the drivers.F90Driver. If you implemented the drivers.F90Driver, you will need to edit task4_rc to reflect this.

6.1. Creating the Proxy Component

  1. Edit the file student-src/components/sidl/integrators.sidl and make the following addition:

    package integrators version 1.0 {
    
      class MonteCarlo implements integrator.IntegratorPort,
                                  gov.cca.Component,
                                  gov.cca.ComponentRelease
      {
            // integrator.IntegratorPort methods:
            double integrate(in double lowBound, in double upBound, in int count);
    
            // gov.cca.Component methods:
            void setServices(in gov.cca.Services services) throws gov.cca.CCAException;
    
            // gov.cca.ComponentRelease methods:
            void releaseServices(in gov.cca.Services services) throws gov.cca.CCAException;
      }
    
    class IntegratorProxy implements-all integrator.IntegratorPort, 
                                                    gov.cca.Component
      {
      }			
    }
    

    This will give us a new component, called IntegratorProxy that implements the integrator.IntegratorPort.

  2. Edit student-src/components/MakeIncl.components and make the following additions:

    # SIDL files containing component declarations
    # For example:
    # SIDL_FILES = sidl/drivers.sidl
    SIDL_FILES = sidl/functions.sidl sidl/integrators.sidl sidl/randomgens.sidl \
                 sidl/drivers.sidl
    
    # The COMPONENTS list contains the fully-qualified names of the component
    # classes, augmented with -LANGUAGE, where LANGUAGE is the language
    # in which the component is implemented, e.g., c, c++, f90.
    # For example:
    # COMPONENTS = drivers.F90Driver-f90 drivers.CXXDriver-c++
    COMPONENTS = functions.PiFunction-c++ \
            integrators.MonteCarlo-f90 randomgens.RandNumGenerator-c++ \
            drivers.CXXDriver-c++ integrators.IntegratorProxy-c++
    

  3. In the student-src/components directory, type make .integrators.IntegratorProxy-c++ to rebuild the repository. The output should look something like this:

    
    ### Generating XML for SIDL packages containing component declarations
    /san/shared/cca/tutorial/bin/babel -t xml -R../xml_repository \
        -R/san/shared/cca/tutorial/share/cca-spec-babel-0_7_0-babel-0.9.4/xml \
        -o ../xml_repository sidl/functions.sidl sidl/integrators.sidl \
        sidl/randomgens.sidl sidl/drivers.sidl
    Babel: Parsing URL "file:/.automount/whale/root/san/r1a010/bernhold/\
      student-src/components/sidl/functions.sidl"...
    Babel: Warning: Symbol exists in XML repository: \
           functions.LinearFunction-v1.0
    Babel: Warning: Symbol exists in XML repository: \
           functions.NonlinearFunction-v1.0
    Babel: Warning: Symbol exists in XML repository: \
           functions.PiFunction-v1.0
    Babel: Parsing URL "file:/.automount/whale/root/san/r1a010/bernhold/\
      student-src/components/sidl/integrators.sidl"...
    Babel: Warning: Symbol exists in XML repository: \
           integrators.MonteCarlo-v1.0
    Babel: Parsing URL "file:/.automount/whale/root/san/r1a010/bernhold/\
      student-src/components/sidl/randomgens.sidl"...
    Babel: Warning: Symbol exists in XML repository: \
           randomgens.RandNumGenerator-v1.0
    Babel: Parsing URL "file:/.automount/whale/root/san/r1a010/bernhold/\
           student-src/components/sidl/drivers.sidl"...
    Babel: Warning: Symbol exists in XML repository: \
           drivers.CXXDriver-v1.0
    touch .repository
    
    ### Generating a c++ implementation for the integrators.IntegratorProxy \
        component.
    /san/shared/cca/tutorial/bin/babel -s c++ -R../xml_repository \
        -R/san/shared/cca/tutorial/share/cca-spec-babel-0_7_0-babel-0.9.4/xml \
        -g -u -E -l -m integrators.IntegratorProxy. --suppress-timestamp \
        integrators.IntegratorProxy
    Babel: Resolved symbol "integrators.IntegratorProxy"...
    touch .integrators.IntegratorProxy-c++