comparison VMS.h @ 230:f2a7831352dc

changed SchedulingMaster.c to AnimationMaster.c and cleaned up all comments
author Some Random Person <seanhalle@yahoo.com>
date Thu, 15 Mar 2012 20:31:41 -0700
parents 5c475c4b7b49
children 88fd85921d7f
comparison
equal deleted inserted replaced
109:af7f0eae95a8 111:04a185c0be6d
42 typedef struct _MasterVP MasterVP; 42 typedef struct _MasterVP MasterVP;
43 typedef struct _IntervalProbe IntervalProbe; 43 typedef struct _IntervalProbe IntervalProbe;
44 typedef struct _GateStruc GateStruc; 44 typedef struct _GateStruc GateStruc;
45 45
46 46
47 typedef SlaveVP *(*SlaveAssigner) ( void *, int, SchedSlot *); //semEnv, coreIdx, slot for HW info 47 typedef SlaveVP *(*SlaveAssigner) ( void *, SchedSlot*); //semEnv, slot for HW info
48 typedef void (*RequestHandler) ( SlaveVP *, void * ); //prWReqst, semEnv 48 typedef void (*RequestHandler) ( SlaveVP *, void * ); //prWReqst, semEnv
49 typedef void (*TopLevelFnPtr) ( void *, SlaveVP * ); //initData, animSlv 49 typedef void (*TopLevelFnPtr) ( void *, SlaveVP * ); //initData, animSlv
50 typedef void TopLevelFn ( void *, SlaveVP * ); //initData, animSlv 50 typedef void TopLevelFn ( void *, SlaveVP * ); //initData, animSlv
51 typedef void (*ResumeSlvFnPtr) ( SlaveVP *, void * ); 51 typedef void (*ResumeSlvFnPtr) ( SlaveVP *, void * );
52 52
96 96
97 //==================== Core data structures =================== 97 //==================== Core data structures ===================
98 98
99 struct _SchedSlot 99 struct _SchedSlot
100 { 100 {
101 int slotIdx; //needed by Holistic Model's data gathering 101 int workIsDone;
102 int workIsDone; 102 int needsSlaveAssigned;
103 int needsSlaveAssigned; 103 SlaveVP *slaveAssignedToSlot;
104 SlaveVP *slaveAssignedToSlot; 104
105 int slotIdx; //needed by Holistic Model's data gathering
106 int coreOfSlot;
107 SlotPerfInfo *perfInfo; //used by assigner to pick best slave for core
105 }; 108 };
106 //SchedSlot 109 //SchedSlot
107 110
108 /*WARNING: re-arranging this data structure could cause Slv switching 111 /*WARNING: re-arranging this data structure could cause Slv switching
109 * assembly code to fail -- hard-codes offsets of fields 112 * assembly code to fail -- hard-codes offsets of fields
132 135
133 float64 createPtInSecs; //have space but don't use on some configs 136 float64 createPtInSecs; //have space but don't use on some configs
134 }; 137 };
135 //SlaveVP 138 //SlaveVP
136 139
137 140 /*The one and only global variable, holds many odds and ends
138 /*WARNING: re-arranging this data structure could cause Slv-switching
139 * assembly code to fail -- hard-codes offsets of fields
140 * (because -O3 messes with things otherwise)
141 */ 141 */
142 typedef struct 142 typedef struct
143 { //The offset of these fields is hard-coded into assembly 143 { //The offsets of these fields are hard-coded into assembly
144 void *coreCtlrReturnPt; //offset of field used in asm 144 void *coreCtlrReturnPt; //offset of field used in asm
145 int32 masterLock __align_to_cacheline__; //used in asm 145 int32 masterLock __align_to_cacheline__; //used in asm
146 146
147 //below this, no asm uses the field offsets 147 //============ below this, no asm uses the field offsets =============
148
149 //Basic VMS infrastructure
150 SlaveVP **masterVPs;
151 SchedSlot ***allSchedSlots;
152
153 //plugin related
148 SlaveAssigner slaveAssigner; 154 SlaveAssigner slaveAssigner;
149 RequestHandler requestHandler; 155 RequestHandler requestHandler;
150
151 SchedSlot ***allSchedSlots;
152 SlaveVP **masterVPs;
153
154 void *semanticEnv; 156 void *semanticEnv;
155 void *OSEventStruc; //for future, when add I/O to BLIS 157
158 //Slave creation
159 int32 numSlavesCreated; //gives ordering to processor creation
160 int32 numSlavesAlive; //used to detect fail-safe shutdown
161
162 //Initialization related
163 int32 setupComplete; //use while starting up coreCtlr
164
165 //Memory management related
156 MallocArrays *freeLists; 166 MallocArrays *freeLists;
157 int32 amtOfOutstandingMem; //total currently allocated 167 int32 amtOfOutstandingMem;//total currently allocated
158 168
159 int32 setupComplete; //use while starting up coreCtlr 169 //Work-stealing related
160 GateStruc *workStealingGates[ NUM_CORES ]; //concurrent work-steal 170 GateStruc *workStealingGates[ NUM_CORES ]; //concurrent work-steal
161 int32 workStealingLock; 171 int32 workStealingLock;
162 172
163 int32 numSlavesCreated; //gives ordering to processor creation 173
164 int32 numSlavesAlive; //used to detect when to shutdown
165
166 //=========== MEASUREMENT STUFF ============= 174 //=========== MEASUREMENT STUFF =============
167 IntervalProbe **intervalProbes; 175 IntervalProbe **intervalProbes;
168 PrivDynArrayInfo *dynIntervalProbesInfo; 176 PrivDynArrayInfo *dynIntervalProbesInfo;
169 HashTable *probeNameHashTbl; 177 HashTable *probeNameHashTbl;
170 int32 masterCreateProbeID; 178 int32 masterCreateProbeID;
171 float64 createPtInSecs; 179 float64 createPtInSecs; //real-clock time VMS initialized
172 Histogram **measHists; 180 Histogram **measHists;
173 PrivDynArrayInfo *measHistsInfo; 181 PrivDynArrayInfo *measHistsInfo;
174 MEAS__Insert_Susp_Meas_Fields_into_MasterEnv; 182 MEAS__Insert_Susp_Meas_Fields_into_MasterEnv;
175 MEAS__Insert_Master_Meas_Fields_into_MasterEnv; 183 MEAS__Insert_Master_Meas_Fields_into_MasterEnv;
176 MEAS__Insert_Master_Lock_Meas_Fields_into_MasterEnv; 184 MEAS__Insert_Master_Lock_Meas_Fields_into_MasterEnv;
199 207
200 //======================= OS Thread related =============================== 208 //======================= OS Thread related ===============================
201 209
202 void * coreController( void *paramsIn ); //standard PThreads fn prototype 210 void * coreController( void *paramsIn ); //standard PThreads fn prototype
203 void * coreCtlr_Seq( void *paramsIn ); //standard PThreads fn prototype 211 void * coreCtlr_Seq( void *paramsIn ); //standard PThreads fn prototype
204 void schedulingMaster( void *initData, SlaveVP *masterVP ); 212 void animationMaster( void *initData, SlaveVP *masterVP );
205 213
206 214
207 typedef struct 215 typedef struct
208 { 216 {
209 void *endThdPt; 217 void *endThdPt;