diff MasterLoop.c @ 210:a18539c0bc37

Moved defines and probes into own directories
author Some Random Person <seanhalle@yahoo.com>
date Wed, 07 Mar 2012 22:53:50 -0800
parents 0c83ea8adefc
children 712218cdc4ba
line diff
     1.1 --- a/MasterLoop.c	Sun Mar 04 14:26:35 2012 -0800
     1.2 +++ b/MasterLoop.c	Wed Mar 07 22:53:50 2012 -0800
     1.3 @@ -83,7 +83,7 @@
     1.4     void           *semanticEnv;
     1.5  
     1.6     int32           thisCoresIdx;
     1.7 -   SlaveVP      *masterVP;
     1.8 +   SlaveVP        *masterVP;
     1.9     volatile        SlaveVP *volatileMasterVP;
    1.10     
    1.11     volatileMasterVP = animatingSlv;
    1.12 @@ -118,7 +118,7 @@
    1.13     schedSlots       = masterEnv->allSchedSlots[thisCoresIdx];
    1.14  
    1.15     requestHandler   = masterEnv->requestHandler;
    1.16 -   slaveAssigner   = masterEnv->slaveAssigner;
    1.17 +   slaveAssigner    = masterEnv->slaveAssigner;
    1.18     semanticEnv      = masterEnv->semanticEnv;
    1.19  
    1.20  
    1.21 @@ -133,23 +133,12 @@
    1.22           currSlot->workIsDone         = FALSE;
    1.23           currSlot->needsSlaveAssigned = TRUE;
    1.24  
    1.25 -            //process requests from slave to master
    1.26 -               //====================== MEASUREMENT STUFF ===================
    1.27 -               #ifdef MEAS__TURN_ON_PLUGIN_MEAS
    1.28 -               int32 startStamp1, endStamp1;
    1.29 -               saveLowTimeStampCountInto( startStamp1 );
    1.30 -               #endif
    1.31 -               //============================================================
    1.32 +               MEAS__startReqHdlr;
    1.33 +               
    1.34 +            //process the requests made by the slave (held inside slave struc)
    1.35           (*requestHandler)( currSlot->slaveAssignedToSlot, semanticEnv );
    1.36 -               //====================== MEASUREMENT STUFF ===================
    1.37 -               #ifdef MEAS__TURN_ON_PLUGIN_MEAS
    1.38 -               saveLowTimeStampCountInto( endStamp1 );
    1.39 -               addIntervalToHist( startStamp1, endStamp1,
    1.40 -                                        _VMSMasterEnv->reqHdlrLowTimeHist );
    1.41 -               addIntervalToHist( startStamp1, endStamp1,
    1.42 -                                        _VMSMasterEnv->reqHdlrHighTimeHist );
    1.43 -               #endif
    1.44 -               //============================================================
    1.45 +         
    1.46 +               MEAS__endReqHdlr;
    1.47         }
    1.48        if( currSlot->needsSlaveAssigned )
    1.49         {    //give slot a new Slv
    1.50 @@ -158,17 +147,15 @@
    1.51           
    1.52           if( schedSlaveVP != NULL )
    1.53            { currSlot->slaveAssignedToSlot = schedSlaveVP;
    1.54 -            schedSlaveVP->schedSlot        = currSlot;
    1.55 +            schedSlaveVP->schedSlot       = currSlot;
    1.56              currSlot->needsSlaveAssigned  = FALSE;
    1.57              numSlotsFilled               += 1;
    1.58 -            
    1.59 -            writeVMSQ( schedSlaveVP, readyToAnimateQ );
    1.60            }
    1.61         }
    1.62      }
    1.63  
    1.64     
    1.65 -   #ifdef USE_WORK_STEALING
    1.66 +   #ifdef SYS__TURN_ON_WORK_STEALING
    1.67        //If no slots filled, means no more work, look for work to steal.
    1.68     if( numSlotsFilled == 0 )
    1.69      { gateProtected_stealWorkInto( currSlot, readyToAnimateQ, masterVP );