include/hooks.h

Section: PARSEC Hooks Instrumentation API (3)
Updated: 16 Jan 2009
Index Return to Main Contents
 

NAME

include/hooks.h - The specification of the PARSEC Hooks Instrumentation API.  

SYNOPSIS


 

Defines


#define _PARSEC_HOOKS_HOOKS_H 1
 

Enumerations


enum __parsec_benchmark { __parsec_blackscholes, __parsec_bodytrack, __parsec_canneal, __parsec_dedup, __parsec_facesim, __parsec_ferret, __parsec_fluidanimate, __parsec_freqmine, __parsec_raytrace, __parsec_streamcluster, __parsec_swaptions, __parsec_vips, __parsec_x264 }
Identifiers for the benchmark programs.  

Functions


void __parsec_bench_begin (enum __parsec_benchmark __bench)
Beginning of program execution.
void __parsec_bench_end ()
End of program execution.
void __parsec_roi_begin ()
Beginning of Region-of-Interest.
void __parsec_roi_end ()
End of Region-of-Interest.  

Detailed Description

The specification of the PARSEC Hooks Instrumentation API.

This file specifies the PARSEC Hooks Instrumentation API. If enabled each PARSEC workloads calls the hooks library functions at certain predetermined locations. These functions can be used to plug in any type of functionality at the designated locations of each PARSEC workload. Some preliminary functionality is already provided which can be enabled or disabled in the config.h file of the hooks library before compilation.

Benchmark programs typically call the hook functions as follows:

 int main() {
   __parsec_bench_begin(__parsec_example);
   do_init();

   __parsec_roi_begin();
   //Begin of parallel phase
   for(int i=0; i<NTHREADS; i++)
     pthread_create(t[i], NULL, worker_func, NULL);

   //Wait until all threads have terminated
   for(int i=0; i<NTHREADS; i++)
     pthread_join(t[i], NULL);
   //End of parallel phase
   __parsec_roi_end();

   do_cleanup();
   __parsec_bench_end();
   return 0;
 }

If you modify this file, you might also have to update all benchmark programs of the PARSEC distribution. To change the behavior of the PARSEC hooks, look at files config.h and hooks.c.  

Define Documentation

 

#define _PARSEC_HOOKS_HOOKS_H 1

Guard macro to prevent multiple inclusions.  

Enumeration Type Documentation

 

enum __parsec_benchmark

Identifiers for the benchmark programs.

Each workload has exactly one unique identifier in this enumeration. The benchmark passes it to __parsec_bench_begin() at the beginning of its execution.  

Function Documentation

 

void __parsec_bench_begin (enum __parsec_benchmark __bench)

Beginning of program execution.

Parameters:

__bench Unique workload identifier.

This function is executed exactly once, as soon as the program starts.

Its logical counterpart is __parsec_bench_end.  

void __parsec_bench_end ()

End of program execution.

This function is executed exactly once, just before the program ends.

Its logical counterpart is __parsec_bench_begin.  

void __parsec_roi_begin ()

Beginning of Region-of-Interest.

This function is executed exactly once, just before the Region-of-Interest (ROI) is entered. The ROI is the part of the code that should be used for benchmarking and analysis. It contains the entire parallel phase of the program.

The logical counterpart of this function is __parsec_roi_end.  

void __parsec_roi_end ()

End of Region-of-Interest.

This function is executed exactly once, immediately after the Region-of-Interest (ROI) is left. The ROI is the part of the code that should be used for benchmarking and analysis. It contains the entire parallel phase of the program.

The logical counterpart of this function is __parsec_roi_begin.  

AUTHOR

Written by Christian Bienia.

Generated automatically by Doxygen for PARSEC Hooks Instrumentation API from the source code.  

COPYRIGHT

Copyright (c) 2006-2009 Princeton University  

SEE ALSO

parsec(7), hooks(7)


 

Index

NAME
SYNOPSIS
Defines
Enumerations
Functions
Detailed Description
Define Documentation
#define _PARSEC_HOOKS_HOOKS_H 1
Enumeration Type Documentation
enum __parsec_benchmark
Function Documentation
void __parsec_bench_begin (enum __parsec_benchmark __bench)
void __parsec_bench_end ()
void __parsec_roi_begin ()
void __parsec_roi_end ()
AUTHOR
COPYRIGHT
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 04:41:54 GMT, February 24, 2009