# HG changeset patch # User Sean Halle # Date 1378429694 25200 # Node ID 744b5ff9851e55d4170f7c2249b8551fce88c776 # Parent c7142d15fc408606b22c733ddaa9f9038b7ef7bd# Parent b02b346814141f4ffad60338eb542f388402a14f Merge diff -r c7142d15fc40 -r 744b5ff9851e AnimationMaster.c --- a/AnimationMaster.c Thu Sep 05 18:05:11 2013 -0700 +++ b/AnimationMaster.c Thu Sep 05 18:08:14 2013 -0700 @@ -34,6 +34,9 @@ inline void handleThrowException( PRServiceReq *langReq, PRLangEnv *protoLangEnv ); +void +debug_print_req(AnimSlot *slot, PRReqst *req); + //=========================================================================== /*Note: there used to be a coreController that was another animation @@ -73,7 +76,6 @@ if( slot->workIsDone ) { slot->workIsDone = FALSE; slot->needsWorkAssigned = TRUE; -//printf("top handle request: %d | reqType: %d\n", slot->coreSlotIsOn, (int32)req->reqType );fflush(stdin); //An Idle VP has no request to handle, so skip to assign.. if( slot->slaveAssignedToSlot->typeOfVP != IdleVP && @@ -592,3 +594,27 @@ (*protoLangEnv->makeSlaveReadyFn)( langReq->requestingSlv, PR_int__give_lang_env(protoLangEnv) ); } +void +debug_print_req(AnimSlot *slot, PRReqst *req) + { + if(dbgMaster) + { printf("top handle request: %d | reqType: ", slot->coreSlotIsOn ); + switch(req->reqType) + { case TaskCreate: printf("TaskCreate \n"); break; + case TaskEnd: printf("TaskEnd \n"); break; + case SlvCreate: printf("SlvCreate \n"); break; + case SlvDissipate: printf("SlvDissipate \n"); break; + case Language: printf("Language \n"); break; + case Service: printf("Service \n"); break; + case Hardware: printf("Hardware \n"); break; + case IO: printf("IO \n"); break; + case OSCall: printf("OSCall \n"); break; + case LangShutdown: printf("LangShutdown \n"); break; + case ProcessEnd: printf("ProcessEnd \n"); break; + case PRShutdown: printf("PRShutdown \n"); break; + } + fflush(stdin); + } + } + + diff -r c7142d15fc40 -r 744b5ff9851e Defines/PR_defs__HW_constants.h --- a/Defines/PR_defs__HW_constants.h Thu Sep 05 18:05:11 2013 -0700 +++ b/Defines/PR_defs__HW_constants.h Thu Sep 05 18:08:14 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 c7142d15fc40 -r 744b5ff9851e HW_Dependent_Primitives/PR__primitives.c --- a/HW_Dependent_Primitives/PR__primitives.c Thu Sep 05 18:05:11 2013 -0700 +++ b/HW_Dependent_Primitives/PR__primitives.c Thu Sep 05 18:08:14 2013 -0700 @@ -18,14 +18,14 @@ * carefully that it's safe) */ inline void -PR_int__reset_slaveVP_to_TopLvlFn( SlaveVP *slaveVP, TopLevelFnPtr fnPtr, +PR_int__reset_slaveVP_to_BirthFn( SlaveVP *slaveVP, BirthFnPtr fnPtr, void *dataParam) { void *stackPtr; // Start of Hardware dependent part //Set slave's instr pointer to a helper Fn that copies params from stack - slaveVP->resumeInstrPtr = (TopLevelFnPtr)&startUpTopLevelFn; + slaveVP->resumeInstrPtr = (BirthFnPtr)&startUpBirthFn; //fnPtr takes two params -- void *dataParam & void *animSlv // Stack grows *down*, so start it at highest stack addr, minus room @@ -81,7 +81,7 @@ *((void**)stackPtr - 1) = (void*)fnPtr; //what helper jmps to //Set slave's instr pointer to a helper Fn that copies params from stack - slaveVP->resumeInstrPtr = (TopLevelFnPtr)&jmpToOneParamFn; + slaveVP->resumeInstrPtr = (BirthFnPtr)&jmpToOneParamFn; // end of Hardware dependent part @@ -123,7 +123,7 @@ *((void**)stackPtr - 1) = (void*)fnPtr; //what helper jmps to //Set slave's instr pointer to a helper Fn that copies params from stack - slaveVP->resumeInstrPtr = (TopLevelFnPtr)&jmpToTwoParamFn; + slaveVP->resumeInstrPtr = (BirthFnPtr)&jmpToTwoParamFn; // end of Hardware dependent part diff -r c7142d15fc40 -r 744b5ff9851e HW_Dependent_Primitives/PR__primitives.h --- a/HW_Dependent_Primitives/PR__primitives.h Thu Sep 05 18:05:11 2013 -0700 +++ b/HW_Dependent_Primitives/PR__primitives.h Thu Sep 05 18:08:14 2013 -0700 @@ -23,7 +23,7 @@ masterSwitchToCoreCtlr(SlaveVP *nextSlave); void -startUpTopLevelFn(); +startUpBirthFn(); void jmpToOneParamFn(); diff -r c7142d15fc40 -r 744b5ff9851e HW_Dependent_Primitives/PR__primitives_asm.s --- a/HW_Dependent_Primitives/PR__primitives_asm.s Thu Sep 05 18:05:11 2013 -0700 +++ b/HW_Dependent_Primitives/PR__primitives_asm.s Thu Sep 05 18:08:14 2013 -0700 @@ -14,8 +14,8 @@ //Trick for 64 bit arch -- copies args from stack into regs, then does jmp to // the top-level function, which was pointed to by the stack-ptr -.globl startUpTopLevelFn -startUpTopLevelFn: +.globl startUpBirthFn +startUpBirthFn: movq %rdi , %rsi #get second argument from first argument of switchSlv movq 0x08(%rsp), %rdi #get first argument from stack movq (%rsp) , %rax #get top-level function's addr from stack diff -r c7142d15fc40 -r 744b5ff9851e PR.c --- a/PR.c Thu Sep 05 18:05:11 2013 -0700 +++ b/PR.c Thu Sep 05 18:08:14 2013 -0700 @@ -65,7 +65,7 @@ PR_SS__create_topEnv(); #ifdef DEBUG__TURN_ON_SEQUENTIAL_MODE - printf( "\n\n Running in SEQUENTIAL mode \n\n" ); + printf( "\n\n Running in SEQUENTIAL mode -- NUM_CORES: %d \n\n", NUM_CORES ); //Only difference between version with an OS thread pinned to each core and // the sequential version of PR is PR__init_Seq, this, and coreCtlr_Seq. @@ -100,7 +100,7 @@ * */ PRProcess * -PR__create_process( TopLevelFnPtr seed_Fn, void *seedData ) +PR__create_process( BirthFnPtr seed_Fn, void *seedData ) { SlaveVP *seedSlv; PRProcess *process; PRLangEnv **langEnvs, **langEnvsList; @@ -232,9 +232,11 @@ process->executionIsComplete = TRUE; } #else - //First get the "ACK" lock, then do normal wait for signal, then release - // ACK lock, to let end-process know it can free the process struct - pthread_mutex_lock( &(process->doneAckLock) ); + //This is called from main thread, so must use OS thread constructs to + // force the main thread to block (suspend) until it is signalled that + // the process is complete. One issue is that the mutex and cond variable + // are inside the process data struct, which is freed when the process + // ends! pthread_mutex_lock( &(process->doneLock) ); while( process->executionIsComplete != TRUE ) { diff -r c7142d15fc40 -r 744b5ff9851e PR__PI.c --- a/PR__PI.c Thu Sep 05 18:05:11 2013 -0700 +++ b/PR__PI.c Thu Sep 05 18:08:14 2013 -0700 @@ -48,6 +48,14 @@ } } } +/*Make slave ready, without having to know the lang env.. just the magic num + */ +void +PR_PI__make_slave_ready_for_lang( SlaveVP *slave, int32 magicNum ) + { void *langEnv; + langEnv = PR_PI__give_lang_env_for_slave( slave, magicNum ); + PR_PI__make_slave_ready( slave, langEnv ); + } /*Any langlet can transfer slaves over to be resumed in PRServ.. the resume Fn * is registered in the PRServ lang env during process creation. diff -r c7142d15fc40 -r 744b5ff9851e PR__SS.c --- a/PR__SS.c Thu Sep 05 18:05:11 2013 -0700 +++ b/PR__SS.c Thu Sep 05 18:08:14 2013 -0700 @@ -372,10 +372,13 @@ // return. return; #else + //Here, must use OS thread constructs.. the main thread is waiting for + // PR process to complete. So, at this point, cause main to resume. + pthread_mutex_lock( &(process->doneLock) ); process->executionIsComplete = TRUE; + pthread_cond_broadcast( &(process->doneCond) ); pthread_mutex_unlock( &(process->doneLock) ); - pthread_cond_broadcast( &(process->doneCond) ); //now wait for woken waiter to Ack, then free the process struct pthread_mutex_lock( &(process->doneAckLock) ); //BUG:? may be a race pthread_mutex_unlock( &(process->doneAckLock) ); @@ -411,7 +414,7 @@ AnimSlot **animSlots; //create the shutdown processors, one for each core controller -- put them // directly into the slots - PR_int__get_master_lock(); + PR_int__get_wrapper_lock(); for( coreIdx = 0; coreIdx < NUM_CORES; coreIdx++ ) { //Note, this is running in the master shutDownSlv = PR_SS__create_shutdown_slave(); diff -r c7142d15fc40 -r 744b5ff9851e PR__WL.c --- a/PR__WL.c Thu Sep 05 18:05:11 2013 -0700 +++ b/PR__WL.c Thu Sep 05 18:08:14 2013 -0700 @@ -116,7 +116,7 @@ inline void -PR_WL__send_create_task_req( TopLevelFn fn, void *initData, void *langReq, +PR_WL__send_create_task_req( BirthFn fn, void *initData, void *langReq, int32 *taskID, CreateHandler handler, SlaveVP *animSlv, int32 magicNumber) { PRReqst req; @@ -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 c7142d15fc40 -r 744b5ff9851e PR__WL.h --- a/PR__WL.h Thu Sep 05 18:05:11 2013 -0700 +++ b/PR__WL.h Thu Sep 05 18:08:14 2013 -0700 @@ -40,7 +40,7 @@ PR__start(); PRProcess * -PR__create_process( TopLevelFnPtr seed_Fn, void *seedData ); +PR__create_process( BirthFnPtr seed_Fn, void *seedData ); void PR__end_seedVP( SlaveVP *seedSlv ); diff -r c7142d15fc40 -r 744b5ff9851e PR__int.c --- a/PR__int.c Thu Sep 05 18:05:11 2013 -0700 +++ b/PR__int.c Thu Sep 05 18:08:14 2013 -0700 @@ -30,7 +30,7 @@ */ inline SlaveVP * -PR_int__create_slaveVP_helper( TopLevelFnPtr fnPtr, void *dataParam ) +PR_int__create_slaveVP_helper( BirthFnPtr fnPtr, void *dataParam ) { SlaveVP *newSlv; void *stackLocs; @@ -46,10 +46,14 @@ newSlv->numTimesAssignedToASlot = 0; - newSlv->langDatas = NULL; - newSlv->metaTasks = NULL; + + newSlv->langDatas = + (PRLangData **)PR_int__make_collection_of_size( NUM_IN_COLLECTION ); + + newSlv->metaTasks = + (PRMetaTask **) PR_int__make_collection_of_size( NUM_IN_COLLECTION ); - PR_int__reset_slaveVP_to_TopLvlFn( newSlv, fnPtr, dataParam ); + PR_int__reset_slaveVP_to_BirthFn( newSlv, fnPtr, dataParam ); //============================= MEASUREMENT STUFF ======================== #ifdef PROBES__TURN_ON_STATS_PROBES @@ -61,23 +65,17 @@ #endif //======================================================================== - newSlv->typeOfVP = GenericSlave; + newSlv->typeOfVP = GenericSlave; //may be changed later! return newSlv; } inline SlaveVP * -PR_int__create_slaveVP( TopLevelFnPtr fnPtr, void *dataParam, PRProcess *process ) +PR_int__create_slaveVP( BirthFnPtr fnPtr, void *dataParam, PRProcess *process ) { SlaveVP *newSlv; newSlv = PR_int__create_slaveVP_helper( fnPtr, dataParam ); - - newSlv->langDatas = - (PRLangData **)PR_int__make_collection_of_size( NUM_IN_COLLECTION ); - - newSlv->metaTasks = - (PRMetaTask **) PR_int__make_collection_of_size( NUM_IN_COLLECTION ); process->numLiveGenericSlvs += 1; @@ -441,7 +439,7 @@ //if work found, put into slot, and adjust flags and state slot->slaveAssignedToSlot = slave; slave->animSlotAssignedTo = slot; - slot->needsWorkAssigned = FALSE; + slot->needsWorkAssigned = FALSE; #ifdef HOLISTIC__TURN_ON_OBSERVE_UCC //have a slave to be assigned to the slot @@ -486,7 +484,7 @@ slotSlv = _PRTopEnv->slotTaskSlvs[coreNum][slotNum]; //point slave to task's function - PR_int__reset_slaveVP_to_TopLvlFn( slotSlv, protoMetaTask->topLevelFn, protoMetaTask->initData ); + PR_int__reset_slaveVP_to_BirthFn( slotSlv, protoMetaTask->topLevelFn, protoMetaTask->initData ); PR_int__insert_meta_task_into_slave( protoMetaTask, slotSlv ); slotSlv->processSlaveIsIn = protoMetaTask->processTaskIsIn; PR_int__put_slave_into_slot( slotSlv, slot ); @@ -700,7 +698,7 @@ { protoLangEnv = PR_int__give_proto_lang_env_for_slave( slave, magicNum ); if(protoLangEnv->langDataCreator == NULL) PR_int__error("register a lang data creator"); - //This will call PR_PI__create_lang_data_in_slave + //This will call PR_PI__create_lang_data_in_slave -- puts it into slave return (*protoLangEnv->langDataCreator)( slave ); } } @@ -904,14 +902,46 @@ PR_int__backoff_for_TooLongToGetLock( int32 numTriesToGetLock ); inline void -PR_int__get_master_lock() - { int32 *addrOfMasterLock; +PR_int__get_wrapper_lock() + { int32 *addrOfWrapperLock; #ifdef DEBUG__TURN_ON_SEQUENTIAL_MODE return; #endif - addrOfMasterLock = &(_PRTopEnv->masterLock); + addrOfWrapperLock = &(_PRTopEnv->wrapperLock); + + int numTriesToGetLock = 0; + int gotLock = 0; + +// MEAS__Capture_Pre_Master_Lock_Point; + while( !gotLock ) //keep going until get master lock + { + numTriesToGetLock++; //if too many, means too much contention + if( numTriesToGetLock > NUM_TRIES_BEFORE_DO_BACKOFF ) + { PR_int__backoff_for_TooLongToGetLock( numTriesToGetLock ); + } + if( numTriesToGetLock > MASTERLOCK_RETRIES_BEFORE_YIELD ) + { numTriesToGetLock = 0; + pthread_yield(); + } + + //try to get the lock + gotLock = __sync_bool_compare_and_swap( addrOfWrapperLock, + UNLOCKED, LOCKED ); + } +// MEAS__Capture_Post_Master_Lock_Point; + } + +inline void +PR_int__get_malloc_lock() + { int32 *addrOfMallocLock; + + #ifdef DEBUG__TURN_ON_SEQUENTIAL_MODE + return; + #endif + + addrOfMallocLock = &(_PRTopEnv->mallocLock); int numTriesToGetLock = 0; int gotLock = 0; @@ -929,7 +959,7 @@ } //try to get the lock - gotLock = __sync_bool_compare_and_swap( addrOfMasterLock, + gotLock = __sync_bool_compare_and_swap( addrOfMallocLock, UNLOCKED, LOCKED ); } MEAS__Capture_Post_Master_Lock_Point; diff -r c7142d15fc40 -r 744b5ff9851e PR__int.h --- a/PR__int.h Thu Sep 05 18:05:11 2013 -0700 +++ b/PR__int.h Thu Sep 05 18:08:14 2013 -0700 @@ -21,7 +21,7 @@ inline void -PR_int__reset_slaveVP_to_TopLvlFn( SlaveVP *slaveVP, TopLevelFnPtr fnPtr, +PR_int__reset_slaveVP_to_BirthFn( SlaveVP *slaveVP, BirthFnPtr fnPtr, void *dataParam); inline @@ -39,11 +39,11 @@ //=========================================================================== inline SlaveVP * -PR_int__create_slaveVP_helper( TopLevelFnPtr fnPtr, void *dataParam ); +PR_int__create_slaveVP_helper( BirthFnPtr fnPtr, void *dataParam ); inline SlaveVP * -PR_int__create_slaveVP( TopLevelFnPtr fnPtr, void *dataParam, PRProcess *process ); +PR_int__create_slaveVP( BirthFnPtr fnPtr, void *dataParam, PRProcess *process ); SlaveVP * PR_int__get_recycled_slot_slave( ); @@ -244,9 +244,16 @@ PR_int__strDup( char *str ); inline void -PR_int__get_master_lock(); +PR_int__get_wrapper_lock(); -#define PR_int__release_master_lock() _PRTopEnv->masterLock = UNLOCKED +inline void +PR_int__get_malloc_lock(); + +#define PR_int__release_master_lock() _PRTopEnv->masterLock = UNLOCKED + +#define PR_int__release_wrapper_lock() _PRTopEnv->wrapperLock = UNLOCKED + +#define PR_int__release_malloc_lock() _PRTopEnv->mallocLock = UNLOCKED inline uint32_t PR_int__randomNumber(); diff -r c7142d15fc40 -r 744b5ff9851e PR__structs.h --- a/PR__structs.h Thu Sep 05 18:05:11 2013 -0700 +++ b/PR__structs.h Thu Sep 05 18:08:14 2013 -0700 @@ -43,8 +43,8 @@ typedef void (*LangMetaTaskFreer) ( void * ); //lang meta task to free typedef void (*MakeSlaveReadyFn) ( SlaveVP *, void * ); //slave and langEnv typedef void (*MakeTaskReadyFn) ( void *, void * ); //langTask and langEnv -typedef void (*TopLevelFnPtr) ( void *, SlaveVP * ); //initData, animSlv -typedef void TopLevelFn ( void *, SlaveVP * ); //initData, animSlv +typedef void (*BirthFnPtr) ( void *, SlaveVP * ); //initData, animSlv +typedef void BirthFn ( void *, SlaveVP * ); //initData, animSlv typedef void (*ResumeSlvFnPtr) ( SlaveVP *, void * ); //=========== MEASUREMENT STUFF ========== MEAS__Insert_Counter_Handler @@ -121,17 +121,17 @@ enum PRReqstType //avoid starting enums at 0, for debug reasons { TaskCreate = 1, - TaskEnd = 2, - SlvCreate = 3, - SlvDissipate = 4, - Language = 5, - Service = 6, //To invoke a PR provided equivalent of a language request (ex: probe) - Hardware = 7, - IO = 8, - OSCall = 9, - LangShutdown = 10, - ProcessEnd = 11, - PRShutdown = 12 + TaskEnd, + SlvCreate, + SlvDissipate, + Language, + Service, //To invoke a PR provided equivalent of a language request (ex: probe) + Hardware, + IO, + OSCall, + LangShutdown, + ProcessEnd, + PRShutdown }; @@ -143,7 +143,7 @@ int32 langMagicNumber; SlaveVP *requestingSlave; - TopLevelFnPtr topLevelFn; + BirthFnPtr topLevelFn; void *initData; int32 *ID; @@ -152,6 +152,7 @@ // fn directly into the request.. might change to this for all requests RequestHandler handler; //pointer to handler fn CreateHandler createHdlr; //special because returns something + int32 createSuspendedGroup; //must be non-zero PRReqst *nextReqst; }; @@ -263,6 +264,10 @@ int8 falseSharePad1[256 - sizeof(void*)]; int32 masterLock; //offset to this field used in asm int8 falseSharePad2[256 - sizeof(int32)]; + int32 wrapperLock; //offset to this field used in asm + int8 falseSharePad3[256 - sizeof(int32)]; + int32 mallocLock; //offset to this field used in asm + int8 falseSharePad4[256 - sizeof(int32)]; //============ below this, no fields are used in asm ============= //Basic PR infrastructure @@ -373,7 +378,7 @@ int32 *ID; //is standard PR ID PRProcess *processTaskIsIn; SlaveVP *slaveAssignedTo; //not valid until task animated - TopLevelFnPtr topLevelFn; //This is the Fn executes as the task + BirthFnPtr topLevelFn; //This is the Fn executes as the task void *initData; //The data taken by the function LangMetaTaskFreer freer; bool32 goAheadAndFree; diff -r c7142d15fc40 -r 744b5ff9851e Services_Offered_by_PR/Measurement_and_Stats/MEAS__Counter_Recording.c --- a/Services_Offered_by_PR/Measurement_and_Stats/MEAS__Counter_Recording.c Thu Sep 05 18:05:11 2013 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,156 +0,0 @@ -/* - * - * author: Nina Engelhardt - */ - -#include "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 c7142d15fc40 -r 744b5ff9851e Services_Offered_by_PR/Measurement_and_Stats/MEAS__Counter_Recording.h --- a/Services_Offered_by_PR/Measurement_and_Stats/MEAS__Counter_Recording.h Thu Sep 05 18:05:11 2013 -0700 +++ /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 c7142d15fc40 -r 744b5ff9851e Services_Offered_by_PR/Measurement_and_Stats/probes.c --- a/Services_Offered_by_PR/Measurement_and_Stats/probes.c Thu Sep 05 18:05:11 2013 -0700 +++ b/Services_Offered_by_PR/Measurement_and_Stats/probes.c Thu Sep 05 18:08:14 2013 -0700 @@ -163,11 +163,11 @@ PR_impl__index_probe_by_its_name( int32 probeID, SlaveVP *animSlv ) { IntervalProbe *probe; - PR_int__get_master_lock(); + PR_int__get_wrapper_lock(); probe = _PRTopEnv->intervalProbes[ probeID ]; addValueIntoTable(probe->nameStr, probe, _PRTopEnv->probeNameHashTbl); - PR_int__release_master_lock(); + PR_int__release_wrapper_lock(); } diff -r c7142d15fc40 -r 744b5ff9851e Services_Offered_by_PR/Memory_Handling/vmalloc.c --- a/Services_Offered_by_PR/Memory_Handling/vmalloc.c Thu Sep 05 18:05:11 2013 -0700 +++ b/Services_Offered_by_PR/Memory_Handling/vmalloc.c Thu Sep 05 18:08:14 2013 -0700 @@ -291,9 +291,9 @@ PR_WL__malloc( int32 sizeRequested ) { void *ret; - PR_int__get_master_lock(); + PR_int__get_malloc_lock(); ret = PR_int__malloc( sizeRequested ); - PR_int__release_master_lock(); + PR_int__release_malloc_lock(); return ret; } @@ -354,9 +354,9 @@ void PR_WL__free( void *ptrToFree ) { - PR_int__get_master_lock(); + PR_int__get_malloc_lock(); PR_int__free( ptrToFree ); - PR_int__release_master_lock(); + PR_int__release_malloc_lock(); } /* diff -r c7142d15fc40 -r 744b5ff9851e Services_Offered_by_PR/Services_Language/PRServ.h --- a/Services_Offered_by_PR/Services_Language/PRServ.h Thu Sep 05 18:05:11 2013 -0700 +++ b/Services_Offered_by_PR/Services_Language/PRServ.h Thu Sep 05 18:08:14 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 diff -r c7142d15fc40 -r 744b5ff9851e Services_Offered_by_PR/Services_Language/PRServ_SS.c --- a/Services_Offered_by_PR/Services_Language/PRServ_SS.c Thu Sep 05 18:05:11 2013 -0700 +++ b/Services_Offered_by_PR/Services_Language/PRServ_SS.c Thu Sep 05 18:08:14 2013 -0700 @@ -12,7 +12,7 @@ #include "Hash_impl/PrivateHash.h" #include "PRServ.h" -#include "PR_impl/Services_Offered_by_PR/Measurement_and_Stats/MEAS__Counter_Recording.h" +//#include "PR_impl/Services_Offered_by_PR/Measurement_and_Stats/MEAS__Counter_Recording.h" //==========================================================================