Mercurial > cgi-bin > hgwebdir.cgi > VMS > VMS_Implementations > VMS_impls > VMS__MC_shared_impl
changeset 282:72ffdb11ad8e Dev_ML
Removed files that interfere with build -- for probes and counter recording
| author | Sean Halle <seanhalle@yahoo.com> |
|---|---|
| date | Wed, 22 May 2013 17:40:23 -0700 |
| parents | 2fc69e6c14ea |
| children | 7b6f8cf08b1f |
| files | AnimationMaster.c Defines/PR_defs__HW_constants.h PR__WL.c PR__int.c PR_req_handlers.c Services_Offered_by_PR/Measurement_and_Stats/MEAS__Counter_Recording.c Services_Offered_by_PR/Measurement_and_Stats/MEAS__Counter_Recording.h Services_Offered_by_PR/Services_Language/PRServ.h |
| diffstat | 8 files changed, 17 insertions(+), 253 deletions(-) [+] |
line diff
1.1 --- a/AnimationMaster.c Fri Mar 08 05:34:21 2013 -0800 1.2 +++ b/AnimationMaster.c Wed May 22 17:40:23 2013 -0700 1.3 @@ -10,7 +10,6 @@ 1.4 #include <stddef.h> 1.5 1.6 #include "PR.h" 1.7 -#include "VSs_impl/VSs.h" 1.8 1.9 //========================= Local Declarations ======================== 1.10 inline PRProcess *
2.1 --- a/Defines/PR_defs__HW_constants.h Fri Mar 08 05:34:21 2013 -0800 2.2 +++ b/Defines/PR_defs__HW_constants.h Wed May 22 17:40:23 2013 -0700 2.3 @@ -15,6 +15,13 @@ 2.4 //This value is the number of hardware threads in the shared memory 2.5 // machine 2.6 #define NUM_CORES 4 2.7 + //Now, check if sequential mode is on, and set num cores to 1, so that 2.8 + // lang plugin code doesn't have to check for sequential mode 2.9 +#ifdef DEBUG__TURN_ON_SEQUENTIAL_MODE 2.10 + #undef NUM_CORES 2.11 + #define NUM_CORES 1 2.12 +#endif 2.13 + 2.14 2.15 //tradeoff amortizing master fixed overhead vs imbalance potential 2.16 // when work-stealing, can make bigger, at risk of losing cache affinity
3.1 --- a/PR__WL.c Fri Mar 08 05:34:21 2013 -0800 3.2 +++ b/PR__WL.c Wed May 22 17:40:23 2013 -0700 3.3 @@ -165,7 +165,7 @@ 3.4 //WARNING: not updated.. may be buggy 3.5 req = PR_int__malloc( sizeof(PRReqst) ); 3.6 req->reqType = Language; 3.7 - req->langReq = langReqData; 3.8 + req->langReq = langReqData; 3.9 req->nextReqst = callingSlv->request; 3.10 callingSlv->request = req; 3.11 }
4.1 --- a/PR__int.c Fri Mar 08 05:34:21 2013 -0800 4.2 +++ b/PR__int.c Wed May 22 17:40:23 2013 -0700 4.3 @@ -61,7 +61,7 @@ 4.4 #endif 4.5 //======================================================================== 4.6 4.7 - newSlv->typeOfVP = GenericSlave; 4.8 + newSlv->typeOfVP = GenericSlave; //may be changed later! 4.9 4.10 return newSlv; 4.11 }
5.1 --- a/PR_req_handlers.c Fri Mar 08 05:34:21 2013 -0800 5.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 5.3 @@ -1,57 +0,0 @@ 5.4 -/* 5.5 - * Copyright 2010 OpenSourceStewardshipFoundation 5.6 - * 5.7 - * Licensed under BSD 5.8 - */ 5.9 - 5.10 -#include <stdio.h> 5.11 -#include <stdlib.h> 5.12 -#include <string.h> 5.13 -#include <malloc.h> 5.14 -#include <inttypes.h> 5.15 -#include <sys/time.h> 5.16 - 5.17 -#include "PR.h" 5.18 - 5.19 - 5.20 -/* MEANING OF WL PI SS int 5.21 - * These indicate which places the function is safe to use. They stand for: 5.22 - * WL: Wrapper Library 5.23 - * PI: Plugin 5.24 - * SS: Startup and Shutdown 5.25 - * int: internal to the PR implementation 5.26 - */ 5.27 - 5.28 - 5.29 -/* 5.30 - */ 5.31 -void inline 5.32 -handleMakeProbe( PRSemReq *semReq, void *semEnv, ResumeSlvFnPtr resumeFn ) 5.33 - { IntervalProbe *newProbe; 5.34 - 5.35 - newProbe = PR_int__malloc( sizeof(IntervalProbe) ); 5.36 - newProbe->nameStr = PR_int__strDup( semReq->nameStr ); 5.37 - newProbe->hist = NULL; 5.38 - newProbe->schedChoiceWasRecorded = FALSE; 5.39 - 5.40 - //This runs in masterVP, so no race-condition worries 5.41 - newProbe->probeID = 5.42 - addToDynArray( newProbe, _PRMasterEnv->dynIntervalProbesInfo ); 5.43 - 5.44 - semReq->requestingSlv->dataRetFromReq = newProbe; 5.45 - 5.46 - //This in inside PR, while resume_slaveVP fn is inside language, so pass 5.47 - // pointer from lang to here, then call it. 5.48 - (*resumeFn)( semReq->requestingSlv, semEnv ); 5.49 - } 5.50 - 5.51 -void inline 5.52 -handleThrowException( PRSemReq *semReq, void *semEnv, ResumeSlvFnPtr resumeFn ) 5.53 - { 5.54 - PR_int__throw_exception( semReq->msgStr, semReq->requestingSlv, semReq->exceptionData ); 5.55 - 5.56 - (*resumeFn)( semReq->requestingSlv, semEnv ); 5.57 - } 5.58 - 5.59 - 5.60 -
6.1 --- a/Services_Offered_by_PR/Measurement_and_Stats/MEAS__Counter_Recording.c Fri Mar 08 05:34:21 2013 -0800 6.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 6.3 @@ -1,156 +0,0 @@ 6.4 -/* 6.5 - * 6.6 - * author: Nina Engelhardt 6.7 - */ 6.8 - 6.9 -#include "PR_MEAS__Counter_Recording.h" 6.10 -#include "PR_impl/PR.h" 6.11 -//#include "../PRServ.h" 6.12 - 6.13 -#ifdef HOLISTIC__TURN_ON_PERF_COUNTERS 6.14 - 6.15 -void 6.16 -PR_MEAS__init_counter_data_structs_for_Lang( SlaveVP *slave, int32 magicNum ) 6.17 - { 6.18 - PRServLangEnv *langEnv = 6.19 - (PRServLangEnv *)PR_SS__give_lang_env_for_slave( slave, magicNum ); 6.20 - int i; 6.21 - for(i=0;i<NUM_CORES;i++) 6.22 - { langEnv->counterList[i] = makeListOfArrays(sizeof(CounterEvent), 128); 6.23 - } 6.24 - } 6.25 - 6.26 -/*Pass file by side effect.. 6.27 - *The reason is that using doAllInListOfArrays, to which one passes the pointer 6.28 - * to a function, which is then applied to all the elements.. but, that fn 6.29 - * can only take one input -- the element from the list of arrays.. so, it 6.30 - * can't also be passed the file.. hence pass the file by side effect 6.31 - * 6.32 - *However, multiple cores could be trying to do this.. so, create a separate 6.33 - * lock just for counters, and acquire that when set the file, then release 6.34 - * once all the printing is done. 6.35 - */ 6.36 -void 6.37 -PR_MEAS__set_counter_file(FILE* f) 6.38 - { 6.39 - acquire counter lock 6.40 - counterfile = f; 6.41 - } 6.42 - 6.43 -PR_MEAS__release_counter_file() 6.44 - { 6.45 - release counter lock 6.46 - } 6.47 - 6.48 -void 6.49 -PR_MEAS__addToListOfArraysCounterEvent(CounterEvent value, ListOfArrays* list) 6.50 - { 6.51 - int offset_in_fragment = list->next_free_index % list->num_entries_per_fragment; 6.52 - if(offset_in_fragment == 0) 6.53 - { void* newBlock = malloc(list->entry_size * list->num_entries_per_fragment); 6.54 - addToDynArray(newBlock,list->dim1info); 6.55 - } 6.56 - CounterEvent* typedFragment = (CounterEvent*) ((list->dim1)[list->dim1info->numInArray -1]); 6.57 - typedFragment[offset_in_fragment] = value; 6.58 - list->next_free_index++; 6.59 - } 6.60 - 6.61 -void 6.62 -PR_MEAS__counter_handler(int evt_type, int vpid, int task, SlaveVP* pr, uint64 cycles, uint64 instrs) 6.63 - { 6.64 - if (pr->typeOfVP == Master_VP || pr->typeOfVP == ShutdownVP) 6.65 - { //Only save values for application work, done in a SlaveVP 6.66 - return; 6.67 - } 6.68 - 6.69 - //Note: have made many changes without compiler flag turned on, nor test.. 6.70 - PRLangEnv *langEnv = 6.71 - PR_int__give_proto_lang_env_from_slave( pr, magicNum); 6.72 - 6.73 - CounterEvent e; 6.74 - e.event_type = evt_type; 6.75 - e.vp = vpid; 6.76 - e.task = task; 6.77 - 6.78 - e.cycles = cycles; 6.79 - e.instrs = instrs; 6.80 - 6.81 - if(pr) 6.82 - { e.coreID = pr->coreAnimatedBy; 6.83 - e.slot = pr->animSlotAssignedTo; 6.84 - } 6.85 - else 6.86 - { e.coreID = -1; 6.87 - e.slot = NULL; 6.88 - } 6.89 - 6.90 - int corenum; 6.91 - 6.92 - if(pr) 6.93 - corenum = pr->coreAnimatedBy; 6.94 - else 6.95 - return; 6.96 - 6.97 - if(evt_type==Work_start || evt_type==Work_end || evt_type==AppResponderInvocation_start) 6.98 - { addToListOfArrays_ext(CounterEvent,e,langEnv->counterList[corenum]); 6.99 - } 6.100 - else 6.101 - { PR_MEAS__addToListOfArraysCounterEvent(e,langEnv->counterList[corenum]); 6.102 - } 6.103 - } 6.104 - 6.105 - 6.106 - 6.107 -void 6.108 -PR_MEAS__print_counter_event_to_file( void* _e ) 6.109 - { 6.110 - CounterEvent* e = (CounterEvent*) _e; 6.111 - fprintf(counterfile, "event, "); 6.112 - switch(e->event_type) 6.113 - { 6.114 - case AppResponderInvocation_start: 6.115 - fprintf(counterfile, "AppResponderInvocation_start"); 6.116 - break; 6.117 - case AppResponder_start: 6.118 - fprintf(counterfile, "AppResponder_start"); 6.119 - break; 6.120 - case AppResponder_end: 6.121 - fprintf(counterfile, "AppResponder_end"); 6.122 - break; 6.123 - case AssignerInvocation_start: 6.124 - fprintf(counterfile, "AssignerInvocation_start"); 6.125 - break; 6.126 - case NextAssigner_start: 6.127 - fprintf(counterfile, "NextAssigner_start"); 6.128 - break; 6.129 - case Assigner_start: 6.130 - fprintf(counterfile, "Assigner_start"); 6.131 - break; 6.132 - case Assigner_end: 6.133 - fprintf(counterfile, "Assigner_end"); 6.134 - break; 6.135 - case Work_end: 6.136 - fprintf(counterfile, "Work_end"); 6.137 - break; 6.138 - case Work_start: 6.139 - fprintf(counterfile, "Work_start"); 6.140 - break; 6.141 - case HwResponderInvocation_start: 6.142 - fprintf(counterfile, "HwResponderInvocation_start"); 6.143 - break; 6.144 - case Timestamp_start: 6.145 - fprintf(counterfile, "Timestamp_start"); 6.146 - break; 6.147 - case Timestamp_end: 6.148 - fprintf(counterfile, "Timestamp_end"); 6.149 - break; 6.150 - default: 6.151 - fprintf(counterfile, "unknown event"); 6.152 - } 6.153 - fprintf(counterfile,", %d, %d, %llu, %llu",e->vp,e->task,e->cycles,e->instrs); 6.154 - if(e->coreID >=0) 6.155 - fprintf(counterfile,", %d",e->coreID); 6.156 - fprintf(counterfile,"\n"); 6.157 - fflush(counterfile); 6.158 - } 6.159 -#endif
7.1 --- a/Services_Offered_by_PR/Measurement_and_Stats/MEAS__Counter_Recording.h Fri Mar 08 05:34:21 2013 -0800 7.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 7.3 @@ -1,36 +0,0 @@ 7.4 -/* 7.5 - * File: PR_MEAS__Counter_Recording.h 7.6 - * Author: nengel 7.7 - * 7.8 - * Created on January 11, 2012, 3:03 PM 7.9 - */ 7.10 - 7.11 -#ifndef PR_MEAS__COUNTER_RECORDING_H 7.12 -#define PR_MEAS__COUNTER_RECORDING_H 7.13 - 7.14 -#include "PR_impl/PR.h" 7.15 - 7.16 -typedef struct 7.17 - { 7.18 - int event_type; 7.19 - int coreID; 7.20 - AnimSlot* slot; 7.21 - int vp; 7.22 - int task; 7.23 - uint64 cycles; 7.24 - uint64 instrs; 7.25 - } 7.26 -CounterEvent; 7.27 - 7.28 -FILE* counterfile; //pass file handle via side effect because 7.29 - // doAllInListOfArrays only takes Fns with a single input 7.30 - 7.31 -void PR_MEAS__init_counter_data_structs_for_lang( SlaveVP *slv, int32 magicNum ); 7.32 - 7.33 -void PR_MEAS__counter_handler(int evt_type, int vpid, int task, SlaveVP* pr, uint64 cycles, uint64 instrs); 7.34 - 7.35 -void PR_MEAS__set_counter_file(FILE* f); 7.36 - 7.37 -void PR_MEAS__print_counter_event_to_file( void* _e ); 7.38 -#endif /* PRServ_COUNTER_RECORDING_H */ 7.39 -
8.1 --- a/Services_Offered_by_PR/Services_Language/PRServ.h Fri Mar 08 05:34:21 2013 -0800 8.2 +++ b/Services_Offered_by_PR/Services_Language/PRServ.h Wed May 22 17:40:23 2013 -0700 8.3 @@ -15,7 +15,14 @@ 8.4 8.5 8.6 //=========================================================================== 8.7 - //uniquely identifies PRServ -- should be a jenkins char-hash of "PRServ" to int32 8.8 + 8.9 + 8.10 +#define PRServ__malloc( numBytes, callingSlave ) PR_App__malloc( numBytes, callingSlave) 8.11 + 8.12 +#define PRServ__free(ptrToFree, callingSlave ) PR_App__free( ptrToFree, callingSlave ) 8.13 + 8.14 + 8.15 +//uniquely identifies PRServ -- should be a jenkins char-hash of "PRServ" to int32 8.16 #define PRServ_MAGIC_NUMBER 0000000001 8.17 8.18 #define NUM_STRUCS_IN_LANG_ENV 1000
