Mercurial > cgi-bin > hgwebdir.cgi > VMS > VMS_Implementations > SSR_impls > SSR__MC_shared_impl
comparison SSR.h @ 60:3c9ed64db705
chgd brch name to Holistic_Model, from perf_ctrs, and Updated to compatibility with common_ancestor brch
| author | Some Random Person <seanhalle@yahoo.com> |
|---|---|
| date | Fri, 09 Mar 2012 22:28:08 -0800 |
| parents | e11ba112a0c7 |
| children | 64bacf647af9 |
comparison
equal
deleted
inserted
replaced
| 20:687c642d6f61 | 21:0e8fa220cdba |
|---|---|
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #ifndef _SSR_H | 9 #ifndef _SSR_H |
| 10 #define _SSR_H | 10 #define _SSR_H |
| 11 | 11 |
| 12 #include "../../C_Libraries/Queue_impl/PrivateQueue.h" | 12 #include "Queue_impl/PrivateQueue.h" |
| 13 #include "../../C_Libraries/Hash_impl/PrivateHash.h" | 13 #include "Hash_impl/PrivateHash.h" |
| 14 #include "../VMS_impl/VMS.h" | 14 #include "VMS_impl/VMS.h" |
| 15 #include "dependency.h" | 15 #include "dependency.h" |
| 16 | 16 |
| 17 | 17 |
| 18 //=========================================================================== | 18 //=========================================================================== |
| 19 #define NUM_STRUCS_IN_SEM_ENV 1000 | 19 #define NUM_STRUCS_IN_SEM_ENV 1000 |
| 29 * to request handler called in MasterLoop | 29 * to request handler called in MasterLoop |
| 30 */ | 30 */ |
| 31 | 31 |
| 32 typedef struct | 32 typedef struct |
| 33 { | 33 { |
| 34 VirtProcr *VPCurrentlyExecuting; | 34 SlaveVP *VPCurrentlyExecuting; |
| 35 PrivQueueStruc *waitingVPQ; | 35 PrivQueueStruc *waitingVPQ; |
| 36 } | 36 } |
| 37 SSRTrans; | 37 SSRTrans; |
| 38 | 38 |
| 39 /*WARNING: assembly hard-codes position of endInstrAddr as first field | 39 /*WARNING: assembly hard-codes position of endInstrAddr as first field |
| 67 trans_end | 67 trans_end |
| 68 }; | 68 }; |
| 69 | 69 |
| 70 struct _SSRSemReq | 70 struct _SSRSemReq |
| 71 { enum SSRReqType reqType; | 71 { enum SSRReqType reqType; |
| 72 VirtProcr *sendPr; | 72 SlaveVP *sendPr; |
| 73 VirtProcr *receivePr; | 73 SlaveVP *receivePr; |
| 74 int32 msgType; | 74 int32 msgType; |
| 75 void *msg; | 75 void *msg; |
| 76 SSRSemReq *nextReqInHashEntry; | 76 SSRSemReq *nextReqInHashEntry; |
| 77 | 77 |
| 78 void *initData; | 78 void *initData; |
| 79 VirtProcrFnPtr fnPtr; | 79 TopLevelFnPtr fnPtr; |
| 80 int32 coreToScheduleOnto; | 80 int32 coreToScheduleOnto; |
| 81 | 81 |
| 82 int32 sizeToMalloc; | 82 int32 sizeToMalloc; |
| 83 void *ptrToFree; | 83 void *ptrToFree; |
| 84 | 84 |
| 95 | 95 |
| 96 typedef struct | 96 typedef struct |
| 97 { | 97 { |
| 98 PrivQueueStruc **readyVPQs; | 98 PrivQueueStruc **readyVPQs; |
| 99 HashTable *commHashTbl; | 99 HashTable *commHashTbl; |
| 100 int32 numVirtPr; | 100 int32 numSlaveVP; |
| 101 int32 nextCoreToGetNewPr; | 101 int32 nextCoreToGetNewPr; |
| 102 int32 primitiveStartTime; | 102 int32 primitiveStartTime; |
| 103 | 103 |
| 104 //fix limit on num with dynArray | 104 //fix limit on num with dynArray |
| 105 SSRSingleton fnSingletons[NUM_STRUCS_IN_SEM_ENV]; | 105 SSRSingleton fnSingletons[NUM_STRUCS_IN_SEM_ENV]; |
| 106 SSRTrans transactionStrucs[NUM_STRUCS_IN_SEM_ENV]; | 106 SSRTrans transactionStrucs[NUM_STRUCS_IN_SEM_ENV]; |
| 107 | 107 |
| 108 #ifdef OBSERVE_UCC | 108 #ifdef HOLISTIC__TURN_ON_OBSERVE_UCC |
| 109 ListOfArrays* unitList; | 109 ListOfArrays* unitList; |
| 110 ListOfArrays* ctlDependenciesList; | 110 ListOfArrays* ctlDependenciesList; |
| 111 ListOfArrays* commDependenciesList; | 111 ListOfArrays* commDependenciesList; |
| 112 NtoN** ntonGroups; | 112 NtoN** ntonGroups; |
| 113 PrivDynArrayInfo* ntonGroupsInfo; | 113 PrivDynArrayInfo* ntonGroupsInfo; |
| 114 ListOfArrays* dynDependenciesList; | 114 ListOfArrays* dynDependenciesList; |
| 115 Unit last_in_slot[NUM_CORES * NUM_SCHED_SLOTS]; | 115 Unit last_in_slot[NUM_CORES * NUM_SCHED_SLOTS]; |
| 116 ListOfArrays* hwArcs; | 116 ListOfArrays* hwArcs; |
| 117 #endif | 117 #endif |
| 118 | 118 |
| 119 #ifdef MEAS__PERF_COUNTERS | 119 #ifdef HOLISTIC__TURN_ON_PERF_COUNTERS |
| 120 ListOfArrays* counterList[NUM_CORES]; | 120 ListOfArrays* counterList[NUM_CORES]; |
| 121 #endif | 121 #endif |
| 122 VirtProcr* idlePr[NUM_CORES][NUM_SCHED_SLOTS]; | 122 SlaveVP* idlePr[NUM_CORES][NUM_SCHED_SLOTS]; |
| 123 } | 123 } |
| 124 SSRSemEnv; | 124 SSRSemEnv; |
| 125 | 125 |
| 126 | 126 |
| 127 typedef struct _TransListElem TransListElem; | 127 typedef struct _TransListElem TransListElem; |
| 140 SSRSemData; | 140 SSRSemData; |
| 141 | 141 |
| 142 //=========================================================================== | 142 //=========================================================================== |
| 143 | 143 |
| 144 void | 144 void |
| 145 SSR__create_seed_procr_and_do_work( VirtProcrFnPtr fn, void *initData ); | 145 SSR__create_seed_procr_and_do_work( TopLevelFnPtr fn, void *initData ); |
| 146 | 146 |
| 147 int32 | 147 int32 |
| 148 SSR__giveMinWorkUnitCycles( float32 percentOverhead ); | 148 SSR__giveMinWorkUnitCycles( float32 percentOverhead ); |
| 149 | 149 |
| 150 void | 150 void |
| 167 void | 167 void |
| 168 SSR__cleanup_after_shutdown(); | 168 SSR__cleanup_after_shutdown(); |
| 169 | 169 |
| 170 //======================= | 170 //======================= |
| 171 | 171 |
| 172 VirtProcr * | 172 SlaveVP * |
| 173 SSR__create_procr_with( VirtProcrFnPtr fnPtr, void *initData, | 173 SSR__create_procr_with( TopLevelFnPtr fnPtr, void *initData, |
| 174 VirtProcr *creatingPr ); | 174 SlaveVP *creatingSlv ); |
| 175 | 175 |
| 176 VirtProcr * | 176 SlaveVP * |
| 177 SSR__create_procr_with_affinity( VirtProcrFnPtr fnPtr, void *initData, | 177 SSR__create_procr_with_affinity( TopLevelFnPtr fnPtr, void *initData, |
| 178 VirtProcr *creatingPr, int32 coreToScheduleOnto); | 178 SlaveVP *creatingPr, int32 coreToScheduleOnto); |
| 179 | 179 |
| 180 void | 180 void |
| 181 SSR__dissipate_procr( VirtProcr *procrToDissipate ); | 181 SSR__dissipate_procr( SlaveVP *procrToDissipate ); |
| 182 | 182 |
| 183 //======================= | 183 //======================= |
| 184 void * | 184 void * |
| 185 SSR__malloc_to( int numBytes, VirtProcr *ownerPr ); | 185 SSR__malloc_to( int numBytes, SlaveVP *ownerSlv ); |
| 186 | 186 |
| 187 void | 187 void |
| 188 SSR__free( void *ptrToFree, VirtProcr *owningPr ); | 188 SSR__free( void *ptrToFree, SlaveVP *owningSlv ); |
| 189 | 189 |
| 190 void | 190 void |
| 191 SSR__transfer_ownership_of_from_to( void *data, VirtProcr *oldOwnerPr, | 191 SSR__transfer_ownership_of_from_to( void *data, SlaveVP *oldOwnerPr, |
| 192 VirtProcr *newOwnerPr ); | 192 SlaveVP *newOwnerSlv ); |
| 193 | 193 |
| 194 void | 194 void |
| 195 SSR__add_ownership_by_to( VirtProcr *newOwnerPr, void *data ); | 195 SSR__add_ownership_by_to( SlaveVP *newOwnerPr, void *data ); |
| 196 | 196 |
| 197 void | 197 void |
| 198 SSR__remove_ownership_by_from( VirtProcr *loserPr, void *dataLosing ); | 198 SSR__remove_ownership_by_from( SlaveVP *loserPr, void *dataLosing ); |
| 199 | 199 |
| 200 void | 200 void |
| 201 SSR__transfer_ownership_to_outside( void *dataToTransferOwnershipOf ); | 201 SSR__transfer_ownership_to_outside( void *dataToTransferOwnershipOf ); |
| 202 | 202 |
| 203 | 203 |
| 204 | 204 |
| 205 //======================= | 205 //======================= |
| 206 void | 206 void |
| 207 SSR__send_of_type_to( VirtProcr *sendPr, void *msg, const int type, | 207 SSR__send_of_type_to( SlaveVP *sendPr, void *msg, const int type, |
| 208 VirtProcr *receivePr); | 208 SlaveVP *receivePr); |
| 209 | 209 |
| 210 void | 210 void |
| 211 SSR__send_from_to( void *msg, VirtProcr *sendPr, VirtProcr *receivePr); | 211 SSR__send_from_to( void *msg, SlaveVP *sendPr, SlaveVP *receivePr); |
| 212 | 212 |
| 213 void * | 213 void * |
| 214 SSR__receive_type_to( const int type, VirtProcr *receivePr ); | 214 SSR__receive_type_to( const int type, SlaveVP *receiveSlv ); |
| 215 | 215 |
| 216 void * | 216 void * |
| 217 SSR__receive_from_to( VirtProcr *sendPr, VirtProcr *receivePr ); | 217 SSR__receive_from_to( SlaveVP *sendPr, SlaveVP *receiveSlv ); |
| 218 | 218 |
| 219 | 219 |
| 220 //======================= Concurrency Stuff ====================== | 220 //======================= Concurrency Stuff ====================== |
| 221 void | 221 void |
| 222 SSR__start_fn_singleton( int32 singletonID, VirtProcr *animPr ); | 222 SSR__start_fn_singleton( int32 singletonID, SlaveVP *animSlv ); |
| 223 | 223 |
| 224 void | 224 void |
| 225 SSR__end_fn_singleton( int32 singletonID, VirtProcr *animPr ); | 225 SSR__end_fn_singleton( int32 singletonID, SlaveVP *animSlv ); |
| 226 | 226 |
| 227 void | 227 void |
| 228 SSR__start_data_singleton( SSRSingleton **singeltonAddr, VirtProcr *animPr ); | 228 SSR__start_data_singleton( SSRSingleton **singeltonAddr, SlaveVP *animSlv ); |
| 229 | 229 |
| 230 void | 230 void |
| 231 SSR__end_data_singleton( SSRSingleton **singletonAddr, VirtProcr *animPr ); | 231 SSR__end_data_singleton( SSRSingleton **singletonAddr, SlaveVP *animSlv ); |
| 232 | 232 |
| 233 void | 233 void |
| 234 SSR__animate_short_fn_in_isolation( PtrToAtomicFn ptrToFnToExecInMaster, | 234 SSR__animate_short_fn_in_isolation( PtrToAtomicFn ptrToFnToExecInMaster, |
| 235 void *data, VirtProcr *animPr ); | 235 void *data, SlaveVP *animSlv ); |
| 236 | 236 |
| 237 void | 237 void |
| 238 SSR__start_transaction( int32 transactionID, VirtProcr *animPr ); | 238 SSR__start_transaction( int32 transactionID, SlaveVP *animSlv ); |
| 239 | 239 |
| 240 void | 240 void |
| 241 SSR__end_transaction( int32 transactionID, VirtProcr *animPr ); | 241 SSR__end_transaction( int32 transactionID, SlaveVP *animSlv ); |
| 242 | 242 |
| 243 | 243 |
| 244 //========================= Internal use only ============================= | 244 //========================= Internal use only ============================= |
| 245 void | 245 void |
| 246 SSR__Request_Handler( VirtProcr *requestingPr, void *_semEnv ); | 246 SSR__Request_Handler( SlaveVP *requestingPr, void *_semEnv ); |
| 247 | 247 |
| 248 VirtProcr * | 248 SlaveVP * |
| 249 SSR__schedule_virt_procr( void *_semEnv, int coreNum, int slotNum ); | 249 SSR__schedule_slaveVP( void *_semEnv, int coreNum, int slotNum ); |
| 250 | 250 |
| 251 VirtProcr* | 251 SlaveVP* |
| 252 SSR__create_procr_helper( VirtProcrFnPtr fnPtr, void *initData, | 252 SSR__create_procr_helper( TopLevelFnPtr fnPtr, void *initData, |
| 253 SSRSemEnv *semEnv, int32 coreToScheduleOnto ); | 253 SSRSemEnv *semEnv, int32 coreToScheduleOnto ); |
| 254 | 254 |
| 255 #endif /* _SSR_H */ | 255 #endif /* _SSR_H */ |
| 256 | 256 |
