changeset 79:ee8510009267 Holistic_Model

Merge to get rid of extraneous head
author Sean Halle <seanhalle@yahoo.com>
date Mon, 17 Sep 2012 19:57:40 -0700
parents 833b31a8abc1 0d04c3e608cc
children 494703aecda2
files SSR.c SSR.h
diffstat 2 files changed, 86 insertions(+), 0 deletions(-) [+]
line diff
     1.1 --- a/SSR.c	Tue Aug 28 13:40:07 2012 +0200
     1.2 +++ b/SSR.c	Mon Sep 17 19:57:40 2012 -0700
     1.3 @@ -607,6 +607,65 @@
     1.4   }
     1.5  
     1.6  
     1.7 +//==============================  DKU  ================================
     1.8 +
     1.9 +/*The DKU pattern is instantiated by registering a divider, a kernel,
    1.10 + * and an undivider.  These are done by appropriate VMS_App__ calls.
    1.11 + *For now, think that things like WorkTable will want their own interface
    1.12 + * for divider and undivider.. so here, just do traditional DKU, with the
    1.13 + * DKUPiece data struct (include a field for passing info from divider
    1.14 + * to unidivider)
    1.15 + */
    1.16 +void
    1.17 +VMS_App__register_DKU_divider( DKUID ID, DKUDividerFn dividerFn, 
    1.18 +                               SlaveVP *animSlv )
    1.19 + {
    1.20 +   
    1.21 + }
    1.22 +
    1.23 +/*The kernel has no context, so it's created as a task, but it can
    1.24 + * communicate, so a suspendable task, just like in VSs.
    1.25 + *Will put this DKU into VSs first.. and thinking about forcing every
    1.26 + * language to support both tasks and VPs. 
    1.27 + */
    1.28 +void
    1.29 +VMS_App__register_DKU_kernel( DKUID ID, DKUKernelFn kernelFn, 
    1.30 +                              SlaveVP *animSlv )
    1.31 + {
    1.32 +   
    1.33 + }
    1.34 +
    1.35 +void
    1.36 +VMS_App__register_DKU_undivider( DKUID ID, DKUUndividerFn undividerFn,
    1.37 +                                 SlaveVP *animSlv )
    1.38 + {
    1.39 +   
    1.40 + }
    1.41 +
    1.42 +DKUInst *
    1.43 +VMS_DKU__make_DKU_Instance( DKUInstID DKU_INST_ID )
    1.44 + { int oldSz, i;
    1.45 +   DKUInstStruc **oldArray;
    1.46 +   
    1.47 +   DKUEnvironStruc *E = BLIS__BLISEnvironment->DKUEnvironment;
    1.48 +   
    1.49 +   if( E->numDKUInstances <= DKU_INST_ID) E->numDKUInstances = DKU_INST_ID+1;
    1.50 +   if( DKU_INST_ID >= E->instArraySz )
    1.51 +    { //full, so make bigger
    1.52 +      oldSz            = E->instArraySz;
    1.53 +      oldArray         = E->DKUInstStrucs;
    1.54 +      E->instArraySz  *= 2;
    1.55 +      E->DKUInstStrucs = malloc( E->instArraySz * sizeof(DKUInstStruc *) );
    1.56 +      for( i = 0; i < oldSz; i++ )
    1.57 +       { E->DKUInstStrucs[i] = oldArray[i];
    1.58 +       }
    1.59 +      free( oldArray );
    1.60 +    }
    1.61 +   E->DKUInstStrucs[ DKU_INST_ID ] = makeDKUInstStruc( DKU_INST_ID );
    1.62 +   return E->DKUInstStrucs[ DKU_INST_ID ];
    1.63 + }
    1.64 +
    1.65 +
    1.66  //===========================================================================
    1.67  //
    1.68  /*A function singleton is a function whose body executes exactly once, on a
     2.1 --- a/SSR.h	Tue Aug 28 13:40:07 2012 +0200
     2.2 +++ b/SSR.h	Mon Sep 17 19:57:40 2012 -0700
     2.3 @@ -140,6 +140,18 @@
     2.4  SSRSemEnv;
     2.5  
     2.6  
     2.7 +typedef struct _DKUPiece DKUPiece;
     2.8 +
     2.9 +typedef DKUPiece *  (*DKUDividerFn )   ( DKUPiece * );
    2.10 +
    2.11 +struct _DKUPiece
    2.12 + { 
    2.13 +   void      *workData;
    2.14 +   DKUPiece **subPieces;
    2.15 +   void      *infoForUndiv; //app creates own struct and casts
    2.16 + };
    2.17 +//DKUPiece
    2.18 + 
    2.19  typedef struct _TransListElem TransListElem;
    2.20  struct _TransListElem
    2.21   {
    2.22 @@ -233,6 +245,21 @@
    2.23  SSR__receive_from_to( SlaveVP *sendPr, SlaveVP *receiveSlv );
    2.24  
    2.25  
    2.26 +
    2.27 +//===========================  DKU  ==============================
    2.28 +void
    2.29 +VMS_App__register_DKU_divider( DKUID ID, DKUDividerFn dividerFn, 
    2.30 +                               SlaveVP *animSlv );
    2.31 +void
    2.32 +VMS_App__register_DKU_kernel( DKUID ID, DKUKernelFn kernelFn, 
    2.33 +                              SlaveVP *animSlv );
    2.34 +
    2.35 +void
    2.36 +VMS_App__register_DKU_undivider( DKUID ID, DKUUndividerFn undividerFn,
    2.37 +                                 SlaveVP *animSlv );
    2.38 +
    2.39 +
    2.40 +
    2.41  //======================= Concurrency Stuff ======================
    2.42  void
    2.43  SSR__start_fn_singleton( int32 singletonID, SlaveVP *animSlv );