# HG changeset patch # User Sean Halle # Date 1369269623 25200 # Node ID 72ffdb11ad8e92b5b019128f82befa59eac7c68f # Parent 2fc69e6c14eac85925eaf0d2a7889f7e4b82e6f0 Removed files that interfere with build -- for probes and counter recording diff -r 2fc69e6c14ea -r 72ffdb11ad8e AnimationMaster.c --- a/AnimationMaster.c Fri Mar 08 05:34:21 2013 -0800 +++ b/AnimationMaster.c Wed May 22 17:40:23 2013 -0700 @@ -10,7 +10,6 @@ #include #include "PR.h" -#include "VSs_impl/VSs.h" //========================= Local Declarations ======================== inline PRProcess * diff -r 2fc69e6c14ea -r 72ffdb11ad8e Defines/PR_defs__HW_constants.h --- a/Defines/PR_defs__HW_constants.h Fri Mar 08 05:34:21 2013 -0800 +++ b/Defines/PR_defs__HW_constants.h Wed May 22 17:40:23 2013 -0700 @@ -15,6 +15,13 @@ //This value is the number of hardware threads in the shared memory // machine #define NUM_CORES 4 + //Now, check if sequential mode is on, and set num cores to 1, so that + // lang plugin code doesn't have to check for sequential mode +#ifdef DEBUG__TURN_ON_SEQUENTIAL_MODE + #undef NUM_CORES + #define NUM_CORES 1 +#endif + //tradeoff amortizing master fixed overhead vs imbalance potential // when work-stealing, can make bigger, at risk of losing cache affinity diff -r 2fc69e6c14ea -r 72ffdb11ad8e PR__WL.c --- a/PR__WL.c Fri Mar 08 05:34:21 2013 -0800 +++ b/PR__WL.c Wed May 22 17:40:23 2013 -0700 @@ -165,7 +165,7 @@ //WARNING: not updated.. may be buggy req = PR_int__malloc( sizeof(PRReqst) ); req->reqType = Language; - req->langReq = langReqData; + req->langReq = langReqData; req->nextReqst = callingSlv->request; callingSlv->request = req; } diff -r 2fc69e6c14ea -r 72ffdb11ad8e PR__int.c --- a/PR__int.c Fri Mar 08 05:34:21 2013 -0800 +++ b/PR__int.c Wed May 22 17:40:23 2013 -0700 @@ -61,7 +61,7 @@ #endif //======================================================================== - newSlv->typeOfVP = GenericSlave; + newSlv->typeOfVP = GenericSlave; //may be changed later! return newSlv; } diff -r 2fc69e6c14ea -r 72ffdb11ad8e PR_req_handlers.c --- a/PR_req_handlers.c Fri Mar 08 05:34:21 2013 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -/* - * Copyright 2010 OpenSourceStewardshipFoundation - * - * Licensed under BSD - */ - -#include -#include -#include -#include -#include -#include - -#include "PR.h" - - -/* MEANING OF WL PI SS int - * These indicate which places the function is safe to use. They stand for: - * WL: Wrapper Library - * PI: Plugin - * SS: Startup and Shutdown - * int: internal to the PR implementation - */ - - -/* - */ -void inline -handleMakeProbe( PRSemReq *semReq, void *semEnv, ResumeSlvFnPtr resumeFn ) - { IntervalProbe *newProbe; - - newProbe = PR_int__malloc( sizeof(IntervalProbe) ); - newProbe->nameStr = PR_int__strDup( semReq->nameStr ); - newProbe->hist = NULL; - newProbe->schedChoiceWasRecorded = FALSE; - - //This runs in masterVP, so no race-condition worries - newProbe->probeID = - addToDynArray( newProbe, _PRMasterEnv->dynIntervalProbesInfo ); - - semReq->requestingSlv->dataRetFromReq = newProbe; - - //This in inside PR, while resume_slaveVP fn is inside language, so pass - // pointer from lang to here, then call it. - (*resumeFn)( semReq->requestingSlv, semEnv ); - } - -void inline -handleThrowException( PRSemReq *semReq, void *semEnv, ResumeSlvFnPtr resumeFn ) - { - PR_int__throw_exception( semReq->msgStr, semReq->requestingSlv, semReq->exceptionData ); - - (*resumeFn)( semReq->requestingSlv, semEnv ); - } - - - diff -r 2fc69e6c14ea -r 72ffdb11ad8e Services_Offered_by_PR/Measurement_and_Stats/MEAS__Counter_Recording.c --- a/Services_Offered_by_PR/Measurement_and_Stats/MEAS__Counter_Recording.c Fri Mar 08 05:34:21 2013 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,156 +0,0 @@ -/* - * - * author: Nina Engelhardt - */ - -#include "PR_MEAS__Counter_Recording.h" -#include "PR_impl/PR.h" -//#include "../PRServ.h" - -#ifdef HOLISTIC__TURN_ON_PERF_COUNTERS - -void -PR_MEAS__init_counter_data_structs_for_Lang( SlaveVP *slave, int32 magicNum ) - { - PRServLangEnv *langEnv = - (PRServLangEnv *)PR_SS__give_lang_env_for_slave( slave, magicNum ); - int i; - for(i=0;icounterList[i] = makeListOfArrays(sizeof(CounterEvent), 128); - } - } - -/*Pass file by side effect.. - *The reason is that using doAllInListOfArrays, to which one passes the pointer - * to a function, which is then applied to all the elements.. but, that fn - * can only take one input -- the element from the list of arrays.. so, it - * can't also be passed the file.. hence pass the file by side effect - * - *However, multiple cores could be trying to do this.. so, create a separate - * lock just for counters, and acquire that when set the file, then release - * once all the printing is done. - */ -void -PR_MEAS__set_counter_file(FILE* f) - { - acquire counter lock - counterfile = f; - } - -PR_MEAS__release_counter_file() - { - release counter lock - } - -void -PR_MEAS__addToListOfArraysCounterEvent(CounterEvent value, ListOfArrays* list) - { - int offset_in_fragment = list->next_free_index % list->num_entries_per_fragment; - if(offset_in_fragment == 0) - { void* newBlock = malloc(list->entry_size * list->num_entries_per_fragment); - addToDynArray(newBlock,list->dim1info); - } - CounterEvent* typedFragment = (CounterEvent*) ((list->dim1)[list->dim1info->numInArray -1]); - typedFragment[offset_in_fragment] = value; - list->next_free_index++; - } - -void -PR_MEAS__counter_handler(int evt_type, int vpid, int task, SlaveVP* pr, uint64 cycles, uint64 instrs) - { - if (pr->typeOfVP == Master_VP || pr->typeOfVP == ShutdownVP) - { //Only save values for application work, done in a SlaveVP - return; - } - - //Note: have made many changes without compiler flag turned on, nor test.. - PRLangEnv *langEnv = - PR_int__give_proto_lang_env_from_slave( pr, magicNum); - - CounterEvent e; - e.event_type = evt_type; - e.vp = vpid; - e.task = task; - - e.cycles = cycles; - e.instrs = instrs; - - if(pr) - { e.coreID = pr->coreAnimatedBy; - e.slot = pr->animSlotAssignedTo; - } - else - { e.coreID = -1; - e.slot = NULL; - } - - int corenum; - - if(pr) - corenum = pr->coreAnimatedBy; - else - return; - - if(evt_type==Work_start || evt_type==Work_end || evt_type==AppResponderInvocation_start) - { addToListOfArrays_ext(CounterEvent,e,langEnv->counterList[corenum]); - } - else - { PR_MEAS__addToListOfArraysCounterEvent(e,langEnv->counterList[corenum]); - } - } - - - -void -PR_MEAS__print_counter_event_to_file( void* _e ) - { - CounterEvent* e = (CounterEvent*) _e; - fprintf(counterfile, "event, "); - switch(e->event_type) - { - case AppResponderInvocation_start: - fprintf(counterfile, "AppResponderInvocation_start"); - break; - case AppResponder_start: - fprintf(counterfile, "AppResponder_start"); - break; - case AppResponder_end: - fprintf(counterfile, "AppResponder_end"); - break; - case AssignerInvocation_start: - fprintf(counterfile, "AssignerInvocation_start"); - break; - case NextAssigner_start: - fprintf(counterfile, "NextAssigner_start"); - break; - case Assigner_start: - fprintf(counterfile, "Assigner_start"); - break; - case Assigner_end: - fprintf(counterfile, "Assigner_end"); - break; - case Work_end: - fprintf(counterfile, "Work_end"); - break; - case Work_start: - fprintf(counterfile, "Work_start"); - break; - case HwResponderInvocation_start: - fprintf(counterfile, "HwResponderInvocation_start"); - break; - case Timestamp_start: - fprintf(counterfile, "Timestamp_start"); - break; - case Timestamp_end: - fprintf(counterfile, "Timestamp_end"); - break; - default: - fprintf(counterfile, "unknown event"); - } - fprintf(counterfile,", %d, %d, %llu, %llu",e->vp,e->task,e->cycles,e->instrs); - if(e->coreID >=0) - fprintf(counterfile,", %d",e->coreID); - fprintf(counterfile,"\n"); - fflush(counterfile); - } -#endif diff -r 2fc69e6c14ea -r 72ffdb11ad8e Services_Offered_by_PR/Measurement_and_Stats/MEAS__Counter_Recording.h --- a/Services_Offered_by_PR/Measurement_and_Stats/MEAS__Counter_Recording.h Fri Mar 08 05:34:21 2013 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -/* - * File: PR_MEAS__Counter_Recording.h - * Author: nengel - * - * Created on January 11, 2012, 3:03 PM - */ - -#ifndef PR_MEAS__COUNTER_RECORDING_H -#define PR_MEAS__COUNTER_RECORDING_H - -#include "PR_impl/PR.h" - -typedef struct - { - int event_type; - int coreID; - AnimSlot* slot; - int vp; - int task; - uint64 cycles; - uint64 instrs; - } -CounterEvent; - -FILE* counterfile; //pass file handle via side effect because - // doAllInListOfArrays only takes Fns with a single input - -void PR_MEAS__init_counter_data_structs_for_lang( SlaveVP *slv, int32 magicNum ); - -void PR_MEAS__counter_handler(int evt_type, int vpid, int task, SlaveVP* pr, uint64 cycles, uint64 instrs); - -void PR_MEAS__set_counter_file(FILE* f); - -void PR_MEAS__print_counter_event_to_file( void* _e ); -#endif /* PRServ_COUNTER_RECORDING_H */ - diff -r 2fc69e6c14ea -r 72ffdb11ad8e Services_Offered_by_PR/Services_Language/PRServ.h --- a/Services_Offered_by_PR/Services_Language/PRServ.h Fri Mar 08 05:34:21 2013 -0800 +++ b/Services_Offered_by_PR/Services_Language/PRServ.h Wed May 22 17:40:23 2013 -0700 @@ -15,7 +15,14 @@ //=========================================================================== - //uniquely identifies PRServ -- should be a jenkins char-hash of "PRServ" to int32 + + +#define PRServ__malloc( numBytes, callingSlave ) PR_App__malloc( numBytes, callingSlave) + +#define PRServ__free(ptrToFree, callingSlave ) PR_App__free( ptrToFree, callingSlave ) + + +//uniquely identifies PRServ -- should be a jenkins char-hash of "PRServ" to int32 #define PRServ_MAGIC_NUMBER 0000000001 #define NUM_STRUCS_IN_LANG_ENV 1000