changeset 228:125f0f90a0d3 Common_Ancestor

integrating holistic model in common ancestor - not finished yet
author Nina Engelhardt <nengel@mailbox.tu-berlin.de>
date Thu, 15 Mar 2012 18:28:29 +0100
parents 5c475c4b7b49
children 5bb234f93cf6
files Defines/VMS_defs__turn_on_and_off.h Services_Offered_by_VMS/Measurement_and_Stats/MEAS__macros.h VMS.h VMS__int.c VMS__startup_and_shutdown.c
diffstat 5 files changed, 65 insertions(+), 3 deletions(-) [+]
line diff
     1.1 --- a/Defines/VMS_defs__turn_on_and_off.h	Thu Mar 15 06:36:37 2012 -0700
     1.2 +++ b/Defines/VMS_defs__turn_on_and_off.h	Thu Mar 15 18:28:29 2012 +0100
     1.3 @@ -60,6 +60,9 @@
     1.4     /*turn on/off subtraction of create measurements from plugin meas*/
     1.5  //#define MEAS__TURN_ON_EXCLUDE_CREATION_TIME 
     1.6  
     1.7 +#define HOLISTIC__TURN_ON_PERF_COUNTERS
     1.8 +#define HOLISTIC__TURN_ON_OBSERVE_UCC
     1.9 +#define DETECT_LOOP_GRAPH
    1.10  
    1.11  //===================  Turn on or off system options  =======================
    1.12  //
     2.1 --- a/Services_Offered_by_VMS/Measurement_and_Stats/MEAS__macros.h	Thu Mar 15 06:36:37 2012 -0700
     2.2 +++ b/Services_Offered_by_VMS/Measurement_and_Stats/MEAS__macros.h	Thu Mar 15 18:28:29 2012 +0100
     2.3 @@ -292,12 +292,43 @@
     2.4     #define MEAS__Print_Hists_for_System_Meas 
     2.5  #endif
     2.6  
     2.7 + #ifdef HOLISTIC__TURN_ON_PERF_COUNTERS
     2.8 +   
     2.9 +#define MEAS__Insert_Counter_Handler \
    2.10 +   typedef void (*CounterHandler) (int,int,int,SlaveVP*,uint64,uint64);
    2.11 + 
    2.12 +   enum eventType {
    2.13 +    DebugEvt = 0,
    2.14 +    AppResponderInvocation_start,
    2.15 +    AppResponder_start,
    2.16 +    AppResponder_end,
    2.17 +    AssignerInvocation_start,
    2.18 +    NextAssigner_start,
    2.19 +    Assigner_start,
    2.20 +    Assigner_end,
    2.21 +    Work_start,
    2.22 +    Work_end,
    2.23 +    HwResponderInvocation_start,
    2.24 +    Timestamp_start,
    2.25 +    Timestamp_end
    2.26 +   };
    2.27 +   
    2.28 +
    2.29 +   #define MEAS__Insert_Counter_Meas_Fields_into_MasterEnv \
    2.30 +     int cycles_counter_fd[NUM_CORES]; \
    2.31 +     int instrs_counter_fd[NUM_CORES]; \
    2.32 +     uint64 start_master_lock[NUM_CORES][2]; \
    2.33 +     CounterHandler counterHandler;
    2.34 +#else  
    2.35 +   #define MEAS__Insert_Counter_Handler
    2.36 +   #define MEAS__Insert_Counter_Meas_Fields_into_MasterEnv
    2.37 +#endif
    2.38  
    2.39  //Experiment in two-step macros -- if doesn't work, insert each separately
    2.40  #define MEAS__Insert_Meas_Fields_into_Slave  \
    2.41     MEAS__Insert_Susp_Meas_Fields_into_Slave \
    2.42     MEAS__Insert_Master_Meas_Fields_into_Slave \
    2.43 -   MEAS__Insert_System_Meas_Fields_into_Slave
    2.44 +   MEAS__Insert_System_Meas_Fields_into_Slave 
    2.45  
    2.46  
    2.47  //======================  Histogram Macros -- Create ========================
     3.1 --- a/VMS.h	Thu Mar 15 06:36:37 2012 -0700
     3.2 +++ b/VMS.h	Thu Mar 15 18:28:29 2012 +0100
     3.3 @@ -49,6 +49,9 @@
     3.4  typedef void     (*TopLevelFnPtr)  ( void *, SlaveVP * ); //initData, animSlv
     3.5  typedef void       TopLevelFn      ( void *, SlaveVP * ); //initData, animSlv
     3.6  typedef void     (*ResumeSlvFnPtr) ( SlaveVP *, void * );
     3.7 +      //=========== MEASUREMENT STUFF ==========
     3.8 +        MEAS__Insert_Counter_Handler
     3.9 +      //========================================
    3.10  
    3.11  //============================ HW Dependent Fns ================================
    3.12  
    3.13 @@ -105,6 +108,12 @@
    3.14   };
    3.15  //SchedSlot
    3.16  
    3.17 + enum VPtype {
    3.18 +     Slave = 1, //default
    3.19 +     Master,
    3.20 +     Shutdown
    3.21 + };
    3.22 + 
    3.23  /*WARNING: re-arranging this data structure could cause Slv switching
    3.24   *         assembly code to fail -- hard-codes offsets of fields
    3.25   */
    3.26 @@ -130,7 +139,10 @@
    3.27         MEAS__Insert_Meas_Fields_into_Slave;
    3.28        //========================================
    3.29     
    3.30 -   float64      createPtInSecs;  //have space but don't use on some configs
    3.31 +   enum VPtype type;
    3.32 +   int         numTimesAssigned;
    3.33 +       
    3.34 +   float64     createPtInSecs;  //have space but don't use on some configs
    3.35   };
    3.36  //SlaveVP
    3.37  
    3.38 @@ -177,6 +189,7 @@
    3.39         MEAS__Insert_Malloc_Meas_Fields_into_MasterEnv;
    3.40         MEAS__Insert_Plugin_Meas_Fields_into_MasterEnv;
    3.41         MEAS__Insert_System_Meas_Fields_into_MasterEnv;
    3.42 +       MEAS__Insert_Counter_Meas_Fields_into_MasterEnv;
    3.43        //==========================================
    3.44   }
    3.45  MasterEnv;
    3.46 @@ -238,6 +251,9 @@
    3.47  void
    3.48  VMS_SS__start_the_work_then_wait_until_done();
    3.49  
    3.50 +SlaveVP* 
    3.51 +VMS_SS__create_shutdown_slave();
    3.52 +
    3.53  void
    3.54  VMS_SS__shutdown();
    3.55  
     4.1 --- a/VMS__int.c	Thu Mar 15 06:36:37 2012 -0700
     4.2 +++ b/VMS__int.c	Thu Mar 15 18:28:29 2012 +0100
     4.3 @@ -166,6 +166,8 @@
     4.4     newSlv->slaveID      = _VMSMasterEnv->numSlavesCreated++;
     4.5     newSlv->requests     = NULL;
     4.6     newSlv->schedSlot    = NULL;
     4.7 +   newSlv->type         = Slave;
     4.8 +   newSlv->numTimesAssigned = 0;
     4.9  
    4.10     VMS_int__point_slaveVP_to_Fn( newSlv, fnPtr, dataParam );
    4.11             
     5.1 --- a/VMS__startup_and_shutdown.c	Thu Mar 15 06:36:37 2012 -0700
     5.2 +++ b/VMS__startup_and_shutdown.c	Thu Mar 15 18:28:29 2012 +0100
     5.3 @@ -295,6 +295,7 @@
     5.4           //Q: should give masterVP core-specific info as its init data?
     5.5        masterVPs[ coreIdx ] = VMS_int__create_slaveVP( (TopLevelFnPtr)&schedulingMaster, (void*)masterEnv );
     5.6        masterVPs[ coreIdx ]->coreAnimatedBy = coreIdx;
     5.7 +      masterVPs[ coreIdx ]->type = Master;
     5.8        allSchedSlots[ coreIdx ] = create_sched_slots(); //makes for one core
     5.9        _VMSMasterEnv->workStealingGates[ coreIdx ] = NULL;
    5.10      }
    5.11 @@ -440,6 +441,15 @@
    5.12   }
    5.13  
    5.14  
    5.15 +SlaveVP* VMS_SS__create_shutdown_slave(){
    5.16 +    SlaveVP* shutdownVP;
    5.17 +    
    5.18 +    shutdownVP = VMS_int__create_slaveVP( &endOSThreadFn, NULL );
    5.19 +    shutdownVP->type = Shutdown;
    5.20 +    
    5.21 +    return shutdownVP;
    5.22 +}
    5.23 +
    5.24  //TODO: look at architecting cleanest separation between request handler
    5.25  // and master loop, for dissipate, create, shutdown, and other non-semantic
    5.26  // requests.  Issue is chain: one removes requests from AppSlv, one dispatches
    5.27 @@ -481,7 +491,7 @@
    5.28        // directly into the Q -- each core will die when gets one
    5.29     for( coreIdx = 0; coreIdx < NUM_CORES; coreIdx++ )
    5.30      {    //Note, this is running in the master
    5.31 -      shutDownSlv = VMS_int__create_slaveVP( &endOSThreadFn, NULL );
    5.32 +      shutDownSlv = VMS_SS__create_shutdown_slave();
    5.33           //last slave has dissipated, so no more in slots, so write
    5.34           // shut down slave into first schedulng slot.
    5.35        schedSlots = _VMSMasterEnv->allSchedSlots[ coreIdx ];