changeset 226:ea70fa57776e Common_Ancestor

fixed last bug that shows up in sequential mode -- still a race of some kind
author Some Random Person <seanhalle@yahoo.com>
date Thu, 15 Mar 2012 05:29:07 -0700
parents 309559064073
children 5c475c4b7b49
files Defines/VMS_defs__turn_on_and_off.h Hardware_Dependent/VMS__primitives_asm.s VMS.h VMS__startup_and_shutdown.c
diffstat 4 files changed, 25 insertions(+), 22 deletions(-) [+]
line diff
     1.1 --- a/Defines/VMS_defs__turn_on_and_off.h	Thu Mar 15 04:11:55 2012 -0700
     1.2 +++ b/Defines/VMS_defs__turn_on_and_off.h	Thu Mar 15 05:29:07 2012 -0700
     1.3 @@ -21,7 +21,7 @@
     1.4  /*turns on the probe-instrumentation in the application -- when not
     1.5   * defined, the calls to the probe functions turn into comments
     1.6   */
     1.7 -#define DEBUG__TURN_ON_DEBUG_MSGS
     1.8 +//#define DEBUG__TURN_ON_DEBUG_MSGS
     1.9  //#define DEBUG__TURN_ON_ERROR_MSGS
    1.10  
    1.11  /*These defines turn types of bug messages on and off
     2.1 --- a/Hardware_Dependent/VMS__primitives_asm.s	Thu Mar 15 04:11:55 2012 -0700
     2.2 +++ b/Hardware_Dependent/VMS__primitives_asm.s	Thu Mar 15 05:29:07 2012 -0700
     2.3 @@ -31,8 +31,8 @@
     2.4   * 0x38 coreCtlrStackPtr
     2.5   *
     2.6   * _VMSMasterEnv  offsets:
     2.7 - * 0x48 coreCtlrReturnPt
     2.8 - * 0x54 masterLock
     2.9 + * 0x0 coreCtlrReturnPt
    2.10 + * 0x8 masterLock
    2.11   */
    2.12  .globl switchToSlv
    2.13  switchToSlv:
    2.14 @@ -56,8 +56,8 @@
    2.15   * 0x38 coreCtlrStackPtr
    2.16   *
    2.17   * _VMSMasterEnv  offsets:
    2.18 - * 0x48 coreCtlrReturnPt
    2.19 - * 0x54 masterLock
    2.20 + * 0x0 coreCtlrReturnPt
    2.21 + * 0x8 masterLock
    2.22   */
    2.23  .globl switchToCoreCtlr
    2.24  switchToCoreCtlr:
    2.25 @@ -68,8 +68,8 @@
    2.26      movq    0x38(%rdi), %rsp         #restore stack pointer
    2.27      movq    0x30(%rdi), %rbp         #restore frame pointer
    2.28      movq    $_VMSMasterEnv, %rcx
    2.29 -    movq    (%rcx)    , %rcx
    2.30 -    movq    0x48(%rcx), %rax         #get CoreCtlrStartPt
    2.31 +    movq        (%rcx), %rcx         #_VMSMasterEnv is pointer to struct
    2.32 +    movq    0x00(%rcx), %rax         #get CoreCtlrStartPt
    2.33      jmp     *%rax                    #jmp to CoreCtlr
    2.34  SlvReturn:
    2.35      ret
    2.36 @@ -86,8 +86,8 @@
    2.37   * 0x38 coreCtlrStackPtr
    2.38   *
    2.39   * _VMSMasterEnv  offsets:
    2.40 - * 0x48 coreCtlrReturnPt
    2.41 - * 0x54 masterLock
    2.42 + * 0x0 coreCtlrReturnPt
    2.43 + * 0x8 masterLock
    2.44   */
    2.45  .globl masterSwitchToCoreCtlr
    2.46  masterSwitchToCoreCtlr:
    2.47 @@ -98,9 +98,9 @@
    2.48      movq    0x38(%rdi), %rsp         #restore stack pointer
    2.49      movq    0x30(%rdi), %rbp         #restore frame pointer
    2.50      movq    $_VMSMasterEnv, %rcx
    2.51 -    movq    (%rcx)    , %rcx
    2.52 -    movq    0x48(%rcx), %rax         #get CoreCtlr return pt
    2.53 -    movl    $0x0      , 0x54(%rcx)   #release lock
    2.54 +    movq        (%rcx), %rcx         #_VMSMasterEnv is pointer to struct
    2.55 +    movq    0x00(%rcx), %rax         #get CoreCtlr return pt
    2.56 +    movl    $0x0      , 0x08(%rcx)   #release lock
    2.57      jmp     *%rax                    #jmp to CoreCtlr
    2.58  MasterReturn:
    2.59      ret
    2.60 @@ -120,8 +120,8 @@
    2.61   * 0x38 coreCtlrStackPtr
    2.62   *
    2.63   * _VMSMasterEnv  offsets:
    2.64 - * 0x48 coreCtlrReturnPt
    2.65 - * 0x58 masterLock
    2.66 + * 0x0 coreCtlrReturnPt
    2.67 + * 0x8 masterLock
    2.68   */
    2.69  .globl asmTerminateCoreCtlr
    2.70  asmTerminateCoreCtlr:
     3.1 --- a/VMS.h	Thu Mar 15 04:11:55 2012 -0700
     3.2 +++ b/VMS.h	Thu Mar 15 05:29:07 2012 -0700
     3.3 @@ -140,7 +140,11 @@
     3.4   *         (because -O3 messes with things otherwise)
     3.5   */
     3.6  typedef struct
     3.7 - {
     3.8 + {    //The offset of these fields is hard-coded into assembly
     3.9 +   void            *coreCtlrReturnPt;    //offset of field used in asm
    3.10 +   int32            masterLock __align_to_cacheline__;   //used in asm
    3.11 +   
    3.12 +      //below this, no asm uses the field offsets
    3.13     SlaveAssigner    slaveAssigner;
    3.14     RequestHandler   requestHandler;
    3.15     
    3.16 @@ -152,10 +156,7 @@
    3.17     MallocArrays    *freeLists;
    3.18     int32            amtOfOutstandingMem; //total currently allocated
    3.19  
    3.20 -   void            *coreCtlrReturnPt;//addr to jump to to re-enter coreCtlr
    3.21 -
    3.22     int32            setupComplete;
    3.23 -   int32            masterLock __align_to_cacheline__;
    3.24     GateStruc       *workStealingGates[ NUM_CORES ]; //concurrent work-steal
    3.25     int32            workStealingLock;
    3.26     
     4.1 --- a/VMS__startup_and_shutdown.c	Thu Mar 15 04:11:55 2012 -0700
     4.2 +++ b/VMS__startup_and_shutdown.c	Thu Mar 15 05:29:07 2012 -0700
     4.3 @@ -302,7 +302,7 @@
     4.4     _VMSMasterEnv->masterLock       = UNLOCKED;
     4.5     _VMSMasterEnv->allSchedSlots    = allSchedSlots;
     4.6     _VMSMasterEnv->workStealingLock = UNLOCKED;
     4.7 -
     4.8 +   _VMSMasterEnv->measHistsInfo = NULL; 
     4.9  
    4.10     //============================= MEASUREMENT STUFF ========================
    4.11        
    4.12 @@ -521,9 +521,11 @@
    4.13  VMS_SS__cleanup_at_end_of_shutdown()
    4.14   { 
    4.15        //Before getting rid of everything, print out any measurements made
    4.16 -   forAllInDynArrayDo( _VMSMasterEnv->measHistsInfo, (DynArrayFnPtr)&printHist );
    4.17 -   forAllInDynArrayDo( _VMSMasterEnv->measHistsInfo, (DynArrayFnPtr)&saveHistToFile);
    4.18 -   forAllInDynArrayDo( _VMSMasterEnv->measHistsInfo, (DynArrayFnPtr)&freeHist );
    4.19 +   if( _VMSMasterEnv->measHistsInfo != NULL )
    4.20 +    { forAllInDynArrayDo( _VMSMasterEnv->measHistsInfo, (DynArrayFnPtr)&printHist );
    4.21 +      forAllInDynArrayDo( _VMSMasterEnv->measHistsInfo, (DynArrayFnPtr)&saveHistToFile);
    4.22 +      forAllInDynArrayDo( _VMSMasterEnv->measHistsInfo, (DynArrayFnPtr)&freeHist );
    4.23 +    }
    4.24     
    4.25     MEAS__Print_Hists_for_Susp_Meas;
    4.26     MEAS__Print_Hists_for_Master_Meas;