diff VSs.h @ 3:468b8638ff92

Works -- first working version, includes slave pruning and shutdown detection
author Sean Halle <seanhalle@yahoo.com>
date Wed, 06 Jun 2012 17:55:36 -0700
parents f2ed1c379fe7
children 13af59ed7ea5
line diff
     1.1 --- a/VSs.h	Wed May 30 15:02:38 2012 -0700
     1.2 +++ b/VSs.h	Wed Jun 06 17:55:36 2012 -0700
     1.3 @@ -12,7 +12,7 @@
     1.4  #include "Queue_impl/PrivateQueue.h"
     1.5  #include "Hash_impl/PrivateHash.h"
     1.6  #include "VMS_impl/VMS.h"
     1.7 -#include "dependency.h"
     1.8 +#include "Measurement/dependency.h"
     1.9  
    1.10  
    1.11  //===========================================================================
    1.12 @@ -29,13 +29,13 @@
    1.13  /*This header defines everything specific to the VSs semantic plug-in
    1.14   */
    1.15  typedef struct _VSsSemReq   VSsSemReq;
    1.16 -typedef void  (*VSsTaskFnPtr )   ( void * ); //executed atomically in master
    1.17 +typedef void  (*VSsTaskFnPtr )   ( void *, SlaveVP *);
    1.18  typedef void  (*PtrToAtomicFn )  ( void * ); //executed atomically in master
    1.19  //===========================================================================
    1.20  
    1.21  #define IN    1
    1.22  #define OUT   2
    1.23 -#define INOUT 3
    1.24 +#define INOUT 2
    1.25  
    1.26  #define READER  1
    1.27  #define WRITER  2
    1.28 @@ -54,10 +54,19 @@
    1.29  
    1.30  typedef struct
    1.31   {
    1.32 +   bool32       hasEnabledNonFinishedWriter;
    1.33 +   int32        numEnabledNonDoneReaders;
    1.34 +   PrivQueueStruc *waitersQ;
    1.35 + }
    1.36 +VSsPointerEntry;
    1.37 +
    1.38 +typedef struct
    1.39 + {
    1.40     void       **args; //ctld args must come first, as ptrs
    1.41     VSsTaskType *taskType;
    1.42     int32        numBlockingProp;
    1.43     SlaveVP     *slaveAssignedTo;
    1.44 +   VSsPointerEntry  **ptrEntries;
    1.45   }
    1.46  VSsTaskStub;
    1.47  
    1.48 @@ -69,14 +78,6 @@
    1.49   }
    1.50  VSsTaskStubCarrier;
    1.51  
    1.52 -typedef struct
    1.53 - {
    1.54 -   bool32       hasEnabledNonFinishedWriter;
    1.55 -   int32        numEnabledNonDoneReaders;
    1.56 -   PrivQStruct *waitersQ;
    1.57 - }
    1.58 -VSsPointerEntry;
    1.59 -
    1.60  
    1.61  typedef struct
    1.62   {
    1.63 @@ -157,12 +158,15 @@
    1.64     PrivQueueStruc  *taskReadyQ;  //Q: shared or local?
    1.65     HashTable       *argPtrHashTbl;
    1.66     int32            numSlaveVP;
    1.67 -   int32            nextCoreToGetNewPr;
    1.68 +   int32            nextCoreToGetNewSlv;
    1.69     int32            primitiveStartTime;
    1.70  
    1.71                         //fix limit on num with dynArray
    1.72     VSsSingleton     fnSingletons[NUM_STRUCS_IN_SEM_ENV];
    1.73     VSsTrans         transactionStrucs[NUM_STRUCS_IN_SEM_ENV];
    1.74 +
    1.75 +   bool32          *coreIsDone;
    1.76 +   int32            numCoresDone;
    1.77     
    1.78     #ifdef HOLISTIC__TURN_ON_OBSERVE_UCC
    1.79     ListOfArrays* unitList;
    1.80 @@ -178,7 +182,7 @@
    1.81     #ifdef HOLISTIC__TURN_ON_PERF_COUNTERS
    1.82     ListOfArrays* counterList[NUM_CORES];
    1.83     #endif
    1.84 -   SlaveVP* idlePr[NUM_CORES][NUM_ANIM_SLOTS];
    1.85 +   SlaveVP* idleSlv[NUM_CORES][NUM_ANIM_SLOTS];
    1.86     int shutdownInitiated;
    1.87   }
    1.88  VSsSemEnv;
    1.89 @@ -237,7 +241,7 @@
    1.90  
    1.91    SlaveVP *
    1.92  VSs__create_slave_with_affinity( TopLevelFnPtr fnPtr,    void *initData,
    1.93 -                            SlaveVP *creatingPr, int32 coreToAssignOnto);
    1.94 +                            SlaveVP *creatingSlv, int32 coreToAssignOnto);
    1.95  
    1.96  void
    1.97  VSs__dissipate_slave( SlaveVP *slaveToDissipate );
    1.98 @@ -251,7 +255,7 @@
    1.99  
   1.100  //=======================
   1.101  int32
   1.102 -VSs__submit_task( VSsTaskType *taskType, void **args, SlaveVP *animSlv);
   1.103 +VSs__submit_task( VSsTaskType *taskType, void *args, SlaveVP *animSlv);
   1.104  
   1.105  
   1.106  void
   1.107 @@ -284,7 +288,7 @@
   1.108  
   1.109  //=========================  Internal use only  =============================
   1.110  void
   1.111 -VSs__Request_Handler( SlaveVP *requestingPr, void *_semEnv );
   1.112 +VSs__Request_Handler( SlaveVP *requestingSlv, void *_semEnv );
   1.113  
   1.114  SlaveVP *
   1.115  VSs__assign_slaveVP_to_slot( void *_semEnv, AnimSlot *slot );
   1.116 @@ -294,7 +298,7 @@
   1.117                            VSsSemEnv *semEnv,    int32 coreToAssignOnto );
   1.118  
   1.119  //=====================  Measurement of Lang Overheads  =====================
   1.120 -#include "VSs_Measurement.h"
   1.121 +#include "Measurement/VSs_Measurement.h"
   1.122  
   1.123  //===========================================================================
   1.124  #endif	/* _VSs_H */