| rev |
line source |
|
Me@42
|
1 /*
|
|
Me@42
|
2 * Copyright 2009 OpenSourceStewardshipFoundation.org
|
|
Me@42
|
3 * Licensed under GNU General Public License version 2
|
|
Me@42
|
4 *
|
|
Me@42
|
5 * Author: seanhalle@yahoo.com
|
|
Me@42
|
6 *
|
|
Me@42
|
7 */
|
|
Me@42
|
8 #ifndef _VMS_H
|
|
Me@42
|
9 #define _VMS_H
|
|
msach@76
|
10 #define _GNU_SOURCE
|
|
Me@42
|
11
|
|
msach@134
|
12 #include <pthread.h>
|
|
msach@134
|
13 #include <sys/time.h>
|
|
msach@134
|
14
|
|
Me@42
|
15 #include "VMS_primitive_data_types.h"
|
|
Me@55
|
16 #include "Queue_impl/PrivateQueue.h"
|
|
Me@42
|
17 #include "Histogram/Histogram.h"
|
|
Me@50
|
18 #include "DynArray/DynArray.h"
|
|
Me@50
|
19 #include "Hash_impl/PrivateHash.h"
|
|
Me@50
|
20 #include "vmalloc.h"
|
|
msach@135
|
21 #include "inter_VMS_requests.h"
|
|
Me@50
|
22
|
|
Me@50
|
23 //=============================== Debug ===================================
|
|
Me@55
|
24 //
|
|
msach@76
|
25 //When SEQUENTIAL is defined, VMS does sequential exe in the main thread
|
|
msach@76
|
26 // It still does co-routines and all the mechanisms are the same, it just
|
|
msach@76
|
27 // has only a single thread and animates VPs one at a time
|
|
Me@45
|
28 //#define SEQUENTIAL
|
|
Me@42
|
29
|
|
Me@55
|
30 //#define USE_WORK_STEALING
|
|
Me@55
|
31
|
|
msach@76
|
32 //turns on the probe-instrumentation in the application -- when not
|
|
msach@76
|
33 // defined, the calls to the probe functions turn into comments
|
|
Me@52
|
34 #define STATS__ENABLE_PROBES
|
|
Me@60
|
35 //#define TURN_ON_DEBUG_PROBES
|
|
Me@52
|
36
|
|
msach@76
|
37 //These defines turn types of bug messages on and off
|
|
msach@76
|
38 // be sure debug messages are un-commented (next block of defines)
|
|
Me@68
|
39 #define dbgAppFlow TRUE /* Top level flow of application code -- general*/
|
|
Me@60
|
40 #define dbgProbes FALSE /* for issues inside probes themselves*/
|
|
Me@60
|
41 #define dbgB2BMaster FALSE /* in coreloop, back to back master VPs*/
|
|
Me@60
|
42 #define dbgRqstHdlr FALSE /* in request handler code*/
|
|
Me@52
|
43
|
|
msach@76
|
44 //Comment or un- the substitute half to turn on/off types of debug message
|
|
Me@55
|
45 #define DEBUG( bool, msg) \
|
|
Me@68
|
46 // if( bool){ printf(msg); fflush(stdin);}
|
|
Me@55
|
47 #define DEBUG1( bool, msg, param) \
|
|
Me@60
|
48 // if(bool){printf(msg, param); fflush(stdin);}
|
|
Me@55
|
49 #define DEBUG2( bool, msg, p1, p2) \
|
|
Me@60
|
50 // if(bool) {printf(msg, p1, p2); fflush(stdin);}
|
|
Me@45
|
51
|
|
msach@137
|
52 #define ERROR(msg) printf(msg)
|
|
msach@137
|
53 #define ERROR1(msg, param) printf(msg, param);
|
|
msach@137
|
54 #define ERROR2(msg, p1, p2) printf(msg, p1, p2)
|
|
Me@50
|
55
|
|
Me@50
|
56 //=========================== STATS =======================
|
|
Me@50
|
57
|
|
Me@45
|
58 //when MEAS__TIME_STAMP_SUSP is defined, causes code to be inserted and
|
|
Me@42
|
59 // compiled-in that saves the low part of the time stamp count just before
|
|
msach@76
|
60 // suspending a processor and just after resuming that processorsrc/VPThread_lib/VMS/VMS.h:322: warning: previous declaration of ‘VMS__create_procr’ was here. It is
|
|
Me@42
|
61 // saved into a field added to VirtProcr. Have to sanity-check for
|
|
Me@42
|
62 // rollover of low portion into high portion.
|
|
Me@65
|
63 //#define MEAS__TIME_STAMP_SUSP
|
|
Me@65
|
64 //#define MEAS__TIME_MASTER
|
|
Me@67
|
65 #define MEAS__TIME_PLUGIN
|
|
Me@67
|
66 #define MEAS__TIME_MALLOC
|
|
Me@68
|
67 //#define MEAS__TIME_MASTER_LOCK
|
|
Me@42
|
68 #define MEAS__NUM_TIMES_TO_RUN 100000
|
|
Me@42
|
69
|
|
Me@55
|
70 //For code that calculates normalization-offset between TSC counts of
|
|
Me@55
|
71 // different cores.
|
|
Me@45
|
72 #define NUM_TSC_ROUND_TRIPS 10
|
|
Me@45
|
73
|
|
Me@50
|
74
|
|
Me@50
|
75 //========================= Hardware related Constants =====================
|
|
Me@42
|
76 //This value is the number of hardware threads in the shared memory
|
|
Me@42
|
77 // machine
|
|
msach@69
|
78 #define NUM_CORES 8
|
|
Me@42
|
79
|
|
Me@55
|
80 // tradeoff amortizing master fixed overhead vs imbalance potential
|
|
Me@55
|
81 // when work-stealing, can make bigger, at risk of losing cache affinity
|
|
Me@55
|
82 #define NUM_SCHED_SLOTS 5
|
|
Me@42
|
83
|
|
Me@45
|
84 #define MIN_WORK_UNIT_CYCLES 20000
|
|
Me@45
|
85
|
|
Me@53
|
86 #define MASTERLOCK_RETRIES 10000
|
|
Me@42
|
87
|
|
Me@54
|
88 // stack size in virtual processors created
|
|
msach@78
|
89 #define VIRT_PROCR_STACK_SIZE 0x8000 /* 32K */
|
|
Me@42
|
90
|
|
Me@54
|
91 // memory for VMS__malloc
|
|
msach@134
|
92 #define MALLOC_ADDITIONAL_MEM_FROM_OS_SIZE 0x4000000 /* 64M */
|
|
Me@42
|
93
|
|
msach@78
|
94 #define CACHE_LINE 64
|
|
msach@79
|
95 #define PAGE_SIZE 4096
|
|
msach@78
|
96
|
|
Me@50
|
97
|
|
Me@50
|
98 //==============================
|
|
Me@42
|
99
|
|
Me@42
|
100 #define SUCCESS 0
|
|
Me@42
|
101
|
|
Me@55
|
102 #define writeVMSQ writePrivQ
|
|
Me@55
|
103 #define readVMSQ readPrivQ
|
|
Me@64
|
104 #define makeVMSQ makeVMSPrivQ
|
|
Me@55
|
105 #define numInVMSQ numInPrivQ
|
|
Me@55
|
106 #define VMSQueueStruc PrivQueueStruc
|
|
Me@42
|
107
|
|
Me@42
|
108
|
|
Me@50
|
109
|
|
Me@50
|
110 //===========================================================================
|
|
Me@50
|
111 typedef unsigned long long TSCount;
|
|
Me@50
|
112
|
|
Me@50
|
113 typedef struct _IntervalProbe IntervalProbe;
|
|
Me@55
|
114 typedef struct _GateStruc GateStruc;
|
|
Me@55
|
115
|
|
Me@42
|
116
|
|
Me@42
|
117 typedef VirtProcr * (*SlaveScheduler) ( void *, int ); //semEnv, coreIdx
|
|
Me@42
|
118 typedef void (*RequestHandler) ( VirtProcr *, void * ); //prWReqst, semEnv
|
|
Me@50
|
119 typedef void (*ResumePrFnPtr) ( VirtProcr *, void * );
|
|
Me@50
|
120
|
|
msach@135
|
121 //============= Requests ===========
|
|
msach@135
|
122 //
|
|
msach@135
|
123
|
|
msach@135
|
124 //VMS Request is the carrier for Slave to Master requests
|
|
msach@135
|
125 // it has an embedded sub-type request that is pulled out
|
|
msach@135
|
126 // inside the plugin's request handler
|
|
msach@135
|
127 enum VMSReqstType //For Slave->Master requests
|
|
msach@135
|
128 {
|
|
msach@135
|
129 semantic = 1, //avoid starting enums at 0, for debug reasons
|
|
msach@135
|
130 createReq,
|
|
msach@135
|
131 dissipate,
|
|
msach@135
|
132 VMSSemantic //goes with VMSSemReqst below
|
|
msach@135
|
133 };
|
|
msach@135
|
134
|
|
msach@135
|
135 struct _VMSReqst
|
|
msach@135
|
136 {
|
|
msach@135
|
137 enum VMSReqstType reqType;//used for dissipate and in future for IO requests
|
|
msach@135
|
138 void *semReqData;
|
|
msach@135
|
139
|
|
msach@135
|
140 VMSReqst *nextReqst;
|
|
msach@135
|
141 };
|
|
msach@135
|
142 //VMSReqst
|
|
msach@135
|
143
|
|
msach@135
|
144 //This is a sub-type of Slave->Master requests.
|
|
msach@135
|
145 // It's for Slaves to invoke built-in VMS-core functions that have language-like
|
|
msach@135
|
146 // behavior.
|
|
msach@135
|
147 enum VMSSemReqstType //These are equivalent to semantic requests, but for
|
|
msach@135
|
148 { // VMS's services available directly to app, like OS
|
|
msach@135
|
149 createProbe = 1, // and probe services -- like a VMS-wide built-in lang
|
|
msach@135
|
150 openFile,
|
|
msach@135
|
151 otherIO,
|
|
msach@135
|
152 interMasterReqst
|
|
msach@135
|
153 };
|
|
msach@135
|
154
|
|
msach@135
|
155 typedef struct
|
|
msach@135
|
156 { enum VMSSemReqstType reqType;
|
|
msach@135
|
157 //VirtProcr *requestingPr;
|
|
msach@135
|
158 int receiverID; //for inter master requests
|
|
msach@135
|
159 void *data;
|
|
msach@135
|
160 }
|
|
msach@135
|
161 VMSSemReq;
|
|
msach@135
|
162
|
|
Me@50
|
163
|
|
Me@50
|
164 //==================== Core data structures ===================
|
|
Me@50
|
165
|
|
Me@120
|
166 /*Master Env is the only global variable -- has entry points for any other
|
|
Me@120
|
167 * data needed.
|
|
Me@62
|
168 */
|
|
Me@42
|
169 typedef struct
|
|
Me@42
|
170 {
|
|
Me@42
|
171 SlaveScheduler slaveScheduler;
|
|
Me@42
|
172 RequestHandler requestHandler;
|
|
Me@42
|
173
|
|
Me@42
|
174 SchedSlot ***allSchedSlots;
|
|
msach@127
|
175 VMSQueueStruc **readyToAnimateQs;
|
|
Me@42
|
176 VirtProcr **masterVPs;
|
|
Me@42
|
177
|
|
Me@42
|
178 void *semanticEnv;
|
|
Me@42
|
179 void *OSEventStruc; //for future, when add I/O to BLIS
|
|
Me@42
|
180
|
|
msach@73
|
181 void *coreLoopReturnPt;//addr to jump to to re-enter coreLoop
|
|
Me@42
|
182
|
|
Me@50
|
183 int32 setupComplete;
|
|
msach@71
|
184 volatile int32 masterLock;
|
|
msach@132
|
185
|
|
msach@139
|
186 MallocArrays *freeLists[NUM_CORES];
|
|
msach@132
|
187 int32 amtOfOutstandingMem; //total currently allocated
|
|
Me@42
|
188
|
|
Me@50
|
189 int32 numMasterInARow[NUM_CORES];//detect back-to-back masterVP
|
|
msach@132
|
190 GateStruc *workStealingGates[NUM_CORES]; //concurrent work-steal
|
|
Me@55
|
191 int32 workStealingLock;
|
|
Me@55
|
192
|
|
msach@127
|
193 InterMasterReqst* interMasterRequestsFor[NUM_CORES];
|
|
msach@135
|
194 InterMasterReqst* interMasterRequestsSentBy[NUM_CORES];
|
|
msach@127
|
195 RequestHandler interPluginReqHdlr;
|
|
msach@127
|
196
|
|
msach@127
|
197 int32 numProcrsCreated; //gives ordering to processor creation
|
|
msach@132
|
198
|
|
msach@132
|
199 int32 currentMasterProcrID;
|
|
Me@50
|
200
|
|
Me@50
|
201 //=========== MEASUREMENT STUFF =============
|
|
msach@127
|
202 IntervalProbe **intervalProbes;
|
|
msach@127
|
203 PrivDynArrayInfo *dynIntervalProbesInfo;
|
|
msach@127
|
204 HashTable *probeNameHashTbl;
|
|
msach@127
|
205 int32 masterCreateProbeID;
|
|
msach@127
|
206 float64 createPtInSecs;
|
|
msach@127
|
207 Histogram **measHists;
|
|
msach@127
|
208 PrivDynArrayInfo *measHistsInfo;
|
|
Me@65
|
209 #ifdef MEAS__TIME_PLUGIN
|
|
msach@127
|
210 Histogram *reqHdlrLowTimeHist;
|
|
msach@127
|
211 Histogram *reqHdlrHighTimeHist;
|
|
Me@65
|
212 #endif
|
|
Me@65
|
213 #ifdef MEAS__TIME_MALLOC
|
|
msach@127
|
214 Histogram *mallocTimeHist;
|
|
msach@127
|
215 Histogram *freeTimeHist;
|
|
Me@65
|
216 #endif
|
|
Me@65
|
217 #ifdef MEAS__TIME_MASTER_LOCK
|
|
msach@127
|
218 Histogram *masterLockLowTimeHist;
|
|
msach@127
|
219 Histogram *masterLockHighTimeHist;
|
|
Me@65
|
220 #endif
|
|
Me@42
|
221 }
|
|
Me@42
|
222 MasterEnv;
|
|
Me@42
|
223
|
|
Me@55
|
224 //========================= Extra Stuff Data Strucs =======================
|
|
Me@54
|
225 typedef struct
|
|
Me@54
|
226 {
|
|
Me@42
|
227
|
|
Me@54
|
228 }
|
|
Me@54
|
229 VMSExcp;
|
|
Me@50
|
230
|
|
Me@55
|
231 struct _GateStruc
|
|
Me@55
|
232 {
|
|
Me@55
|
233 int32 gateClosed;
|
|
Me@55
|
234 int32 preGateProgress;
|
|
Me@55
|
235 int32 waitProgress;
|
|
Me@55
|
236 int32 exitProgress;
|
|
Me@55
|
237 };
|
|
Me@55
|
238 //GateStruc
|
|
Me@50
|
239
|
|
Me@50
|
240 //======================= OS Thread related ===============================
|
|
Me@42
|
241
|
|
msach@69
|
242 void * coreLoop( void *paramsIn ); //standard PThreads fn prototype
|
|
Me@42
|
243 void * coreLoop_Seq( void *paramsIn ); //standard PThreads fn prototype
|
|
Me@42
|
244 void masterLoop( void *initData, VirtProcr *masterPr );
|
|
Me@42
|
245
|
|
msach@69
|
246
|
|
Me@50
|
247 typedef struct
|
|
Me@50
|
248 {
|
|
Me@50
|
249 void *endThdPt;
|
|
Me@50
|
250 unsigned int coreNum;
|
|
Me@50
|
251 }
|
|
Me@50
|
252 ThdParams;
|
|
Me@42
|
253
|
|
Me@42
|
254 pthread_t coreLoopThdHandles[ NUM_CORES ]; //pthread's virt-procr state
|
|
Me@42
|
255 ThdParams *coreLoopThdParams [ NUM_CORES ];
|
|
Me@42
|
256 pthread_mutex_t suspendLock;
|
|
Me@42
|
257 pthread_cond_t suspend_cond;
|
|
Me@42
|
258
|
|
Me@50
|
259
|
|
msach@69
|
260
|
|
Me@50
|
261 //===================== Global Vars ===================
|
|
Me@50
|
262
|
|
Me@42
|
263 volatile MasterEnv *_VMSMasterEnv;
|
|
Me@42
|
264
|
|
Me@50
|
265
|
|
Me@50
|
266 //=========================== Function Prototypes =========================
|
|
Me@50
|
267
|
|
Me@53
|
268
|
|
Me@53
|
269 //========== Setup and shutdown ==========
|
|
Me@42
|
270 void
|
|
Me@42
|
271 VMS__init();
|
|
Me@42
|
272
|
|
Me@42
|
273 void
|
|
Me@42
|
274 VMS__init_Seq();
|
|
Me@42
|
275
|
|
Me@42
|
276 void
|
|
Me@42
|
277 VMS__start_the_work_then_wait_until_done();
|
|
Me@42
|
278
|
|
Me@42
|
279 void
|
|
Me@42
|
280 VMS__start_the_work_then_wait_until_done_Seq();
|
|
Me@42
|
281
|
|
msach@76
|
282 inline VirtProcr *
|
|
Me@42
|
283 VMS__create_procr( VirtProcrFnPtr fnPtr, void *initialData );
|
|
Me@42
|
284
|
|
Me@53
|
285 void
|
|
Me@53
|
286 VMS__dissipate_procr( VirtProcr *procrToDissipate );
|
|
Me@53
|
287
|
|
Me@50
|
288 //Use this to create processor inside entry point & other places outside
|
|
Me@50
|
289 // the VMS system boundary (IE, not run in slave nor Master)
|
|
Me@50
|
290 VirtProcr *
|
|
Me@50
|
291 VMS_ext__create_procr( VirtProcrFnPtr fnPtr, void *initialData );
|
|
Me@50
|
292
|
|
Me@53
|
293 void
|
|
Me@53
|
294 VMS_ext__dissipate_procr( VirtProcr *procrToDissipate );
|
|
Me@42
|
295
|
|
Me@50
|
296 void
|
|
Me@54
|
297 VMS__throw_exception( char *msgStr, VirtProcr *reqstPr, VMSExcp *excpData );
|
|
Me@54
|
298
|
|
Me@54
|
299 void
|
|
Me@53
|
300 VMS__shutdown();
|
|
Me@53
|
301
|
|
Me@53
|
302 void
|
|
Me@53
|
303 VMS__cleanup_at_end_of_shutdown();
|
|
Me@50
|
304
|
|
Me@64
|
305 void *
|
|
Me@64
|
306 VMS__give_sem_env_for( VirtProcr *animPr );
|
|
Me@64
|
307
|
|
Me@50
|
308
|
|
Me@50
|
309 //============== Request Related ===============
|
|
Me@50
|
310
|
|
Me@50
|
311 void
|
|
Me@50
|
312 VMS__suspend_procr( VirtProcr *callingPr );
|
|
Me@50
|
313
|
|
Me@42
|
314 inline void
|
|
Me@53
|
315 VMS__add_sem_request_in_mallocd_VMSReqst( void *semReqData, VirtProcr *callingPr );
|
|
Me@53
|
316
|
|
Me@53
|
317 inline void
|
|
Me@53
|
318 VMS__send_sem_request( void *semReqData, VirtProcr *callingPr );
|
|
Me@42
|
319
|
|
Me@42
|
320 void
|
|
Me@50
|
321 VMS__send_create_procr_req( void *semReqData, VirtProcr *reqstingPr );
|
|
Me@42
|
322
|
|
Me@53
|
323 void inline
|
|
Me@53
|
324 VMS__send_dissipate_req( VirtProcr *prToDissipate );
|
|
Me@53
|
325
|
|
Me@52
|
326 inline void
|
|
Me@52
|
327 VMS__send_VMSSem_request( void *semReqData, VirtProcr *callingPr );
|
|
Me@52
|
328
|
|
Me@120
|
329
|
|
Me@120
|
330 void inline
|
|
Me@120
|
331 VMS__send_inter_plugin_req( void *reqData, int32 targetMaster,
|
|
Me@120
|
332 VirtProcr *requestingMaster );
|
|
Me@120
|
333 void inline
|
|
Me@120
|
334 VMS__send_inter_VMSCore_req( InterVMSCoreReqst *reqData, int32 targetMaster,
|
|
Me@120
|
335 VirtProcr *requestingMaster );
|
|
Me@120
|
336
|
|
Me@42
|
337 VMSReqst *
|
|
Me@50
|
338 VMS__take_next_request_out_of( VirtProcr *procrWithReq );
|
|
Me@42
|
339
|
|
Me@42
|
340 inline void *
|
|
Me@42
|
341 VMS__take_sem_reqst_from( VMSReqst *req );
|
|
Me@42
|
342
|
|
msach@78
|
343 void inline
|
|
msach@78
|
344 VMS__handle_VMSSemReq( VMSReqst *req, VirtProcr *requestingPr, void *semEnv,
|
|
msach@78
|
345 ResumePrFnPtr resumePrFnPtr );
|
|
msach@78
|
346
|
|
Me@53
|
347 //======================== STATS ======================
|
|
Me@42
|
348
|
|
msach@76
|
349 //===== RDTSC wrapper ===== //Also runs with x86_64 code
|
|
Me@42
|
350
|
|
Me@42
|
351 #define saveTimeStampCountInto(low, high) \
|
|
Me@42
|
352 asm volatile("RDTSC; \
|
|
Me@42
|
353 movl %%eax, %0; \
|
|
Me@42
|
354 movl %%edx, %1;" \
|
|
Me@42
|
355 /* outputs */ : "=m" (low), "=m" (high)\
|
|
Me@42
|
356 /* inputs */ : \
|
|
Me@42
|
357 /* clobber */ : "%eax", "%edx" \
|
|
Me@42
|
358 );
|
|
Me@42
|
359
|
|
Me@42
|
360 #define saveLowTimeStampCountInto(low) \
|
|
Me@42
|
361 asm volatile("RDTSC; \
|
|
Me@42
|
362 movl %%eax, %0;" \
|
|
Me@42
|
363 /* outputs */ : "=m" (low) \
|
|
Me@42
|
364 /* inputs */ : \
|
|
Me@42
|
365 /* clobber */ : "%eax", "%edx" \
|
|
Me@42
|
366 );
|
|
Me@68
|
367
|
|
Me@68
|
368 //====================
|
|
Me@68
|
369 #define makeAMeasHist( idx, name, numBins, startVal, binWidth ) \
|
|
Me@68
|
370 makeHighestDynArrayIndexBeAtLeast( _VMSMasterEnv->measHistsInfo, idx ); \
|
|
Me@68
|
371 _VMSMasterEnv->measHists[idx] = \
|
|
Me@68
|
372 makeFixedBinHist( numBins, startVal, binWidth, name );
|
|
Me@68
|
373
|
|
Me@68
|
374
|
|
Me@68
|
375 #define MEAS__SUB_CREATE /*turn on/off subtraction of create from plugin*/
|
|
msach@69
|
376
|
|
msach@73
|
377 #ifdef VPTHREAD
|
|
msach@73
|
378
|
|
msach@69
|
379 //VPThread
|
|
Me@68
|
380 #define createHistIdx 1
|
|
Me@68
|
381 #define mutexLockHistIdx 2
|
|
Me@68
|
382 #define mutexUnlockHistIdx 3
|
|
Me@68
|
383 #define condWaitHistIdx 4
|
|
Me@68
|
384 #define condSignalHistIdx 5
|
|
Me@68
|
385
|
|
msach@76
|
386 #define MakeTheMeasHists() \
|
|
msach@73
|
387 _VMSMasterEnv->measHistsInfo = \
|
|
msach@73
|
388 makePrivDynArrayOfSize( (void***)&(_VMSMasterEnv->measHists), 200); \
|
|
msach@84
|
389 makeAMeasHist( createHistIdx, "create", 250, 0, 100 ) \
|
|
msach@78
|
390 makeAMeasHist( mutexLockHistIdx, "mutex_lock", 50, 0, 100 ) \
|
|
msach@78
|
391 makeAMeasHist( mutexUnlockHistIdx, "mutex_unlock", 50, 0, 100 ) \
|
|
msach@78
|
392 makeAMeasHist( condWaitHistIdx, "cond_wait", 50, 0, 100 ) \
|
|
msach@78
|
393 makeAMeasHist( condSignalHistIdx, "cond_signal", 50, 0, 100 )
|
|
msach@73
|
394
|
|
msach@73
|
395 #endif
|
|
msach@73
|
396
|
|
msach@73
|
397
|
|
msach@73
|
398 #ifdef VCILK
|
|
msach@73
|
399
|
|
msach@69
|
400 //VCilk
|
|
msach@69
|
401 #define spawnHistIdx 1
|
|
msach@69
|
402 #define syncHistIdx 2
|
|
msach@69
|
403
|
|
msach@76
|
404 #define MakeTheMeasHists() \
|
|
msach@73
|
405 _VMSMasterEnv->measHistsInfo = \
|
|
msach@73
|
406 makePrivDynArrayOfSize( (void***)&(_VMSMasterEnv->measHists), 200); \
|
|
msach@73
|
407 makeAMeasHist( spawnHistIdx, "Spawn", 50, 0, 200 ) \
|
|
msach@73
|
408 makeAMeasHist( syncHistIdx, "Sync", 50, 0, 200 )
|
|
msach@73
|
409
|
|
msach@73
|
410
|
|
msach@73
|
411 #endif
|
|
msach@73
|
412
|
|
msach@73
|
413 #ifdef SSR
|
|
msach@73
|
414
|
|
msach@69
|
415 //SSR
|
|
msach@69
|
416 #define SendFromToHistIdx 1
|
|
msach@69
|
417 #define SendOfTypeHistIdx 2
|
|
msach@69
|
418 #define ReceiveFromToHistIdx 3
|
|
msach@69
|
419 #define ReceiveOfTypeHistIdx 4
|
|
msach@69
|
420
|
|
msach@76
|
421 #define MakeTheMeasHists() \
|
|
msach@69
|
422 _VMSMasterEnv->measHistsInfo = \
|
|
msach@73
|
423 makePrivDynArrayOfSize( (void***)&(_VMSMasterEnv->measHists), 200); \
|
|
msach@73
|
424 makeAMeasHist( SendFromToHistIdx, "SendFromTo", 50, 0, 100 ) \
|
|
msach@73
|
425 makeAMeasHist( SendOfTypeHistIdx, "SendOfType", 50, 0, 100 ) \
|
|
msach@73
|
426 makeAMeasHist( ReceiveFromToHistIdx,"ReceiveFromTo", 50, 0, 100 ) \
|
|
msach@73
|
427 makeAMeasHist( ReceiveOfTypeHistIdx,"ReceiveOfType", 50, 0, 100 )
|
|
Me@68
|
428
|
|
msach@73
|
429 #endif
|
|
msach@69
|
430
|
|
msach@69
|
431 //===========================================================================
|
|
msach@69
|
432 //VPThread
|
|
msach@69
|
433
|
|
Me@68
|
434
|
|
Me@68
|
435 #define Meas_startCreate \
|
|
Me@68
|
436 int32 startStamp, endStamp; \
|
|
Me@68
|
437 saveLowTimeStampCountInto( startStamp ); \
|
|
Me@68
|
438
|
|
Me@68
|
439 #define Meas_endCreate \
|
|
Me@68
|
440 saveLowTimeStampCountInto( endStamp ); \
|
|
Me@68
|
441 addIntervalToHist( startStamp, endStamp, \
|
|
Me@68
|
442 _VMSMasterEnv->measHists[ createHistIdx ] );
|
|
Me@68
|
443
|
|
Me@68
|
444 #define Meas_startMutexLock \
|
|
Me@68
|
445 int32 startStamp, endStamp; \
|
|
Me@68
|
446 saveLowTimeStampCountInto( startStamp ); \
|
|
Me@68
|
447
|
|
Me@68
|
448 #define Meas_endMutexLock \
|
|
Me@68
|
449 saveLowTimeStampCountInto( endStamp ); \
|
|
Me@68
|
450 addIntervalToHist( startStamp, endStamp, \
|
|
Me@68
|
451 _VMSMasterEnv->measHists[ mutexLockHistIdx ] );
|
|
Me@68
|
452
|
|
Me@68
|
453 #define Meas_startMutexUnlock \
|
|
Me@68
|
454 int32 startStamp, endStamp; \
|
|
Me@68
|
455 saveLowTimeStampCountInto( startStamp ); \
|
|
Me@68
|
456
|
|
Me@68
|
457 #define Meas_endMutexUnlock \
|
|
Me@68
|
458 saveLowTimeStampCountInto( endStamp ); \
|
|
Me@68
|
459 addIntervalToHist( startStamp, endStamp, \
|
|
Me@68
|
460 _VMSMasterEnv->measHists[ mutexUnlockHistIdx ] );
|
|
Me@68
|
461
|
|
Me@68
|
462 #define Meas_startCondWait \
|
|
Me@68
|
463 int32 startStamp, endStamp; \
|
|
Me@68
|
464 saveLowTimeStampCountInto( startStamp ); \
|
|
Me@68
|
465
|
|
Me@68
|
466 #define Meas_endCondWait \
|
|
Me@68
|
467 saveLowTimeStampCountInto( endStamp ); \
|
|
Me@68
|
468 addIntervalToHist( startStamp, endStamp, \
|
|
Me@68
|
469 _VMSMasterEnv->measHists[ condWaitHistIdx ] );
|
|
Me@68
|
470
|
|
Me@68
|
471 #define Meas_startCondSignal \
|
|
Me@68
|
472 int32 startStamp, endStamp; \
|
|
Me@68
|
473 saveLowTimeStampCountInto( startStamp ); \
|
|
Me@68
|
474
|
|
Me@68
|
475 #define Meas_endCondSignal \
|
|
Me@68
|
476 saveLowTimeStampCountInto( endStamp ); \
|
|
Me@68
|
477 addIntervalToHist( startStamp, endStamp, \
|
|
Me@68
|
478 _VMSMasterEnv->measHists[ condSignalHistIdx ] );
|
|
Me@68
|
479
|
|
msach@69
|
480 //===========================================================================
|
|
msach@69
|
481 // VCilk
|
|
msach@69
|
482 #define Meas_startSpawn \
|
|
msach@69
|
483 int32 startStamp, endStamp; \
|
|
msach@69
|
484 saveLowTimeStampCountInto( startStamp ); \
|
|
msach@69
|
485
|
|
msach@69
|
486 #define Meas_endSpawn \
|
|
msach@69
|
487 saveLowTimeStampCountInto( endStamp ); \
|
|
msach@69
|
488 addIntervalToHist( startStamp, endStamp, \
|
|
msach@69
|
489 _VMSMasterEnv->measHists[ spawnHistIdx ] );
|
|
msach@69
|
490
|
|
msach@69
|
491 #define Meas_startSync \
|
|
msach@69
|
492 int32 startStamp, endStamp; \
|
|
msach@69
|
493 saveLowTimeStampCountInto( startStamp ); \
|
|
msach@69
|
494
|
|
msach@69
|
495 #define Meas_endSync \
|
|
msach@69
|
496 saveLowTimeStampCountInto( endStamp ); \
|
|
msach@69
|
497 addIntervalToHist( startStamp, endStamp, \
|
|
msach@69
|
498 _VMSMasterEnv->measHists[ syncHistIdx ] );
|
|
msach@69
|
499
|
|
msach@69
|
500 //===========================================================================
|
|
msach@69
|
501 // SSR
|
|
msach@69
|
502 #define Meas_startSendFromTo \
|
|
msach@69
|
503 int32 startStamp, endStamp; \
|
|
msach@69
|
504 saveLowTimeStampCountInto( startStamp ); \
|
|
msach@69
|
505
|
|
msach@69
|
506 #define Meas_endSendFromTo \
|
|
msach@69
|
507 saveLowTimeStampCountInto( endStamp ); \
|
|
msach@69
|
508 addIntervalToHist( startStamp, endStamp, \
|
|
msach@69
|
509 _VMSMasterEnv->measHists[ SendFromToHistIdx ] );
|
|
msach@69
|
510
|
|
msach@69
|
511 #define Meas_startSendOfType \
|
|
msach@69
|
512 int32 startStamp, endStamp; \
|
|
msach@69
|
513 saveLowTimeStampCountInto( startStamp ); \
|
|
msach@69
|
514
|
|
msach@69
|
515 #define Meas_endSendOfType \
|
|
msach@69
|
516 saveLowTimeStampCountInto( endStamp ); \
|
|
msach@69
|
517 addIntervalToHist( startStamp, endStamp, \
|
|
msach@69
|
518 _VMSMasterEnv->measHists[ SendOfTypeHistIdx ] );
|
|
msach@69
|
519
|
|
msach@69
|
520 #define Meas_startReceiveFromTo \
|
|
msach@69
|
521 int32 startStamp, endStamp; \
|
|
msach@69
|
522 saveLowTimeStampCountInto( startStamp ); \
|
|
msach@69
|
523
|
|
msach@69
|
524 #define Meas_endReceiveFromTo \
|
|
msach@69
|
525 saveLowTimeStampCountInto( endStamp ); \
|
|
msach@69
|
526 addIntervalToHist( startStamp, endStamp, \
|
|
msach@69
|
527 _VMSMasterEnv->measHists[ ReceiveFromToHistIdx ] );
|
|
msach@69
|
528
|
|
msach@69
|
529 #define Meas_startReceiveOfType \
|
|
msach@69
|
530 int32 startStamp, endStamp; \
|
|
msach@69
|
531 saveLowTimeStampCountInto( startStamp ); \
|
|
msach@69
|
532
|
|
msach@69
|
533 #define Meas_endReceiveOfType \
|
|
msach@69
|
534 saveLowTimeStampCountInto( endStamp ); \
|
|
msach@69
|
535 addIntervalToHist( startStamp, endStamp, \
|
|
msach@69
|
536 _VMSMasterEnv->measHists[ReceiveOfTypeHistIdx ] );
|
|
Me@68
|
537
|
|
Me@53
|
538 //=====
|
|
Me@42
|
539
|
|
Me@50
|
540 #include "probes.h"
|
|
Me@65
|
541 #include "vutilities.h"
|
|
Me@42
|
542
|
|
Me@42
|
543 #endif /* _VMS_H */
|
|
Me@42
|
544
|