diff VSs.h @ 4:13af59ed7ea5

Works -- with send-receive plus normal dependencies
author Sean Halle <seanhalle@yahoo.com>
date Thu, 14 Jun 2012 18:44:47 -0700
parents 468b8638ff92
children 8188c5b4bfd7
line diff
     1.1 --- a/VSs.h	Wed Jun 06 17:55:36 2012 -0700
     1.2 +++ b/VSs.h	Thu Jun 14 18:44:47 2012 -0700
     1.3 @@ -33,12 +33,13 @@
     1.4  typedef void  (*PtrToAtomicFn )  ( void * ); //executed atomically in master
     1.5  //===========================================================================
     1.6  
     1.7 -#define IN    1
     1.8 -#define OUT   2
     1.9 -#define INOUT 2
    1.10 +#define NONCTLD 0
    1.11 +#define IN      1  /*Trick -- READER same as IN*/
    1.12 +#define OUT     2  /*Trick -- WRITER same as OUT and INOUT*/
    1.13 +#define INOUT   2  /*Trick -- WRITER same as OUT and INOUT*/
    1.14  
    1.15 -#define READER  1
    1.16 -#define WRITER  2
    1.17 +#define READER  1  /*Trick -- READER same as IN*/
    1.18 +#define WRITER  2  /*Trick -- WRITER same as OUT and INOUT*/
    1.19  
    1.20  typedef struct
    1.21   {
    1.22 @@ -64,6 +65,7 @@
    1.23   {
    1.24     void       **args; //ctld args must come first, as ptrs
    1.25     VSsTaskType *taskType;
    1.26 +   int32       *taskID;
    1.27     int32        numBlockingProp;
    1.28     SlaveVP     *slaveAssignedTo;
    1.29     VSsPointerEntry  **ptrEntries;
    1.30 @@ -116,6 +118,11 @@
    1.31     create_slave_w_aff,
    1.32     dissipate_slave,
    1.33     //===============================
    1.34 +   send_type_to,
    1.35 +   receive_type_to,
    1.36 +   send_from_to,
    1.37 +   receive_from_to,
    1.38 +   //===============================
    1.39     malloc_req,
    1.40     free_req,
    1.41     singleton_fn_start,
    1.42 @@ -134,6 +141,15 @@
    1.43     void              *args;
    1.44     VSsTaskStub       *taskStub;
    1.45     
    1.46 +   SlaveVP           *senderSlv;
    1.47 +   SlaveVP           *receiverSlv;
    1.48 +   int32             *senderID;
    1.49 +   int32             *receiverID;
    1.50 +   int32              msgType;
    1.51 +   void              *msg;
    1.52 +   VSsSemReq         *nextReqInHashEntry;
    1.53 +   int32             *taskID;
    1.54 +   
    1.55     TopLevelFnPtr      fnPtr;
    1.56     void              *initData;
    1.57     int32              coreToAssignOnto;
    1.58 @@ -157,6 +173,7 @@
    1.59     PrivQueueStruc **readyVPQs;
    1.60     PrivQueueStruc  *taskReadyQ;  //Q: shared or local?
    1.61     HashTable       *argPtrHashTbl;
    1.62 +   HashTable       *commHashTbl;
    1.63     int32            numSlaveVP;
    1.64     int32            nextCoreToGetNewSlv;
    1.65     int32            primitiveStartTime;
    1.66 @@ -235,11 +252,11 @@
    1.67  
    1.68  //=======================
    1.69  
    1.70 -  SlaveVP *
    1.71 +SlaveVP *
    1.72  VSs__create_slave_with( TopLevelFnPtr fnPtr, void *initData,
    1.73                            SlaveVP *creatingSlv );
    1.74  
    1.75 -  SlaveVP *
    1.76 +SlaveVP *
    1.77  VSs__create_slave_with_affinity( TopLevelFnPtr fnPtr,    void *initData,
    1.78                              SlaveVP *creatingSlv, int32 coreToAssignOnto);
    1.79  
    1.80 @@ -254,13 +271,36 @@
    1.81  
    1.82  
    1.83  //=======================
    1.84 -int32
    1.85 +void
    1.86  VSs__submit_task( VSsTaskType *taskType, void *args, SlaveVP *animSlv);
    1.87  
    1.88 +inline int32 *
    1.89 +VSs__create_taskID_of_size( int32 numInts, SlaveVP *animSlv );
    1.90 +
    1.91 +void
    1.92 +VSs__submit_task_with_ID( VSsTaskType *taskType, void *args, int32 *taskID, 
    1.93 +                          SlaveVP     *animSlv);
    1.94  
    1.95  void
    1.96  VSs__end_task( SlaveVP *animSlv );
    1.97  
    1.98 +//=========================
    1.99 +
   1.100 +inline int32 *
   1.101 +VSs__give_self_taskID( SlaveVP *animSlv );
   1.102 +
   1.103 +void
   1.104 +VSs__send_of_type_to( void *msg, const int32 type, int32 *receiverID,
   1.105 +                      SlaveVP *senderSlv );
   1.106 +
   1.107 +void
   1.108 +VSs__send_from_to( void *msg, int32 *senderID, int32 *receiverID, SlaveVP *senderSlv );
   1.109 +
   1.110 +void *
   1.111 +VSs__receive_type_to( const int32 type, int32* receiverID, SlaveVP *receiverSlv );
   1.112 +
   1.113 +void *
   1.114 +VSs__receive_from_to( int32 *senderID, int32 *receiverID, SlaveVP *receiverSlv );
   1.115  
   1.116  //======================= Concurrency Stuff ======================
   1.117  void