Changes between Version 11 and Version 12 of Orio/TuneSpecs
- Timestamp:
- 06/13/08 09:58:10 (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Orio/TuneSpecs
v11 v12 96 96 One prerequisite of a user-provided initialization program is that the input variables’ initializations must be enclosed inside a function named `init_input_vars`; otherwise, Orio will report an error message. 97 97 98 == Extending the Performance TestingCode ==98 == Overriding the Performance-Testing Skeleton Code == 99 99 100 First, let us look at the basic C skeleton code used by Orio to measure the performance of the optimized code.100 Orio offers its users a capability of modifying how to precisely carry out the performance testing process. But first, let us look at the basic C skeleton code used by Orio to measure the performance of the optimized code. 101 101 102 102 {{{ … … 144 144 Four important tags exist in the skeleton code, each with its own special purpose. The '`/*@ global @*/`' tag is used by the driver to place global declarations such as input variable declarations and the initialization function of the input arrays. The ‘`/*@ prologue @*/`’ tag is the spot where to dynamically allocate memory space for input arrays and to call the function that initializes all input variables. The ‘`/*@ tested code @*/`’ tag designates the location of the code tested for its performance. And the last tag ‘`/*@ epilogue @*/`’ remains unused until now, but it is kept for potential development in the future. 145 145 146 From the skeleton code, it can also be observed that Orio simply uses elapsed time as its performance metric through the standard C’s `gettimeofday` function. As a part of our future plans, we intend to employ a performance counter tool, such as TAO and PAPI, to facilitate a finer grained performance measurement (e.g. the number of processor clock cycles).146 To change the performance testing process, Orio provides a way to its users to override the performance-testing skeleton code with their own skeleton code. This can be done by specifying the new user-written skeleton code in the tuning specifications as described below. The new skeleton code must also have the four important tags mentioned before, or the performance testing driver will complain. 147 147 148 {{{ 149 def performance_test_code { 150 arg skeleton_code_file = 'my_skeleton_code.c'; 151 } 152 }}} 153 154 One example of the advantages of overriding the performance-testing skeleton code is to have a finer grained performance measurement, that is by counting the number of processor clock cycles instead of calculating the elapsed time (through the standard C’s `gettimeofday` function). Of course, to do this requires an installation of a performance counter tool such as TAO or PAPI. So, Orio users need to revise the skeleton code by inserting code used for initializing performance counter library and for setting event counters. 155 156