annotate VMS.h @ 129:ce02441b77cf

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