Mercurial > cgi-bin > hgwebdir.cgi > VMS > VMS_Implementations > VSs_impls > VSs__MC_shared_impl
diff VSs.h @ 27:3b30da4643d1
Update2.. in middle of changes.. made request handler ptr be sent w/req struct
| author | Sean Halle <seanhalle@yahoo.com> |
|---|---|
| date | Sat, 12 Jan 2013 11:31:51 -0800 |
| parents | a60399b62614 |
| children | 91caa8a9d591 |
line diff
1.1 --- a/VSs.h Thu Oct 18 02:44:30 2012 -0700 1.2 +++ b/VSs.h Sat Jan 12 11:31:51 2013 -0800 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright 2009 OpenSourceStewardshipFoundation.org 1.6 + * Copyright 2009 OpenSourceResearchInstitute.org 1.7 * Licensed under GNU General Public License version 2 1.8 * 1.9 * Author: seanhalle@yahoo.com 1.10 @@ -19,7 +19,7 @@ 1.11 //uniquely identifies VSs -- should be a jenkins char-hash of "VSs" to int32 1.12 #define VSs_MAGIC_NUMBER 0000000001 1.13 1.14 -#define NUM_STRUCS_IN_SEM_ENV 1000 1.15 +#define NUM_STRUCS_IN_LANG_ENV 1000 1.16 1.17 //This is hardware dependent -- it's the number of cycles of scheduling 1.18 // overhead -- if a work unit is fewer than this, it is better being 1.19 @@ -31,7 +31,7 @@ 1.20 //=========================================================================== 1.21 /*This header defines everything specific to the VSs semantic plug-in 1.22 */ 1.23 -typedef struct _VSsSemReq VSsSemReq; 1.24 +typedef struct _VSsLangReq VSsLangReq; 1.25 typedef struct _VSsTaskStub VSsTaskStub; 1.26 typedef void (*VSsTaskFnPtr ) ( void *, SlaveVP *); 1.27 typedef void (*PtrToAtomicFn ) ( void * ); //executed atomically in master 1.28 @@ -73,11 +73,13 @@ 1.29 } 1.30 VSsPointerEntry; 1.31 1.32 -/*This is placed into semData, used for dependencies and wait construct*/ 1.33 +/*This is placed into langData, used for dependencies and wait construct*/ 1.34 struct _VSsTaskStub 1.35 { 1.36 + //====== The first fields must match PRLangMetaTask fields ====== 1.37 int32 langMagicNumber; //magic num must be 1st field of langMetaTask 1.38 PRMetaTask *protoMetaTask; //back-link must always be 2nd field 1.39 + //====== end PRLangMetaTask fields ========= 1.40 void **args; //ctld args must be the first ones (as ptrs) 1.41 VSsPointerEntry **ptrEntries; 1.42 int32 numBlockingProp; 1.43 @@ -149,7 +151,7 @@ 1.44 trans_end 1.45 }; 1.46 1.47 -struct _VSsSemReq 1.48 +struct _VSsLangReq 1.49 { enum VSsReqType reqType; 1.50 SlaveVP *callingSlv; 1.51 VSsTaskType *taskType; 1.52 @@ -162,7 +164,7 @@ 1.53 int32 *receiverID; 1.54 int32 msgType; 1.55 void *msg; 1.56 - VSsSemReq *nextReqInHashEntry; 1.57 + VSsLangReq *nextReqInHashEntry; 1.58 //In PRReq: int32 *taskID; 1.59 1.60 TopLevelFnPtr fnPtr; 1.61 @@ -181,31 +183,22 @@ 1.62 1.63 int32 transID; 1.64 } 1.65 -/* VSsSemReq */; 1.66 +/* VSsLangReq */; 1.67 1.68 1.69 typedef struct 1.70 - { PRSemEnv *protoSemEnv; 1.71 + { 1.72 PrivQueueStruc *slavesReadyToResumeQ; //Shared (slaves not pinned) 1.73 - PrivQueueStruc *freeTaskSlvRecycleQ; //Shared 1.74 PrivQueueStruc *taskReadyQ; //Shared (tasks not pinned) 1.75 -// SlaveVP *slotTaskSlvs[NUM_CORES][NUM_ANIM_SLOTS]; 1.76 + 1.77 HashTable *argPtrHashTbl; 1.78 HashTable *commHashTbl; 1.79 -// int32 numLiveFreeTaskSlvs; 1.80 -// int32 numLiveThreadSlvs; 1.81 int32 nextCoreToGetNewSlv; 1.82 int32 primitiveStartTime; 1.83 1.84 //fix limit on num with dynArray 1.85 - VSsSingleton fnSingletons[NUM_STRUCS_IN_SEM_ENV]; 1.86 - VSsTrans transactionStrucs[NUM_STRUCS_IN_SEM_ENV]; 1.87 - 1.88 -// bool32 *coreIsDone; 1.89 -// int32 numCoresDone; 1.90 - 1.91 -// SlaveVP* idleSlv[NUM_CORES][NUM_ANIM_SLOTS]; 1.92 -// int shutdownInitiated; 1.93 + VSsSingleton fnSingletons[NUM_STRUCS_IN_LANG_ENV]; 1.94 + VSsTrans transactionStrucs[NUM_STRUCS_IN_LANG_ENV]; 1.95 1.96 #ifdef HOLISTIC__TURN_ON_OBSERVE_UCC 1.97 ListOfArrays* unitList; 1.98 @@ -222,7 +215,7 @@ 1.99 ListOfArrays* counterList[NUM_CORES]; 1.100 #endif 1.101 } 1.102 -VSsSemEnv; 1.103 +VSsLangEnv; 1.104 1.105 1.106 typedef struct _TransListElem TransListElem; 1.107 @@ -248,7 +241,7 @@ 1.108 int32 primitiveStartTime; 1.109 // VSsTaskStub *taskStub; //get from slave via PR accessor 1.110 } 1.111 -VSsSemData; 1.112 +VSsLangData; 1.113 1.114 //=========================================================================== 1.115 1.116 @@ -355,18 +348,14 @@ 1.117 1.118 //========================= Internal use only ============================= 1.119 void 1.120 -VSs__Request_Handler( SlaveVP *requestingSlv, void *_semEnv ); 1.121 +VSs__Request_Handler( SlaveVP *requestingSlv, void *_langEnv ); 1.122 1.123 SlaveVP * 1.124 -VSs__assign_slaveVP_to_slot( void *_semEnv, AnimSlot *slot ); 1.125 +VSs__assign_work_to_slot( void *_langEnv, AnimSlot *slot ); 1.126 1.127 SlaveVP* 1.128 VSs__create_slave_helper( TopLevelFnPtr fnPtr, void *initData, 1.129 - VSsSemEnv *semEnv, int32 coreToAssignOnto ); 1.130 - 1.131 -PRMetaTask * 1.132 -PR_int__create_generic_slave_meta_task( void *initData ); 1.133 - 1.134 + VSsLangEnv *langEnv, int32 coreToAssignOnto ); 1.135 1.136 SlaveVP * 1.137 VSs__create_slave_with( TopLevelFnPtr fnPtr, void *initData, 1.138 @@ -376,6 +365,15 @@ 1.139 VSs__create_slave_with_affinity( TopLevelFnPtr fnPtr, void *initData, 1.140 SlaveVP *creatingSlv, int32 coreToAssignOnto); 1.141 1.142 +//===================== ===================== 1.143 +inline 1.144 +void * 1.145 +handleSubmitTask( VSsLangReq *langReq, VSsLangEnv *langEnv ); 1.146 +inline 1.147 +void 1.148 +handleEndTask( VSsLangReq *langReq, SlaveVP *requestingSlv, VSsLangEnv *langEnv ); 1.149 + 1.150 + 1.151 //===================== Measurement of Lang Overheads ===================== 1.152 #include "Measurement/VSs_Measurement.h" 1.153
