comparison VMS.h @ 108:3bc3b89630c7

perf counters
author engelhardt@cray1
date Tue, 26 Jul 2011 15:36:24 +0200
parents 97e26095c01f
children 659299627e70
comparison
equal deleted inserted replaced
44:ff8fed98bef1 48:66af972fa0a5
14 #include "Queue_impl/PrivateQueue.h" 14 #include "Queue_impl/PrivateQueue.h"
15 #include "Histogram/Histogram.h" 15 #include "Histogram/Histogram.h"
16 #include "DynArray/DynArray.h" 16 #include "DynArray/DynArray.h"
17 #include "Hash_impl/PrivateHash.h" 17 #include "Hash_impl/PrivateHash.h"
18 #include "vmalloc.h" 18 #include "vmalloc.h"
19 #include "Counters/Counters.h"
19 20
20 #include <pthread.h> 21 #include <pthread.h>
21 #include <sys/time.h> 22 #include <sys/time.h>
22 23
23 24
56 57
57 //=========================== STATS ======================= 58 //=========================== STATS =======================
58 59
59 //when MEAS__TIME_STAMP_SUSP is defined, causes code to be inserted and 60 //when MEAS__TIME_STAMP_SUSP is defined, causes code to be inserted and
60 // compiled-in that saves the low part of the time stamp count just before 61 // compiled-in that saves the low part of the time stamp count just before
61 // 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 62 // suspending a processor and just after resuming that processor. It is
62 // saved into a field added to VirtProcr. Have to sanity-check for 63 // saved into a field added to VirtProcr. Have to sanity-check for
63 // rollover of low portion into high portion. 64 // rollover of low portion into high portion.
64 //#define MEAS__TIME_STAMP_SUSP 65 //#define MEAS__TIME_STAMP_SUSP
65 //#define MEAS__TIME_MASTER 66 //#define MEAS__TIME_MASTER
66 #define MEAS__TIME_PLUGIN 67 #define MEAS__TIME_PLUGIN
70 71
71 //For code that calculates normalization-offset between TSC counts of 72 //For code that calculates normalization-offset between TSC counts of
72 // different cores. 73 // different cores.
73 #define NUM_TSC_ROUND_TRIPS 10 74 #define NUM_TSC_ROUND_TRIPS 10
74 75
76 #define MEAS__PERF_COUNTERS
75 77
76 //========================= Hardware related Constants ===================== 78 //========================= Hardware related Constants =====================
77 //This value is the number of hardware threads in the shared memory 79 //This value is the number of hardware threads in the shared memory
78 // machine 80 // machine
79 #define NUM_CORES 8 81 #define NUM_CORES 2
80 82
81 // tradeoff amortizing master fixed overhead vs imbalance potential 83 // tradeoff amortizing master fixed overhead vs imbalance potential
82 // when work-stealing, can make bigger, at risk of losing cache affinity 84 // when work-stealing, can make bigger, at risk of losing cache affinity
83 #define NUM_SCHED_SLOTS 5 85 #define NUM_SCHED_SLOTS 5
84 86
200 #endif 202 #endif
201 #ifdef MEAS__TIME_MASTER /* in VirtProcr because multiple masterVPs*/ 203 #ifdef MEAS__TIME_MASTER /* in VirtProcr because multiple masterVPs*/
202 unsigned int startMasterTSCLow;USE_GNU 204 unsigned int startMasterTSCLow;USE_GNU
203 unsigned int endMasterTSCLow; 205 unsigned int endMasterTSCLow;
204 #endif 206 #endif
207 #ifdef MEAS__PERF_COUNTERS //
208 CounterRecord** counter_history;
209 PrivDynArrayInfo* counter_history_array_info;
210 #endif
205 //======================================== 211 //========================================
206 212
207 float64 createPtInSecs; //have space but don't use on some configs 213 float64 createPtInSecs; //have space but don't use on some configs
208 }; 214 };
209 //VirtProcr 215 //VirtProcr
256 #endif 262 #endif
257 #ifdef MEAS__TIME_MASTER_LOCK 263 #ifdef MEAS__TIME_MASTER_LOCK
258 Histogram *masterLockLowTimeHist; 264 Histogram *masterLockLowTimeHist;
259 Histogram *masterLockHighTimeHist; 265 Histogram *masterLockHighTimeHist;
260 #endif 266 #endif
267 #ifdef MEAS__PERF_COUNTERS
268 int cycles_counter_fd[NUM_CORES];
269 int instrs_counter_fd[NUM_CORES];
270 #endif
261 } 271 }
262 MasterEnv; 272 MasterEnv;
263 273
264 //========================= Extra Stuff Data Strucs ======================= 274 //========================= Extra Stuff Data Strucs =======================
265 typedef struct 275 typedef struct