changeset 229:5bb234f93cf6 Common_Ancestor

fix master unlock
author Nina Engelhardt <nengel@mailbox.tu-berlin.de>
date Fri, 16 Mar 2012 17:33:44 +0100
parents 125f0f90a0d3
children 0ee1a3c8972d
files Defines/VMS_defs__HW_constants.h Defines/VMS_defs__turn_on_and_off.h Hardware_Dependent/VMS__HW_measurement.h Hardware_Dependent/VMS__primitives_asm.s Services_Offered_by_VMS/Measurement_and_Stats/MEAS__macros.h VMS__startup_and_shutdown.c
diffstat 6 files changed, 21 insertions(+), 4 deletions(-) [+]
line diff
     1.1 --- a/Defines/VMS_defs__HW_constants.h	Thu Mar 15 18:28:29 2012 +0100
     1.2 +++ b/Defines/VMS_defs__HW_constants.h	Fri Mar 16 17:33:44 2012 +0100
     1.3 @@ -18,7 +18,7 @@
     1.4  
     1.5     // tradeoff amortizing master fixed overhead vs imbalance potential
     1.6     // when work-stealing, can make bigger, at risk of losing cache affinity
     1.7 -#define NUM_SCHED_SLOTS  3
     1.8 +#define NUM_SCHED_SLOTS  1
     1.9  
    1.10     //These are for backoff inside core-loop, which reduces lock contention
    1.11  #define NUM_REPS_W_NO_WORK_BEFORE_YIELD      10
     2.1 --- a/Defines/VMS_defs__turn_on_and_off.h	Thu Mar 15 18:28:29 2012 +0100
     2.2 +++ b/Defines/VMS_defs__turn_on_and_off.h	Fri Mar 16 17:33:44 2012 +0100
     2.3 @@ -21,7 +21,7 @@
     2.4  /*turns on the probe-instrumentation in the application -- when not
     2.5   * defined, the calls to the probe functions turn into comments
     2.6   */
     2.7 -#define DEBUG__TURN_ON_DEBUG_PRINT
     2.8 +//#define DEBUG__TURN_ON_DEBUG_PRINT
     2.9  
    2.10  /*These defines turn types of bug messages on and off
    2.11   */
     3.1 --- a/Hardware_Dependent/VMS__HW_measurement.h	Thu Mar 15 18:28:29 2012 +0100
     3.2 +++ b/Hardware_Dependent/VMS__HW_measurement.h	Fri Mar 16 17:33:44 2012 +0100
     3.3 @@ -44,6 +44,6 @@
     3.4     // different cores.
     3.5  //#define NUM_TSC_ROUND_TRIPS 10
     3.6  
     3.7 -
     3.8 +void setup_perf_counters();
     3.9  #endif	/* */
    3.10  
     4.1 --- a/Hardware_Dependent/VMS__primitives_asm.s	Thu Mar 15 18:28:29 2012 +0100
     4.2 +++ b/Hardware_Dependent/VMS__primitives_asm.s	Fri Mar 16 17:33:44 2012 +0100
     4.3 @@ -100,7 +100,7 @@
     4.4      movq    $_VMSMasterEnv, %rcx
     4.5      movq        (%rcx), %rcx         #_VMSMasterEnv is pointer to struct
     4.6      movq    0x00(%rcx), %rax         #get CoreCtlr return pt
     4.7 -    movl    $0x0      , 0x08(%rcx)   #release lock
     4.8 +    movl    $0x0      , 0x100(%rcx)   #release lock
     4.9      jmp     *%rax                    #jmp to CoreCtlr
    4.10  MasterReturn:
    4.11      ret
     5.1 --- a/Services_Offered_by_VMS/Measurement_and_Stats/MEAS__macros.h	Thu Mar 15 18:28:29 2012 +0100
     5.2 +++ b/Services_Offered_by_VMS/Measurement_and_Stats/MEAS__macros.h	Fri Mar 16 17:33:44 2012 +0100
     5.3 @@ -319,9 +319,23 @@
     5.4       int instrs_counter_fd[NUM_CORES]; \
     5.5       uint64 start_master_lock[NUM_CORES][2]; \
     5.6       CounterHandler counterHandler;
     5.7 +
     5.8 +   #define HOLISTIC__Setup_Perf_Counters void setup_perf_counters();
     5.9 +   
    5.10 +   #define HOLISTIC__Start_Perf_Counters prctl(PR_TASK_PERF_EVENTS_ENABLE);
    5.11 +
    5.12 +   #define HOLISTIC__Record_HwResponderInvocation_start \
    5.13 +        uint64 cycles,instrs; \
    5.14 +        saveCyclesAndInstrs(animatingPr->coreAnimatedBy,cycles, instrs); \
    5.15 +        (*(_VMSMasterEnv->counterHandler))(HwResponderInvocation_start,animatingPr->procrID,animatingPr->numTimesScheduled,animatingPr,cycles,instrs); 
    5.16 +
    5.17 +   
    5.18 +   
    5.19  #else  
    5.20     #define MEAS__Insert_Counter_Handler
    5.21     #define MEAS__Insert_Counter_Meas_Fields_into_MasterEnv
    5.22 +   #define HOLISTIC__Setup_Perf_Counters
    5.23 +   #define HOLISTIC__Start_Perf_Counters
    5.24  #endif
    5.25  
    5.26  //Experiment in two-step macros -- if doesn't work, insert each separately
     6.1 --- a/VMS__startup_and_shutdown.c	Thu Mar 15 18:28:29 2012 +0100
     6.2 +++ b/VMS__startup_and_shutdown.c	Fri Mar 16 17:33:44 2012 +0100
     6.3 @@ -75,6 +75,7 @@
     6.4        printf( "\n\n Running in SEQUENTIAL mode \n\n" );
     6.5     #else
     6.6        create_masterEnv();
     6.7 +      printf("Offset of lock in masterEnv:%d\n",offsetof(MasterEnv,masterLock));
     6.8        create_the_coreCtlr_OS_threads();
     6.9     #endif
    6.10   }
    6.11 @@ -316,6 +317,8 @@
    6.12  
    6.13           PROBES__Create_Probe_Bookkeeping_Vars;
    6.14           
    6.15 +         HOLISTIC__Setup_Perf_Counters;
    6.16 +         
    6.17     //========================================================================
    6.18   }
    6.19