NOTE: the instructions below represent a rapidly changing experimental
      setup. Contact idooley2@uiuc.edu for the latest status. I am 
      currently adding support for PAPI performance counters, so the 
      format of the CYCLE_ACCURATE_TIMES file has recently changed


Building / Compiling :
  
  Install GSL, the GNU Scientific Library. This is required 
  to perform least square curve fitting. Make sure the local
  makefile points to your copy of gsl. Currently this is 
  in the variable "LIBS"

  Build charm/bigemulator

  Modify the file interpolatelog.C to match your particular tastes.
    OUTPUTDIR         specifies a directory for the new logfiles

    CYCLE_TIMES_FILE  specifies the file which contains accurate 
                      timing information

    time_factor       specifies a multiplier used to scale any times 
                      that are not replaced by times approximated
                      from available cycle-accurate times

  Make the interpolation tool: 
    > make

Modifying Application:

  Insert startTraceBigSim() call before a compute kernel. Add an 
  endTraceBigSim() call after the kernel. Currently the first call
  takes no parameters, and the second takes a name for the event
  that is being bracketed, followed by between 0 and 20 parameters 
  describing the computation. 

  You will find the definitions of these functions in traceBigSim/

  startTraceBigSim();
  // Some serial computational kernel goes here
  endTraceBigSim("EventName",param1,param2,param3);

  Thes calls will time and produce output(to STDOUT) that lists 
  the time, parameters, and possibly some performance counters
  for the code executed between the calls. 

  A sample output file: traceBigSim/sample_namd_timings.txt

  Run the application, in serial or parallel to produce a good
  set of samples of the timings. These timings will be used 
  to predict the performance for the events appearing in a
  bgTrace log files. Put all of these timings in the file
  reference by CYCLE_TIMES_FILE in interpolatelog.C. You can 
  grep out only the lines containing TRACEBIGSIM, and can 
  concatenate them all together into one big file.

 
Running The interpolation tool:
  
  Run a parallel version of the application to generate the bgTrace* 
  and param* files.

  Run the interpolation tool from a directory containing the bgTrace*,
  param*, and CYCLE_TIMES_FILE files. If you want these files to be 
  located elsewhere, you should be able to modify interpolatelog.C
  and EventInterpolator.C easily.

  A new set of bgTrace files will be produced.
