changeset 6:f278511770ce ML_lib

New Branch -- ML_lib -- for library version of Multi Lang -- works
author Sean Halle <seanhalle@yahoo.com>
date Sun, 15 Sep 2013 11:29:54 -0700
parents c390d605702c
children bc0d410c3f58 9d607381c7ca
files PR__structs__common.h Services_offered_by_PR/MEAS__Counter_Recording.h __brch__Dev_Univ __brch__ML_lib langlets/PRServ__wrapper_library.h langlets/vreo_wrapper_library.h
diffstat 6 files changed, 122 insertions(+), 169 deletions(-) [+]
line diff
     1.1 --- a/PR__structs__common.h	Sun Sep 15 07:20:10 2013 -0700
     1.2 +++ b/PR__structs__common.h	Sun Sep 15 11:29:54 2013 -0700
     1.3 @@ -244,7 +244,7 @@
     1.4     PRLangData  **langDatas;  //Lang saves lang-specific things in slave here
     1.5     PRMetaTask  **metaTasks;
     1.6  
     1.7 -   PRGhostInfo  *ghostInfo;
     1.8 +//   PRGhostInfo  *ghostInfo;
     1.9     
    1.10          //=========== MEASUREMENT STUFF ==========
    1.11           MEAS__Insert_Meas_Fields_into_Slave;
     2.1 --- a/Services_offered_by_PR/MEAS__Counter_Recording.h	Sun Sep 15 07:20:10 2013 -0700
     2.2 +++ b/Services_offered_by_PR/MEAS__Counter_Recording.h	Sun Sep 15 11:29:54 2013 -0700
     2.3 @@ -8,7 +8,7 @@
     2.4  #ifndef MEAS__COUNTER_RECORDING_H
     2.5  #define	MEAS__COUNTER_RECORDING_H
     2.6  
     2.7 -#include "PR__common_includes/PR__common_structs.h"
     2.8 +#include <PR__include/PR__structs__common.h>
     2.9  
    2.10  typedef struct 
    2.11   {
     3.1 --- a/__brch__Dev_Univ	Sun Sep 15 07:20:10 2013 -0700
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,28 +0,0 @@
     3.4 -This branch is for developing the multi-language capability in VMS.  The idea is to define langlets, whose constructs can be freely mixed together inside application code.  No need to separate into distinct modules.  A single function can use constructs from all the different langlets together inside itself.
     3.5 -
     3.6 -
     3.7 -========  Background on branch naming  =========
     3.8 -
     3.9 -There are two kinds of branchs: ones used to develop features, and ones tuned to particular hardware.  A given HW branch may combine features from several feature-branches, picking and choosing among them.
    3.10 -
    3.11 -After Feb 2012, branches are named by the scheme:
    3.12 -
    3.13 -feat__<feat_descr>__<HW_feat_dev_on>
    3.14 -
    3.15 -HW__<desc_of_HW_brch_tuned_for>
    3.16 -
    3.17 -where <HW_feat_dev_on> and <desc_of_HW_brch_tuned_for> follow the pattern:
    3.18 -
    3.19 -<num_socket> x <num_cores>_<Manuf>_<special_features>
    3.20 -
    3.21 -Examples:
    3.22 -
    3.23 -feat__exp_array_malloc
    3.24 -
    3.25 -feat__rand_backoff__4x10_Intel_WestmereEx
    3.26 -
    3.27 -HW__1x4_Intel_SandyBridge
    3.28 -
    3.29 -HW__4x10_Intel_WestmereEx
    3.30 -
    3.31 -HW__1x4_AMD_mobile
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/__brch__ML_lib	Sun Sep 15 11:29:54 2013 -0700
     4.3 @@ -0,0 +1,28 @@
     4.4 +This branch is for developing the multi-language capability in VMS.  The idea is to define langlets, whose constructs can be freely mixed together inside application code.  No need to separate into distinct modules.  A single function can use constructs from all the different langlets together inside itself.
     4.5 +
     4.6 +
     4.7 +========  Background on branch naming  =========
     4.8 +
     4.9 +There are two kinds of branchs: ones used to develop features, and ones tuned to particular hardware.  A given HW branch may combine features from several feature-branches, picking and choosing among them.
    4.10 +
    4.11 +After Feb 2012, branches are named by the scheme:
    4.12 +
    4.13 +feat__<feat_descr>__<HW_feat_dev_on>
    4.14 +
    4.15 +HW__<desc_of_HW_brch_tuned_for>
    4.16 +
    4.17 +where <HW_feat_dev_on> and <desc_of_HW_brch_tuned_for> follow the pattern:
    4.18 +
    4.19 +<num_socket> x <num_cores>_<Manuf>_<special_features>
    4.20 +
    4.21 +Examples:
    4.22 +
    4.23 +feat__exp_array_malloc
    4.24 +
    4.25 +feat__rand_backoff__4x10_Intel_WestmereEx
    4.26 +
    4.27 +HW__1x4_Intel_SandyBridge
    4.28 +
    4.29 +HW__4x10_Intel_WestmereEx
    4.30 +
    4.31 +HW__1x4_AMD_mobile
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/langlets/PRServ__wrapper_library.h	Sun Sep 15 11:29:54 2013 -0700
     5.3 @@ -0,0 +1,92 @@
     5.4 +/*
     5.5 + *  Copyright 2009 OpenSourceResearchInstitute.org
     5.6 + *  Licensed under GNU General Public License version 2
     5.7 + *
     5.8 + * Author: seanhalle@yahoo.com
     5.9 + *
    5.10 + */
    5.11 +
    5.12 +#ifndef _PRServ_wrapper_library_H
    5.13 +#define	_PRServ_wrapper_library_H
    5.14 +
    5.15 +#include <PR__include/PR__structs__common.h>
    5.16 +
    5.17 +
    5.18 +//===========================================================================
    5.19 +typedef void  (*PtrToAtomicFn )  ( void * ); //executed atomically in master
    5.20 +
    5.21 +/*WARNING: assembly hard-codes position of endInstrAddr as first field
    5.22 + */
    5.23 +typedef struct
    5.24 + {
    5.25 +   void           *endInstrAddr;
    5.26 +   int32           hasBeenStarted;
    5.27 +   int32           hasFinished;
    5.28 +   PrivQueueStruc *waitQ;
    5.29 + }
    5.30 +PRServSingleton;
    5.31 +
    5.32 + 
    5.33 +//===========================================================================
    5.34 +
    5.35 +int32
    5.36 +PRServ__giveMinWorkUnitCycles( float32 percentOverhead );
    5.37 +
    5.38 +void
    5.39 +PRServ__begin_primitive();
    5.40 +
    5.41 +int32
    5.42 +PRServ__end_primitive_and_give_cycles();
    5.43 +
    5.44 +int32
    5.45 +PRServ__giveIdealNumWorkUnits();
    5.46 +
    5.47 +int32
    5.48 +PRServ__give_number_of_cores_to_schedule_onto();
    5.49 +
    5.50 +char *
    5.51 +PRServ___give_environment_string();
    5.52 +
    5.53 +//=======================
    5.54 +
    5.55 +void
    5.56 +PRServ__end_seedVP( SlaveVP *seedSlv );
    5.57 +//=======================
    5.58 +
    5.59 +inline int32 *
    5.60 +PRServ__create_taskID_of_size( int32 numInts, SlaveVP *animSlv );
    5.61 +
    5.62 +//=========================
    5.63 +void
    5.64 +PRServ__taskwait(SlaveVP *animSlv);
    5.65 +
    5.66 +inline int32 *
    5.67 +PRServ__give_self_taskID( SlaveVP *animSlv );
    5.68 +
    5.69 +//======================= Concurrency Stuff ======================
    5.70 +void
    5.71 +PRServ__start_fn_singleton( int32 singletonID, SlaveVP *animSlv );
    5.72 +
    5.73 +void
    5.74 +PRServ__end_fn_singleton( int32 singletonID, SlaveVP *animSlv );
    5.75 +
    5.76 +void
    5.77 +PRServ__start_data_singleton( PRServSingleton **singeltonAddr, SlaveVP *animSlv );
    5.78 +
    5.79 +void
    5.80 +PRServ__end_data_singleton( PRServSingleton **singletonAddr, SlaveVP *animSlv );
    5.81 +
    5.82 +void
    5.83 +PRServ__animate_short_fn_in_isolation( PtrToAtomicFn ptrToFnToExecInMaster,
    5.84 +                                    void *data, SlaveVP *animSlv );
    5.85 +
    5.86 +void
    5.87 +PRServ__start_transaction( int32 transactionID, SlaveVP *animSlv );
    5.88 +
    5.89 +void
    5.90 +PRServ__end_transaction( int32 transactionID, SlaveVP *animSlv );
    5.91 +
    5.92 +
    5.93 +//===========================================================================
    5.94 +#endif	/* _PRServ_H */
    5.95 +
     6.1 --- a/langlets/vreo_wrapper_library.h	Sun Sep 15 07:20:10 2013 -0700
     6.2 +++ b/langlets/vreo_wrapper_library.h	Sun Sep 15 11:29:54 2013 -0700
     6.3 @@ -10,51 +10,17 @@
     6.4  #define	_VREO_WRAPPER_H
     6.5  
     6.6  #include <PR__include/PR__structs__common.h>
     6.7 -//#include <PR__include/prqueue.h>
     6.8 -//#include <PR__include/prhash.h>
     6.9 -//#include "Measurement/dependency.h"
    6.10  
    6.11     //uniquely identifies VSs -- should be a jenkins char-hash of "VSs" to int32
    6.12  #define VReo_MAGIC_NUMBER 0000000003
    6.13  
    6.14  //===========================================================================
    6.15 -/*
    6.16 -   //uniquely identifies VSs -- should be a jenkins char-hash of "VSs" to int32
    6.17 -#define VReo_MAGIC_NUMBER 0000000003
    6.18 -
    6.19 -#define NUM_STRUCS_IN_LANG_ENV 1000
    6.20 -
    6.21 -   //This is hardware dependent -- it's the number of cycles of scheduling
    6.22 -   // overhead -- if a work unit is fewer than this, it is better being
    6.23 -   // combined sequentially with other work
    6.24 -   //This value depends on both PR overhead and VSs's plugin.  At some point
    6.25 -   // it will be derived by perf-counter measurements during init of VSs
    6.26 -#define MIN_WORK_UNIT_CYCLES 20000
    6.27 -*/
    6.28 -
    6.29 -//===========================================================================
    6.30 -/*This header defines everything specific to the VReo semantic plug-in
    6.31 - */
    6.32  typedef struct _VReoIsland VReoIsland;
    6.33  
    6.34 -//typedef struct _VReoLangReq   VReoLangReq;
    6.35 -//typedef struct _VReoTaskStub  VReoTaskStub;
    6.36 -//typedef void   (*VReoTaskFnPtr ) ( void *, SlaveVP *);
    6.37  typedef bool32 (*VReoCheckerFn ) ( VReoIsland * );
    6.38  typedef void   (*VReoDoerFn )    ( VReoIsland * );
    6.39  //===========================================================================
    6.40  
    6.41 -/*
    6.42 -#define IS_A_VP NULL
    6.43 -#define IS_ENDED    NULL
    6.44 -#define SEED_SLV    NULL
    6.45 -
    6.46 -#define NO_ID       NULL
    6.47 -#define ANY_CORE    -1
    6.48 -*/
    6.49 -
    6.50 -//===========================================================================
    6.51 -
    6.52  typedef struct
    6.53   {
    6.54     void          *buffer;
    6.55 @@ -123,88 +89,6 @@
    6.56     VReoCircuit *circuit; 
    6.57   }
    6.58  VReoBirthParams;
    6.59 -
    6.60 -/*This is VReo's "lang meta task"
    6.61 - *See the proto-runtime wiki entry to learn about "lang meta task"
    6.62 - *In essence, this holds all the meta information that VReo needs about a task
    6.63 - */
    6.64 -/*
    6.65 -struct _VReoTaskStub
    6.66 - {   
    6.67 -   VReoTaskStub *parentTaskStub; //for liveness, for the wait construct
    6.68 -   int32         numLiveChildTasks;
    6.69 -   int32         numLiveChildVPs;
    6.70 -   bool32        isWaitingForChildTasksToEnd;
    6.71 -   bool32        isWaitingForChildVPsToEnd;
    6.72 -   bool32        isEnded;
    6.73 - };
    6.74 -*/
    6.75 -
    6.76 -
    6.77 -/*Semantic-layer-specific data sent inside a request from lib call in app
    6.78 - * to request handler called in AnimationMaster
    6.79 - */
    6.80 -/*
    6.81 -struct _VReoLangReq
    6.82 - { 
    6.83 -   SlaveVP           *callingVP;
    6.84 -      
    6.85 -   BirthFnPtr      fnPtr;
    6.86 -   void              *initData;
    6.87 -   int32              coreToAssignOnto;
    6.88 -   int32              createSuspendedGroup;
    6.89 -   
    6.90 -   VReoCircuit       *circuit;
    6.91 -   VReoPort          *port;
    6.92 -   void              *itemToPut;
    6.93 - }
    6.94 -*/
    6.95 -/* VReoLangReq */;
    6.96 -
    6.97 -
    6.98 -/*
    6.99 -typedef struct
   6.100 - { 
   6.101 -   PrivQueueStruc  *slaveReadyQ; //Shared (slaves not pinned)
   6.102 -   PrivQueueStruc  *taskReadyQ;  //Shared (tasks not pinned)
   6.103 -   
   6.104 -   int32            nextCoreToGetNewSlv;
   6.105 -   int32            primitiveStartTime;
   6.106 -   
   6.107 -   VReoCircuit     *circuit; //used during debugging, to get access when no work
   6.108 -   
   6.109 -   #ifdef HOLISTIC__TURN_ON_OBSERVE_UCC
   6.110 -   ListOfArrays* unitList;
   6.111 -   ListOfArrays* ctlDependenciesList;
   6.112 -   ListOfArrays* commDependenciesList;
   6.113 -   NtoN** ntonGroups;
   6.114 -   PrivDynArrayInfo* ntonGroupsInfo;
   6.115 -   ListOfArrays* dynDependenciesList;
   6.116 -   Unit last_in_slot[NUM_CORES * NUM_ANIM_SLOTS];
   6.117 -   ListOfArrays* hwArcs;
   6.118 -   #endif
   6.119 -
   6.120 -   #ifdef HOLISTIC__TURN_ON_PERF_COUNTERS
   6.121 -   ListOfArrays* counterList[NUM_CORES];
   6.122 -   #endif
   6.123 - }
   6.124 -VReoLangEnv;
   6.125 -
   6.126 -
   6.127 -typedef struct
   6.128 - {
   6.129 -   VReoCircuit *circuit;
   6.130 -   int32  numPorts;
   6.131 -   int32 *ports;
   6.132 - }
   6.133 -VReoVPParams;
   6.134 - 
   6.135 -typedef struct
   6.136 - {
   6.137 -   VReoVPParams *params; //keep here, so can free when end VP
   6.138 - }
   6.139 -VReoLangData;
   6.140 -*/
   6.141                   
   6.142  //===========================================================================
   6.143  
   6.144 @@ -236,29 +120,6 @@
   6.145  void
   6.146  VReo__end_VP( SlaveVP *VPToEnd );
   6.147  
   6.148 -
   6.149 -//=======================
   6.150 -
   6.151 -
   6.152 -//=========================  Internal use only  =============================
   6.153 -/*
   6.154 -bool32
   6.155 -VReo__assign_work_to_slot( void *_langEnv, AnimSlot *slot );
   6.156 -
   6.157 -SlaveVP *
   6.158 -VReo__create_slave_with_affinity( BirthFnPtr fnPtr,    void *initData,
   6.159 -                            SlaveVP *creatingSlv, int32 coreToAssignOnto);
   6.160 -
   6.161 -void
   6.162 -VReo__cleanup_after_shutdown();
   6.163 -
   6.164 -//=====================    =====================
   6.165 -
   6.166 -#include "VReo_Request_Handlers.h"
   6.167 -
   6.168 -//=====================  Measurement of Lang Overheads  =====================
   6.169 -#include "Measurement/VReo_Measurement.h"
   6.170 -*/
   6.171  //===========================================================================
   6.172  #endif	/* _VReo_H */
   6.173