Package openss
[show private | hide private]
[frames | no frames]

Package openss

OpenSpeedShop python interface package.

This package is essentially another UI for OpenSpeedShop. Currently this is done by converting the APIs objects into OpenSpeedShop CLI (Command Line Interface) syntax passing them to a common parser and semantic handler. The rational for this method is to reduce duplicate code and make behavior consistant across UIs.

This also means that one needs to reference the Open|SpeedShop User's Guide for detailed descriptions of experiment setup and behavior, as well as details about experiment collectors and view options.

OpenSpeedShop is developed to be extensible through dynamic plugins. This means that some information may not be available in a static document. Some information may only be available through the help facilities of the GUI or CLI (Command Line Interface). It is strongly suggested that the OpenSpeedShop python API user become familiar with one or both of these UIs in order to glean information not available in the standard documentation.

If the underlying OpenSpeedShop encounters an error it will throw a python exception: openss.error.

Generally, one wants to create an experiment, associate it with the application to be profiled, and describe the type of data to be collected.

After the experiment is defined one runs it, either letting it run its course or run partially. This generates raw information that is accessed with the expView() command. There may be multiple views available for a particular experiment type (See list()) and can be set with the expSetParam() command.

A simple example:
   import openss

   # Create a FileList object with the name of
   # the application to analyze.
   my_file = openss.FileList("myprog")
   
   # Determine the type of experiment to run.
   my_exptype = openss.ExpTypeList("pcsamp")

   # Register the experiment to be run.
   my_id = openss.expCreate(my_file,my_exptype)
   
   # Run the instrumented application
   openss.expGo()

   # expGo is the only asynchronous command. We may need
   # to wait until our app is done before harvesting
   # the data.
   openss.wait()
   
   # Describe the type of view we want and get the 
   # results of the experiment.
   my_viewtype = openss.ViewTypeList()
   my_viewtype += "pcsamp"
   result = openss.expView(my_id,my_viewtype)

   # Print out the results. In this case the results are
   # in a double array. Normally either the structure of
   # the return value will be known or one will have to 
   # query each of the object elements.
   r_count = len(result)
   for row_ndx in range(r_count):
       print " "
       row =result[row_ndx]
       c_count = len(row)
       for rel_ndx in range(c_count):
           print row[rel_ndx]

   # Cleanup any intermediate openss files.
   openss.exit()

Submodules

Generated by Epydoc 2.1 on Fri Nov 11 11:55:14 2005 http://epydoc.sf.net