# HG changeset patch # User Me # Date 1284200562 25200 # Node ID 0756230c5134a5f23a4aec476864379316e5cc93 Initial add -- working app to measure suspend and master times However, has weird suspend time histogram.. needs tweaking. Will take update of the histogram out of core loop and put into app diff -r 000000000000 -r 0756230c5134 src/Application/MeasVMS_MeasureFn/EntryPoint.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Application/MeasVMS_MeasureFn/EntryPoint.c Sat Sep 11 03:22:42 2010 -0700 @@ -0,0 +1,39 @@ +/* + * Copyright 2009 OpenSourceStewardshipFoundation.org + * Licensed under GNU General Public License version 2 + * + * Author: seanhalle@yahoo.com + * + */ + + +#include "MeasVMS_MeasureFn.h" + + + +/*Every MeasVMS system has an "entry point" function that creates the first + * processor, which starts the chain of creating more processors.. + * eventually all of the processors will dissipate themselves, and + * return. + * + *This entry-point function follows the same pattern as all entry-point + * functions do: + *1) it creates the params for the seed processor, from the + * parameters passed into the entry-point function + *2) it calls MeasVMS__create_seed_procr_and_do_work + *3) it gets the return value from the params struc, frees the params struc, + * and returns the value from the function + * + */ +void +measureVMS( Histogram **suspHistAddr, Histogram **masterHistAddr ) + { + PairOfHistAddresses *histCarrier = malloc( sizeof( PairOfHistAddresses )); + + histCarrier->suspHistAddr = suspHistAddr; + histCarrier->masterHistAddr = masterHistAddr; + + MeasVMS__create_seed_procr_and_do_work( &measSuspendFn, histCarrier ); + + //return measurement values via side-effect + } diff -r 000000000000 -r 0756230c5134 src/Application/MeasVMS_MeasureFn/MeasVMS_MeasureFn.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Application/MeasVMS_MeasureFn/MeasVMS_MeasureFn.h Sat Sep 11 03:22:42 2010 -0700 @@ -0,0 +1,25 @@ +/* + * Copyright Oct 24, 2009 OpenSourceStewardshipFoundation.org + * Licensed under GNU General Public License version 2 + */ + +#ifndef _MeasVMS_MATRIX_MULT_H_ +#define _MeasVMS_MATRIX_MULT_H_ + +#include + +#include "../../MeasVMS_lib/MeasVMS.h" +#include "../../MeasVMS_lib/VMS/Histogram/Histogram.h" + +//============================== Entry Point ================================ +void +measureVMS( Histogram **suspHistAddr, Histogram **masterHistAddr ); + +//============================== Structures =============================== + +//=========================== Processor Functions =========================== + +void measSuspendFn( void *_params, VirtProcr *animatingPr ); + + +#endif /*_MeasVMS_MATRIX_MULT_H_*/ diff -r 000000000000 -r 0756230c5134 src/Application/MeasVMS_MeasureFn/seed_Pr.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Application/MeasVMS_MeasureFn/seed_Pr.c Sat Sep 11 03:22:42 2010 -0700 @@ -0,0 +1,46 @@ +/* + * Copyright 2009 OpenSourceStewardshipFoundation.org + * Licensed under GNU General Public License version 2 + * + * Author: seanhalle@yahoo.com + * + */ + + +#include "MeasVMS_MeasureFn.h" +#include "../../MeasVMS_lib/VMS/Histogram/Histogram.h" + +/*The request handler puts this exact same processor into + * the queue twice. The time calculated by first one is overwritten by + * the time calculated by second -- the request handler adds that to the + * histogram. + *Background: the VMS__suspend_procr has been modified to do RDTSC before + * suspend and again after resume. It saves the values into the VirtProcr + * data-struc. This appVP breaks the abstraction by directly accessing + * the values in the VirtProcr data-struct. + * + *NOTE: also breaks the rules by never dissipating -- the request handler + * has to decide when to destroy the VPs animating copies of this function. + * + */ +void measSuspendFn( void *_params, VirtProcr *animatingPr ) + { + unsigned int diff; + Histogram * hist; + + hist = (Histogram *)_params; + + VMS__suspend_procr( animatingPr ); + + while( TRUE ) + { + //This suspend sets the values used in calcs -- request handler + // puts two copies of reference to animatingPr into queue, so + // resumes immediately after suspend, with no MasterVP between + VMS__suspend_procr( animatingPr ); + + //This suspend just lets request handler put two more into queue + // Notice, there is no request created, handler knows what to do + VMS__suspend_procr( animatingPr ); + } + } diff -r 000000000000 -r 0756230c5134 src/Application/main.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Application/main.c Sat Sep 11 03:22:42 2010 -0700 @@ -0,0 +1,31 @@ +/* + * Copyright Oct 24, 2009 OpenSourceStewardshipFoundation.org + * Licensed under GNU General Public License version 2 + * + * author seanhalle@yahoo.com + */ + +#include +#include + +#include "../MeasVMS_lib/VMS/Histogram/Histogram.h" +#include "MeasVMS_MeasureFn/MeasVMS_MeasureFn.h" + +/** + *Matrix multiply program written using VMS_HW piggy-back language + * + */ +int main( int argc, char **argv ) + { + Histogram *suspHist, *masterHist; + + measureVMS( &suspHist, &masterHist ); + + printf("\ncore loop hist\n"); + printHist( suspHist ); + + printf("\nmaster hist\n"); + printHist( masterHist ); + + exit(0); //cleans up + }