Mercurial > cgi-bin > hgwebdir.cgi > PR > PR_Implementations > PR__Univ > PR__includes > PR__include
changeset 14:9b0e4a786354 ML_lib
update Reo to o1island version, update PI and WL, add ABS wrapper lib
| author | Sean Halle <seanhalle@yahoo.com> |
|---|---|
| date | Tue, 10 Dec 2013 14:17:55 -0800 |
| parents | ad931059d1c4 |
| children | 07d1e42f4379 |
| files | PR__PI.h PR__WL.h langlets/abs_wrapper_library.h langlets/vreo_wrapper_library.h |
| diffstat | 4 files changed, 187 insertions(+), 19 deletions(-) [+] |
line diff
1.1 --- a/PR__PI.h Sun Oct 06 11:26:20 2013 -0700 1.2 +++ b/PR__PI.h Tue Dec 10 14:17:55 2013 -0800 1.3 @@ -106,8 +106,20 @@ 1.4 PR_PI__take_lang_reqst_from( req ) req->langReq 1.5 1.6 void 1.7 +PR_PI__make_slave_ready( SlaveVP *requestingSlv, void *_langEnv ); 1.8 + 1.9 +void 1.10 +PR_PI__make_slave_ready_for_lang( SlaveVP *slave, int32 magicNum ); 1.11 + 1.12 +void 1.13 PR_PI__resume_slave_in_PRServ( SlaveVP *slave ); 1.14 1.15 +void 1.16 +PR_PI__make_task_ready( void *_task, void *_langEnv ); 1.17 + 1.18 +void 1.19 +PR_PI__handle_wait_for_langlets_work_to_end( SlaveVP *slave, void *langEnv ); 1.20 + 1.21 #define \ 1.22 PR_PI__malloc PR_int__malloc 1.23 #define \
2.1 --- a/PR__WL.h Sun Oct 06 11:26:20 2013 -0700 2.2 +++ b/PR__WL.h Tue Dec 10 14:17:55 2013 -0800 2.3 @@ -39,6 +39,12 @@ 2.4 void 2.5 PR__start(); 2.6 2.7 +void 2.8 +PR__set_app_info( char *info ); 2.9 + 2.10 +void 2.11 +PR__set_input_info( char *info ); 2.12 + 2.13 PRProcess * 2.14 PR__create_process( BirthFnPtr seed_Fn, void *seedData ); 2.15
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 3.2 +++ b/langlets/abs_wrapper_library.h Tue Dec 10 14:17:55 2013 -0800 3.3 @@ -0,0 +1,93 @@ 3.4 +/* 3.5 + * Copyright 2009 OpenSourceResearchInstitute.org 3.6 + * Licensed under GNU General Public License version 2 3.7 + * 3.8 + * Author: seanhalle@yahoo.com 3.9 + * 3.10 + */ 3.11 + 3.12 +#ifndef _PRDSL_WRAPPER_H 3.13 +#define _PRDSL_WRAPPER_H 3.14 + 3.15 +#include <PR__include/PR__structs__common.h> 3.16 + 3.17 +//=========================================================================== 3.18 + //uniquely identifies PRDSL -- should be a jenkins char-hash of "PRDSL" to int32 3.19 +#define PRDSL_MAGIC_NUMBER 0000000004 3.20 + 3.21 +typedef struct _PRDSLTaskStub PRDSLTaskStub; 3.22 + 3.23 +//=========================================================================== 3.24 + 3.25 +/*This is PRDSL's "lang meta task" 3.26 + *See the proto-runtime wiki entry to learn about "lang meta task" 3.27 + *In essence, this holds all the meta information that PRDSL needs about a task 3.28 + */ 3.29 +struct _PRDSLTaskStub 3.30 + { 3.31 + void **args; //given to the birth Fn 3.32 + int32 numBlockingProp; 3.33 + PrivQueueStruc *dependentTasksQ; 3.34 + bool32 isActive; //active after done adding propendents 3.35 + bool32 canBeAProp; 3.36 + 3.37 + PRDSLTaskStub *parentTaskStub; //for liveness, for the wait construct 3.38 + int32 numLiveChildTasks; 3.39 + int32 numLiveChildVPs; 3.40 + bool32 isWaitingForChildTasksToEnd; 3.41 + bool32 isWaitingForChildThreadsToEnd; 3.42 + bool32 isEnded; 3.43 + 3.44 +// int32 *taskID; //is in PRMetaTask, in prolog 3.45 + }; 3.46 + 3.47 + 3.48 +//======================= 3.49 + 3.50 +void 3.51 +PRDSL__start( SlaveVP *seedSlv ); 3.52 + 3.53 +void 3.54 +PRDSL__shutdown( SlaveVP *seedSlv ); 3.55 + 3.56 +void 3.57 +PRDSL__wait_for_all_PRDSL_created_work_to_end( SlaveVP *seedSlv ); 3.58 + 3.59 +//======================= 3.60 + 3.61 +SlaveVP * 3.62 +PRDSL__create_thread( BirthFnPtr fnPtr, void *initData, 3.63 + SlaveVP *creatingThd ); 3.64 + 3.65 +void 3.66 +PRDSL__end_thread( SlaveVP *thdToEnd ); 3.67 + 3.68 +//======================= 3.69 + 3.70 +#define PRDSL__malloc( numBytes, callingSlave ) PR_App__malloc( numBytes, callingSlave) 3.71 + 3.72 +#define PRDSL__free(ptrToFree, callingSlave ) PR_App__free( ptrToFree, callingSlave ) 3.73 + 3.74 + 3.75 +//======================= 3.76 +PRDSLTaskStub * 3.77 +PRDSL__create_task_ready_to_run( BirthFnPtr birthFn, void *args, SlaveVP *animSlv); 3.78 + 3.79 +//inline int32 * 3.80 +//PRDSL__create_taskID_of_size( int32 numInts, SlaveVP *animSlv ); 3.81 + 3.82 + 3.83 +void 3.84 +PRDSL__end_task( SlaveVP *animSlv ); 3.85 + 3.86 +//========================= 3.87 +void 3.88 +PRDSL__taskwait(SlaveVP *animSlv); 3.89 + 3.90 + 3.91 +inline int32 * 3.92 +PRDSL__give_self_taskID( SlaveVP *animSlv ); 3.93 + 3.94 +//=========================================================================== 3.95 +#endif 3.96 +
4.1 --- a/langlets/vreo_wrapper_library.h Sun Oct 06 11:26:20 2013 -0700 4.2 +++ b/langlets/vreo_wrapper_library.h Tue Dec 10 14:17:55 2013 -0800 4.3 @@ -10,41 +10,62 @@ 4.4 #define _VREO_WRAPPER_H 4.5 4.6 #include <PR__include/PR__structs__common.h> 4.7 - 4.8 +#include <PR__include/prqueue.h> 4.9 //uniquely identifies VSs -- should be a jenkins char-hash of "VSs" to int32 4.10 #define VReo_MAGIC_NUMBER 0000000003 4.11 4.12 //=========================================================================== 4.13 typedef struct _VReoIsland VReoIsland; 4.14 +typedef struct _VReoO1island VReoO1island; 4.15 +typedef struct _VReoBridge VReoBridge; 4.16 +typedef struct _VReoPartnerQStruct VReoPartnerQStruct; 4.17 4.18 typedef bool32 (*VReoCheckerFn ) ( VReoIsland * ); 4.19 typedef void (*VReoDoerFn ) ( VReoIsland * ); 4.20 +typedef void (*VReoO1islandDoerFn) (VReoO1island *, VReoBridge*, VReoBridge*); //chg to list of bridges 4.21 //=========================================================================== 4.22 +typedef enum 4.23 + { Island, 4.24 + O1island, 4.25 + VP 4.26 + } 4.27 +VReoRWType; 4.28 4.29 -typedef struct 4.30 +struct _VReoBridge 4.31 { 4.32 void *buffer; 4.33 - bool32 portIsFull; 4.34 + bool32 bridgeIsFull; 4.35 SlaveVP *waitingReaderVP; //doubles as flag 4.36 SlaveVP *waitingWriterVP; 4.37 4.38 - void *reader; //either island or VP 4.39 - void *writer; //either island or VP 4.40 - 4.41 + void *reader; //island, o1island, or VP 4.42 + VReoRWType readerType; 4.43 + void *writer; //island, o1island, or VP 4.44 + VReoRWType writerType; 4.45 + 4.46 + //============ For Islands ============= 4.47 int32 numReaderCheckerFns; 4.48 - VReoCheckerFn *readerCheckerFns; //checkers triggered when port state changes 4.49 + VReoCheckerFn *readerCheckerFns; //checkers triggered when bridge state changes 4.50 VReoDoerFn *readerDoerFns; //corresponding doer functions 4.51 4.52 int32 numWriterCheckerFns; 4.53 - VReoCheckerFn *writerCheckerFns; //checkers triggered when port state changes 4.54 - VReoDoerFn *writerDoerFns; //corresponding doer functions 4.55 - } 4.56 -VReoPort; 4.57 - 4.58 + VReoCheckerFn *writerCheckerFns; //checkers triggered when bridge state changes 4.59 + VReoDoerFn *writerDoerFns; //corresponding doer functions 4.60 + 4.61 + //============ For O1islands ============= 4.62 + VReoPartnerQStruct *readerPartnerQStruct; 4.63 + VReoPartnerQStruct *writerPartnerQStruct; 4.64 + //these queues are pointed to by partnerQStructs in other bridges 4.65 + //the bridge is placed into these queues when no partner is found 4.66 + PrivQueueStruc *readerOfferQ; 4.67 + PrivQueueStruc *writerOfferQ; 4.68 + }; 4.69 +//VReoBridge 4.70 + 4.71 struct _VReoIsland 4.72 { 4.73 - int32 numPorts; 4.74 - VReoPort **ports; //array of pointers to port structs 4.75 + int32 numBridges; 4.76 + VReoBridge **bridges; //array of pointers to bridge structs 4.77 4.78 int32 numCheckerFns; 4.79 VReoCheckerFn *checkerFns; //checkers triggered when state changes 4.80 @@ -54,6 +75,33 @@ 4.81 }; 4.82 //VReoIsland 4.83 4.84 + 4.85 +struct _VReoO1island 4.86 + { 4.87 + int32 numBridges; 4.88 + VReoBridge **bridges; //array of pointers to bridge structs 4.89 + 4.90 +// VReoO1islandCheckerFn checkerFn; //checker triggered when state changes 4.91 +// VReoO1islandDoerFn *doerFns; //corresponding doer functions 4.92 + 4.93 + //During search, have to save last Q checked inside each node of 4.94 + // Qstruct.. 4.95 + }; 4.96 +//VReoO1island 4.97 + 4.98 +/*This is expected to change in future.. just quick and simple to get 4.99 + * first version of optimization working. In particular, the way the 4.100 + * doer functions are handled should change. Not clear how to handle them 4.101 + * at this point. 4.102 + */ 4.103 +struct _VReoPartnerQStruct 4.104 + { 4.105 + int32 numQs; 4.106 + PrivQueueStruc **partnerQs; //array of partner Qs, hold bridge ptrs 4.107 + VReoO1islandDoerFn *doerFns; //array of ptrs to doer Fns 4.108 + }; 4.109 +//VReoPartnerQStruct 4.110 + 4.111 typedef struct _VReoListElem VReoListElem; 4.112 4.113 struct _VReoListElem 4.114 @@ -65,13 +113,16 @@ 4.115 4.116 typedef struct 4.117 { 4.118 - int32 numPorts; // 4.119 - VReoPort *ports; //array of port structs 4.120 - VReoPort **boundaryPorts; 4.121 + int32 numBridges; // 4.122 + VReoBridge *bridges; //array of bridge structs 4.123 + VReoBridge **boundaryBridges; 4.124 4.125 int32 numIslands; 4.126 VReoIsland *islands; //array of island structs -- no pointers 4.127 4.128 + int32 numO1islands; 4.129 + VReoO1island *o1islands; //array of O1island structs -- no pointers 4.130 + 4.131 int32 numVPs; 4.132 VReoListElem *VPs; 4.133 4.134 @@ -106,10 +157,10 @@ 4.135 //======================= 4.136 4.137 void 4.138 -VReo__put_into_port( void *itemToPut, VReoPort *port, SlaveVP *callingVP ); 4.139 +VReo__put_into_bridge( void *itemToPut, VReoBridge *bridge, SlaveVP *callingVP ); 4.140 4.141 void * 4.142 -VReo__get_from_port( VReoPort *port, SlaveVP *callingVP ); 4.143 +VReo__get_from_bridge( VReoBridge *bridge, SlaveVP *callingVP ); 4.144 4.145 4.146 4.147 @@ -120,6 +171,12 @@ 4.148 void 4.149 VReo__end_VP( SlaveVP *VPToEnd ); 4.150 4.151 +//================ For use by generated circuit code ================= 4.152 +void 4.153 +o1islandReadBridgeToWrittenBridgeDoer( VReoO1island *o1island, 4.154 + VReoBridge *readBridge, VReoBridge *writtenBridge ); 4.155 + 4.156 + 4.157 //=========================================================================== 4.158 #endif /* _VReo_H */ 4.159
