mlp system changes
authorjjenista <jjenista>
Tue, 28 Jul 2009 00:01:01 +0000 (00:01 +0000)
committerjjenista <jjenista>
Tue, 28 Jul 2009 00:01:01 +0000 (00:01 +0000)
Robust/src/Analysis/MLP/MLPAnalysis.java
Robust/src/IR/Flat/BuildCode.java
Robust/src/IR/Flat/FlatSESEEnterNode.java
Robust/src/Runtime/mlp_runtime.c
Robust/src/Runtime/mlp_runtime.h
Robust/src/Tests/mlp/tinyTest/makefile
Robust/src/Tests/mlp/tinyTest/test.java

index 98629ce879518a76b94b438d13739d5724b333e0..cca23e91f977fcda81c3bd793ec68e5625db996b 100644 (file)
@@ -202,7 +202,9 @@ public class MLPAnalysis {
       FlatSESEEnterNode fsen = (FlatSESEEnterNode) fn;
 
       allSESEs.add( fsen );
-      fsen.setEnclosingFlatMeth( fm );
+      fsen.setfmEnclosing( fm );
+      fsen.setmdEnclosing( fm.getMethod() );
+      fsen.setcdEnclosing( fm.getMethod().getClassDesc() );
 
       if( !seseStack.empty() ) {
        seseStack.peek().addChild( fsen );
index 7ccde1988e6408136acf4ff14d4f5f606a5f7112..49a38393794b46a49acbdc48f040bd6aaae70c70 100644 (file)
@@ -65,7 +65,6 @@ public class BuildCode {
   String mlperrstr = "if(status != 0) { "+
     "sprintf(errmsg, \"MLP error at %s:%d\", __FILE__, __LINE__); "+
     "perror(errmsg); exit(-1); }";
-  Hashtable<FlatSESEEnterNode, FlatMethod> sese2bogusFlatMeth;
   boolean nonSESEpass=true;
   WriteBarrier wb;
   DiscoverConflicts dc;
@@ -121,10 +120,6 @@ public class BuildCode {
       recorddc=new DiscoverConflicts(locality, st, typeanalysis, delaycomp.getCannotDelayMap(), true, true, null);
       recorddc.doAnalysis();
     }
-
-    if(state.MLP) {
-      sese2bogusFlatMeth = new Hashtable<FlatSESEEnterNode, FlatMethod>();
-    }
   }
 
   /** The buildCode method outputs C code for all the methods.  The Flat
@@ -378,11 +373,9 @@ public class BuildCode {
       outmethod.println("pthread_exit(NULL);");
 
     if (state.MLP) {
-      outmethod.println("  mlpInit( "+state.MLP_NUMCORES+", "+
-                       "invokeSESEmethod, "+
-                       "argc, "+
-                       "argv, "+
-                       state.MLP_MAXSESEAGE+" );");
+      outmethod.println("  workScheduleInit( "+state.MLP_NUMCORES+", invokeSESEmethod );");
+      // issue root SESE
+      outmethod.println("  workScheduleBegin();");
     }
 
     outmethod.println("}");
@@ -1655,78 +1648,6 @@ public class BuildCode {
     output.println("}\n\n");
   }
 
-  // when a new mlp thread is created for an issued SESE, it is started
-  // by running this method which blocks on a cond variable until
-  // it is allowed to transition to execute.  Then a case statement
-  // allows it to invoke the method with the proper SESE body, and after
-  // exiting the SESE method, executes proper SESE exit code before the
-  // thread can be destroyed
-  private void generateSESEinvocationMethod(PrintWriter outmethodheader,
-                                            PrintWriter outmethod
-                                            ) {
-
-    outmethodheader.println("void invokeSESEmethod( void* seseRecord );");
-    outmethod.println(      "void invokeSESEmethod( void* seseRecord ) {");
-    outmethod.println(      "  int status;");
-    outmethod.println(      "  char errmsg[128];");
-    outmethod.println(      "  SESErecord* rec = (SESErecord*) seseRecord;");
-
-    // generate a case for each SESE class that can be invoked
-    outmethod.println(      "  switch( rec->classID ) {");
-    outmethod.println(      "    ");
-    for(Iterator<FlatSESEEnterNode> seseit=mlpa.getAllSESEs().iterator();seseit.hasNext();) {
-      FlatSESEEnterNode fsen = seseit.next();
-      outmethod.println(    "    /* "+fsen.getPrettyIdentifier()+" */");
-      outmethod.println(    "    case "+fsen.getIdentifier()+":");
-      generateSESEinvocation(fsen, outmethod);
-      outmethod.println(    "      break;");
-      outmethod.println(    "");
-    }
-
-    // default case should never be taken, error out
-    outmethod.println(      "    default:");
-    outmethod.println(      "      printf(\"Error: unknown SESE class ID in invoke method.\\n\");");
-    outmethod.println(      "      exit(-30);");
-    outmethod.println(      "      break;");
-    outmethod.println(      "  }");
-    outmethod.println(      "}\n\n");
-  }
-
-  private void generateSESEinvocation(FlatSESEEnterNode fsen,
-                                      PrintWriter output
-                                      ) {
-    /*
-    FlatMethod       fm = fsen.getEnclosingFlatMeth();
-    MethodDescriptor md = fm.getMethod();
-    ClassDescriptor  cn = md.getClassDesc();
-
-    FlatMethod       bogusfm  = sese2bogusFlatMeth.get(fsen);
-    MethodDescriptor bogusmd  = bogusfm.getMethod();
-    ParamsObject objectparams = (ParamsObject)paramstable.get(bogusmd);
-
-    // first copy SESE record into param structure
-
-
-    // then invoke the sese's method
-    output.print("      "+cn.getSafeSymbol()+bogusmd.getSafeSymbol()+"_"+bogusmd.getSafeMethodDescriptor());
-    output.print("( args->invokee, ");
-
-    // first argument is parameter structure
-    output.print("(struct "+cn.getSafeSymbol()+bogusmd.getSafeSymbol()+"__params*)");
-    output.print("&(args->invokee->paramStruct)");
-
-    // other arguments are primitive parameters
-    for(int i=0; i<objectparams.numPrimitives(); i++) {
-      TempDescriptor td=objectparams.getPrimitive(i);
-      TypeDescriptor type=td.getType();
-      assert type.isPrimitive();
-      output.print( ", (("+fsen.namespaceStructNameString()+
-                      "*)args->invokee->namespace)->"+td );
-    }
-    
-    output.println(");");
-    */
-  }
 
   protected void generateMethodSESE(FlatSESEEnterNode fsen,
                                     LocalityBinding lb,
@@ -1734,40 +1655,51 @@ public class BuildCode {
                                     PrintWriter outputMethHead,
                                     PrintWriter outputMethods
                                     ) {
-    
-    FlatMethod       fm = fsen.getEnclosingFlatMeth();
+
+    FlatMethod       fm = fsen.getfmEnclosing();
     MethodDescriptor md = fm.getMethod();
     ClassDescriptor  cn = md.getClassDesc();
     
         
     // Creates bogus method descriptor to index into tables
-    Modifiers bogusmod=new Modifiers();
-    MethodDescriptor bogusmd=new MethodDescriptor(bogusmod, 
-                                                  new TypeDescriptor(TypeDescriptor.VOID), 
-                                                  "sese_"+fsen.getPrettyIdentifier()+fsen.getIdentifier());
-    bogusmd.setClassDesc(cn);
-    FlatMethod bogusfm=new FlatMethod(bogusmd, null);
-    sese2bogusFlatMeth.put(fsen, bogusfm);
+    Modifiers modBogus = new Modifiers();
+    MethodDescriptor mdBogus = 
+      new MethodDescriptor( modBogus, 
+                           new TypeDescriptor( TypeDescriptor.VOID ), 
+                           "sese_"+fsen.getPrettyIdentifier()+fsen.getIdentifier()
+                           );
+    
+    mdBogus.setClassDesc( fsen.getcdEnclosing() );
+    FlatMethod fmBogus = new FlatMethod( mdBogus, null );
+    fsen.setfmBogus( fmBogus );
+    fsen.setmdBogus( mdBogus );
 
 
     // Build paramsobj for bogus method descriptor
-    ParamsObject objectparams=new ParamsObject(bogusmd, tag++);
-    paramstable.put(bogusmd, objectparams);
+    ParamsObject objectparams = new ParamsObject( mdBogus, tag++ );
+    paramstable.put( mdBogus, objectparams );
     
-    for(int i=0; i<fsen.numParameters(); i++) {
-      TempDescriptor temp=fsen.getParameter(i);
-      TypeDescriptor type=temp.getType();
-      if (type.isPtr()&&GENERATEPRECISEGC) {
-       objectparams.addPtr(temp);
+    Set<TempDescriptor> inSetAndOutSet = new HashSet<TempDescriptor>();
+    inSetAndOutSet.addAll( fsen.getInVarSet() );
+    inSetAndOutSet.addAll( fsen.getOutVarSet() );
+
+    Set<TempDescriptor> inSetAndOutSetPrims = new HashSet<TempDescriptor>();
+
+    Iterator<TempDescriptor> itr = inSetAndOutSet.iterator();
+    while( itr.hasNext() ) {
+      TempDescriptor temp = itr.next();
+      TypeDescriptor type = temp.getType();
+      if( type.isPtr() ) {
+       objectparams.addPtr( temp );
       } else {
-       objectparams.addPrim(temp);
+       inSetAndOutSetPrims.add( temp );
       }
     }
     
     
     // Build normal temp object for bogus method descriptor
-    TempObject objecttemps=new TempObject(objectparams,bogusmd,tag++);
-    tempstable.put(bogusmd, objecttemps);
+    TempObject objecttemps = new TempObject( objectparams, mdBogus, tag++ );
+    tempstable.put( mdBogus, objecttemps );
     
     for(Iterator nodeit=fsen.getNodeSet().iterator(); nodeit.hasNext();) {
       FlatNode fn=(FlatNode)nodeit.next();
@@ -1782,14 +1714,36 @@ public class BuildCode {
       }
     }
     
-    // declare namespace struct
-    outputStructs.println(fsen.namespaceStructDeclarationString());
+    // generate the SESE record structure
+    outputStructs.println(fsen.getSESErecordName()+" {");
     
-    // Generate code for parameters structure
-    generateMethodParam(cn, bogusmd, null, outputStructs);
+    // class ID comes first
+    outputStructs.println("  int classID;");
 
-    // Generate code for locals structure
-    outputStructs.println("struct "+cn.getSafeSymbol()+bogusmd.getSafeSymbol()+"_"+bogusmd.getSafeMethodDescriptor()+"_locals {");
+    // then garbage list stuff
+    outputStructs.println("  INTPTR size;");
+    outputStructs.println("  void * next;");
+
+    for(int i=0; i<objectparams.numPointers(); i++) {
+      TempDescriptor temp=objectparams.getPointer(i);
+      if (temp.getType().isNull())
+        outputStructs.println("  void * "+temp.getSafeSymbol()+";");
+      else
+        outputStructs.println("  struct "+temp.getType().getSafeSymbol()+" * "+temp.getSafeSymbol()+";");
+    }
+    
+    // then other SESE runtime data
+    Iterator<TempDescriptor> itrPrims = inSetAndOutSetPrims.iterator();
+    while( itrPrims.hasNext() ) {
+      TempDescriptor temp = itrPrims.next();
+      TypeDescriptor type = temp.getType();
+      outputStructs.println("  "+temp.getType().getSafeSymbol()+" "+temp.getSafeSymbol()+";");
+    }
+
+    outputStructs.println("};\n");
+
+    // generate locals structure
+    outputStructs.println("struct "+cn.getSafeSymbol()+mdBogus.getSafeSymbol()+"_"+mdBogus.getSafeMethodDescriptor()+"_locals {");
     outputStructs.println("  INTPTR size;");
     outputStructs.println("  void * next;");
     for(int i=0; i<objecttemps.numPointers(); i++) {
@@ -1804,8 +1758,10 @@ public class BuildCode {
 
     // write method declaration to header file
     outputMethHead.print("void ");
-    outputMethHead.print(cn.getSafeSymbol()+bogusmd.getSafeSymbol()+"_"+bogusmd.getSafeMethodDescriptor()+"(");
-    outputMethHead.print("SESErecord* currentSESE, ");
+    outputMethHead.print(fsen.getSESEmethodName()+"(");
+    outputMethHead.print(fsen.getSESErecordName()+"* currentSESE ");
+
+    /*
     boolean printcomma=false;
     if (GENERATEPRECISEGC) {
       outputMethHead.print("struct "+cn.getSafeSymbol()+
@@ -1824,29 +1780,35 @@ public class BuildCode {
       else
        outputMethHead.print(temp.getType().getSafeSymbol()+" "+temp.getSafeSymbol());
     }
-    outputMethHead.println(");\n");
+    */
 
+    outputMethHead.println(");\n");
 
-    generateFlatMethodSESE(bogusfm, cn, fsen, fsen.getFlatExit(), outputMethods);
+    generateFlatMethodSESE(fmBogus, cn, fsen, fsen.getFlatExit(), outputMethods);
   }
 
   private void generateFlatMethodSESE(FlatMethod fm, 
                                       ClassDescriptor cn, 
-                                      FlatSESEEnterNode seseEnter
+                                      FlatSESEEnterNode fsen
                                       FlatSESEExitNode  seseExit, 
                                       PrintWriter output
                                       ) {
 
     MethodDescriptor md=fm.getMethod();
-    ParamsObject objectparams=(ParamsObject)paramstable.get(md);
-    generateHeader(fm, null, md, output, true);
-    TempObject objecttemp=(TempObject) tempstable.get(md);
 
+    //generateHeader(fm, null, md, output, true);
+
+    output.print("void ");
+    output.print(fsen.getSESEmethodName()+"(");
+    output.print(fsen.getSESErecordName()+"* currentSESE ");
+    output.println("){\n");
+
+    TempObject objecttemp=(TempObject) tempstable.get(md);
 
     if (GENERATEPRECISEGC) {
       output.print("   struct "+cn.getSafeSymbol()+md.getSafeSymbol()+"_"+md.getSafeMethodDescriptor()+"_locals "+localsprefix+"={");
       output.print(objecttemp.numPointers()+",");
-      output.print(paramsprefix);
+      output.print("(void*) &(currentSESE->size)");
       for(int j=0; j<objecttemp.numPointers(); j++)
        output.print(", NULL");
       output.println("};");
@@ -1865,12 +1827,13 @@ public class BuildCode {
 
 
     // declare variables for naming SESE's
-    Iterator<SESEandAgePair> pItr = seseEnter.getNeededStaticNames().iterator();
+    /*
+    Iterator<SESEandAgePair> pItr = fsen.getNeededStaticNames().iterator();
     while( pItr.hasNext() ) {
       SESEandAgePair p = pItr.next();
       output.println("   SESErecord* "+p+";");
     }
-    
+    */
 
     // Check to see if we need to do a GC if this is a
     // multi-threaded program...    
@@ -1883,12 +1846,52 @@ public class BuildCode {
 
     HashSet<FlatNode> exitset=new HashSet<FlatNode>();
     exitset.add(seseExit);
-    generateCode(seseEnter.getNext(0), fm, null, exitset, output, true);
+    generateCode(fsen.getNext(0), fm, null, exitset, output, true);
 
     
     output.println("}\n\n");
   }
 
+
+  // when a new mlp thread is created for an issued SESE, it is started
+  // by running this method which blocks on a cond variable until
+  // it is allowed to transition to execute.  Then a case statement
+  // allows it to invoke the method with the proper SESE body, and after
+  // exiting the SESE method, executes proper SESE exit code before the
+  // thread can be destroyed
+  private void generateSESEinvocationMethod(PrintWriter outmethodheader,
+                                            PrintWriter outmethod
+                                            ) {
+
+    outmethodheader.println("void* invokeSESEmethod( void* seseRecord );");
+    outmethod.println(      "void* invokeSESEmethod( void* seseRecord ) {");
+    outmethod.println(      "  int status;");
+    outmethod.println(      "  char errmsg[128];");
+
+    // generate a case for each SESE class that can be invoked
+    outmethod.println(      "  switch( *((int*)seseRecord) ) {");
+    outmethod.println(      "    ");
+    for(Iterator<FlatSESEEnterNode> seseit=mlpa.getAllSESEs().iterator();seseit.hasNext();) {
+      FlatSESEEnterNode fsen = seseit.next();
+
+      outmethod.println(    "    /* "+fsen.getPrettyIdentifier()+" */");
+      outmethod.println(    "    case "+fsen.getIdentifier()+":");
+      outmethod.println(    "      "+fsen.getSESEmethodName()+"( seseRecord );");  
+      outmethod.println(    "      break;");
+      outmethod.println(    "");
+    }
+
+    // default case should never be taken, error out
+    outmethod.println(      "    default:");
+    outmethod.println(      "      printf(\"Error: unknown SESE class ID in invoke method.\\n\");");
+    outmethod.println(      "      exit(-30);");
+    outmethod.println(      "      break;");
+    outmethod.println(      "  }");
+    outmethod.println(      "  return NULL;");
+    outmethod.println(      "}\n\n");
+  }
+
+
   protected void generateCode(FlatNode first,
                               FlatMethod fm,
                               LocalityBinding lb,
@@ -2608,39 +2611,17 @@ public class BuildCode {
       // SESE nodes can be parsed for normal compilation, just skip over them
       return;
     }
-   
-    //    output.println("\n   /* SESE "+fsen.getPrettyIdentifier()+" issue */");
-   
-    /*
- output.println("   tempSESE = mlpCreateSESErecord( "+
-                   fsen.getIdentifier()+", "+
-                   "malloc( sizeof( "+fsen.namespaceStructNameString()+") ), "+
-                   "NULL );");
-
-    for( int i = 0; i < fsen.numParameters(); ++i ) {
-      TempDescriptor td = fsen.getParameter( i );
-      output.println("   (("+fsen.namespaceStructNameString()+
-                         "*)tempSESE->namespace)->"+td+" = "+td+";");
-    }
-
-    output.println("   mlpIssue( tempSESE );");
-    //output.println("   tempSESE = mlpSchedule();");
+    
+    output.println( "   {" );
 
-    // do a pthread_create wit invokeSESE as the argument
-    // and pack all args into a single void*
-    output.println("   tempSESEargs = malloc( sizeof( invokeSESEargs ) );");
-    output.println("   tempSESEargs->classID = "+fsen.getIdentifier()+";");
-    output.println("   tempSESEargs->invokee = mlpSchedule();");
+    output.println( "     ");
+    output.println( "     ");
+    output.println( "     ");
+    output.println( "     ");
 
-    if( fsen.getParent() == null ) {
-      output.println("   tempSESEargs->parent  = NULL;");
-    } else {
-      output.println("   tempSESEargs->parent  = currentSESE;");
-    }
+    output.println( "     ");
 
-    output.println("   invokeSESEmethod( (void*) tempSESEargs );");   
-    output.println("\n");
-    */
+    output.println( "   }" );
   }
 
   public void generateFlatSESEExitNode(FlatMethod fm,  LocalityBinding lb, FlatSESEExitNode fsen, PrintWriter output) {
@@ -3326,7 +3307,7 @@ public class BuildCode {
        output.print(cn.getSafeSymbol()+md.getSafeSymbol()+"_"+md.getSafeMethodDescriptor()+"(");
     } else
       output.print(task.getSafeSymbol()+"(");
-
+    
     if (addSESErecord) {
       output.print("SESErecord* currentSESE, ");
     }
index 55869529e7de4353dea6c56016bda8f58687adae..6b2e1518006586b5bdd32fbf566df73f26f62d64 100644 (file)
@@ -1,6 +1,8 @@
 package IR.Flat;
 import Analysis.MLP.VariableSourceToken;
 import Analysis.MLP.SESEandAgePair;
+import IR.MethodDescriptor;
+import IR.ClassDescriptor;
 import IR.TypeDescriptor;
 import IR.Tree.SESENode;
 import java.util.*;
@@ -19,7 +21,17 @@ public class FlatSESEEnterNode extends FlatNode {
   protected Set<TempDescriptor> inVars;
   protected Set<TempDescriptor> outVars;
   protected Set<SESEandAgePair> needStaticNameInCode;
-  protected FlatMethod enclosing;
+
+  // scope info for this SESE
+  protected FlatMethod       fmEnclosing;
+  protected MethodDescriptor mdEnclosing;
+  protected ClassDescriptor  cdEnclosing;
+
+  // structures that allow SESE to appear as
+  // a normal method to code generation
+  protected FlatMethod       fmBogus;
+  protected MethodDescriptor mdBogus;
+
 
   public FlatSESEEnterNode( SESENode sn ) {
     this.id              = identifier++;
@@ -37,6 +49,37 @@ public class FlatSESEEnterNode extends FlatNode {
   public void rewriteDef() {
   }
 
+  public void setFlatExit( FlatSESEExitNode fsexn ) {
+    exit = fsexn;
+  }
+
+  public FlatSESEExitNode getFlatExit() {
+    return exit;
+  }
+
+  public int kind() {
+    return FKind.FlatSESEEnterNode;
+  }
+
+  public SESENode getTreeNode() {
+    return treeNode;
+  }
+
+  public int getIdentifier() {
+    return id;
+  }
+
+  public String getPrettyIdentifier() {    
+    if( treeNode.getID() != null ) {
+      return treeNode.getID();
+    }     
+    return ""+id;
+  }
+
+  public String toString() {
+    return "sese "+getPrettyIdentifier()+" enter";
+  }
+
   public void setParent( FlatSESEEnterNode parent ) {
     this.parent = parent;
   }
@@ -96,6 +139,7 @@ public class FlatSESEEnterNode extends FlatNode {
     return vecinVars.size();
   }
 
+  /*
   public String namespaceStructNameString() {
     return "struct SESE_"+getPrettyIdentifier()+"_namespace";
   }
@@ -114,6 +158,7 @@ public class FlatSESEEnterNode extends FlatNode {
   public String namespaceStructAccessString( TempDescriptor td ) {
     return "SESE_"+getPrettyIdentifier()+"_namespace."+td;
   }
+  */
 
   public Set<FlatNode> getNodeSet() {
     HashSet<FlatNode> tovisit=new HashSet<FlatNode>();
@@ -147,42 +192,36 @@ public class FlatSESEEnterNode extends FlatNode {
     return needStaticNameInCode;
   }
 
-  public void setEnclosingFlatMeth( FlatMethod fm ) {
-    enclosing = fm;
-  }
+  public void setfmEnclosing( FlatMethod fm ) { fmEnclosing = fm; }
+  public FlatMethod getfmEnclosing() { return fmEnclosing; }
 
-  public FlatMethod getEnclosingFlatMeth() {
-    return enclosing;
-  }
+  public void setmdEnclosing( MethodDescriptor md ) { mdEnclosing = md; }
+  public MethodDescriptor getmdEnclosing() { return mdEnclosing; }
 
-  public SESENode getTreeNode() {
-    return treeNode;
-  }
-
-  public int getIdentifier() {
-    return id;
-  }
-
-  public String getPrettyIdentifier() {    
-    if( treeNode.getID() != null ) {
-      return treeNode.getID();
-    }     
-    return ""+id;
-  }
+  public void setcdEnclosing( ClassDescriptor cd ) { cdEnclosing = cd; }
+  public ClassDescriptor getcdEnclosing() { return cdEnclosing; }
 
-  public String toString() {
-    return "sese "+getPrettyIdentifier()+" enter";
-  }
+  public void setfmBogus( FlatMethod fm ) { fmBogus = fm; }
+  public FlatMethod getfmBogus() { return fmBogus; }
 
-  public void setFlatExit( FlatSESEExitNode fsexn ) {
-    exit = fsexn;
-  }
+  public void setmdBogus( MethodDescriptor md ) { mdBogus = md; }
+  public MethodDescriptor getmdBogus() { return mdBogus; }
 
-  public FlatSESEExitNode getFlatExit() {
-    return exit;
+  public String getSESEmethodName() {
+    return 
+      cdEnclosing.getSafeSymbol()+
+      mdBogus.getSafeSymbol()+
+      "_"+
+      mdBogus.getSafeMethodDescriptor();
   }
 
-  public int kind() {
-    return FKind.FlatSESEEnterNode;
+  public String getSESErecordName() {
+    return
+      "struct "+
+      cdEnclosing.getSafeSymbol()+
+      mdBogus.getSafeSymbol()+
+      "_"+
+      mdBogus.getSafeMethodDescriptor()+
+      "_SESErec";
   }
 }
index b1c09b643aed4898cb379e116ec9690b6b4b2420..a18b4fea70e9d1d88394e44a1eef50599e823c7c 100644 (file)
 #define TRUE  1
 
 
+/*
 SESErecord* mlpCreateSESErecord( int   classID,
-                                void* inSetObjs,
-                                void* outSetObjsNotInInSet,
-                                void* inSetPrims,
-                                void* outSetPrimsNotInInSet
+                                void* inSetOutSetObjs,
+                                void* inSetOutSetPrims
                               ) {
 
   SESErecord* newrec = RUNMALLOC( sizeof( SESErecord ) );
 
-  newrec->classID               = classID;
-  newrec->inSetObjs             = inSetObjs;
-  newrec->outSetObjsNotInInSet  = outSetObjsNotInInSet;
-  newrec->inSetPrims            = inSetPrims;
-  newrec->outSetPrimsNotInInSet = outSetPrimsNotInInSet;
+  newrec->classID          = classID;
+  newrec->inSetOutSetObjs  = inSetOutSetObjs;
+  newrec->inSetOutSetPrims = inSetOutSetPrims;
 
   pthread_mutex_init( &(newrec->lock),  NULL );
   newrec->forwardList   = createQueue();
@@ -42,38 +39,38 @@ void mlpDestroySESErecord( SESErecord* sese ) {
   pthread_mutex_destroy( &(sese->lock) );
   freeQueue( sese->forwardList );
 
-  RUNFREE( sese->inSetObjs             );
-  RUNFREE( sese->outSetObjsNotInInSet  );
-  RUNFREE( sese->inSetPrims            );
-  RUNFREE( sese->outSetPrimsNotInInSet );
-  RUNFREE( sese                        );
+  RUNFREE( sese->inSetOutSetObjs  );
+  RUNFREE( sese->inSetOutSetPrims );
+  RUNFREE( sese                   );
 }
+*/
 
-
+/*
 struct rootSESEinSetObjs  { char** argv; };
 struct rootSESEinSetPrims { int argc;    };
+*/
 
 void mlpInit( int numProcessors, 
              void(*workFunc)(void*),
              int argc, char** argv,
              int maxSESEage ) {  
 
-  SESErecord* rootSESE;
+  //SESErecord* rootSESE;
   
-  struct rootSESEinSetObjs*  inObjs  = RUNMALLOC( sizeof( struct rootSESEinSetObjs ) );
-  struct rootSESEinSetPrims* inPrims = RUNMALLOC( sizeof( struct rootSESEinSetPrims ) );
+  //struct rootSESEinSetObjs*  inObjs  = RUNMALLOC( sizeof( struct rootSESEinSetObjs ) );
+  //struct rootSESEinSetPrims* inPrims = RUNMALLOC( sizeof( struct rootSESEinSetPrims ) );
 
   // first initialize the work scheduler
   workScheduleInit( numProcessors, workFunc );
 
   // the prepare the root SESE
-  inObjs->argv  = argv;
-  inPrims->argc = argc;
-  rootSESE = mlpCreateSESErecord( 0, inObjs, NULL, inPrims, NULL );
+  //inObjs->argv  = argv;
+  //inPrims->argc = argc;
+  //rootSESE = mlpCreateSESErecord( 0, inObjs, NULL, inPrims, NULL );
 
   // skip the issue step because the root SESE will
   // never have outstanding dependencies
-  workScheduleSubmit( (void*) rootSESE );
+  //workScheduleSubmit( (void*) rootSESE );
 
   // now the work scheduler is initialized and work is
   // in the hopper, so begin processing.  This call 
@@ -82,11 +79,11 @@ void mlpInit( int numProcessors,
 }
 
 
-void mlpIssue( SESErecord* sese ) {
+void mlpIssue( void* seseRecord ) {
 
 }
 
 
-void mlpStall( SESErecord* sese ) {
+void mlpStall( void* seseRecord ) {
   
 }
index be636faac5249edf3a28f3ad8eb8092601ae50fd..5a505ce33a7b2541782bb8aef8da70df53b72104 100644 (file)
@@ -6,46 +6,24 @@
 #include "Queue.h"
 #include "psemaphore.h"
 
-
+/*
 // forward delcarations
 struct SESErecord_t;
 
 
-
-/*
-typedef struct SESEvar_t {
-  // the value when it is known will be placed
-  // in this location, which can be accessed
-  // as a variety of types
-  union {
-    char      sesetype_byte;
-    int       sesetype_boolean;
-    short     sesetype_short;
-    int       sesetype_int;
-    long long sesetype_long;
-    short     sesetype_char;
-    float     sesetype_float;
-    double    sesetype_double;
-    void*     sesetype_object;
-  };  
-} SESEvar;
-*/
-
 typedef struct SESErecord_t {  
   // the identifier for the class of sese's that
   // are instances of one particular static code block
   int classID;
 
-  // The following fields have this structure:
+  // This field is a structure of in-set and out-set
+  // objects with the following layout:
   // [INTPTR numPtrs][void* next][ptr0][ptr1]...
-  void* inSetObjs;
-  void* outSetObjsNotInInSet;
+  void* inSetOutSetObjs;
 
-  // The following fields point to compile-time
-  // generated structures that have named 
-  // primitive fields
-  void* inSetPrims;
-  void* outSetPrimsNotInInSet;
+  // This field is a structure of primitives for
+  // the in-set and out-set
+  void* inSetOutSetPrims;
 
   // the lock guards the following data SESE's
   // use to coordinate with one another
@@ -54,24 +32,31 @@ typedef struct SESErecord_t {
   int             doneExecuting;
 
 } SESErecord;
+*/
 
+/*
+typedef struct SESEvarSrc_t {
+  void* seseRecord;
+  int         offset;
+} SESEvarSrc;
+*/
 
+/*
 // simple mechanical allocation and deallocation
 // of SESE records
 SESErecord* mlpCreateSESErecord( int   classID,
-                                void* inSetObjs,
-                                void* outSetObjsNotInInSet,
-                                void* inSetPrims,
-                                void* outSetPrimsNotInInSet
+                                void* inSetOutSetObjs,
+                                void* inSetOutSetPrims
                                );
 
 void mlpDestroySESErecord( SESErecord* sese );
+*/
 
 
 // main library functions
 void mlpInit();
-void mlpIssue( SESErecord* sese );
-void mlpStall( SESErecord* sese );
+void mlpIssue( void* seseRecord );
+void mlpStall( void* seseRecord );
 
 
 #endif /* __MLP_RUNTIME__ */
index 33e9d122c9dd90a04e9f7f15d2db24bb6e32e76d..2633b45b8cba010ae3a39d7fa3d20c10cb94c16b 100644 (file)
@@ -4,7 +4,7 @@ SOURCE_FILES=$(PROGRAM).java
 
 BUILDSCRIPT=~/research/Robust/src/buildscript
 
-USEMLP= #-mlp 1 2 # -mlpdebug # use to turn mlp on and off and make sure rest of build not broken
+USEMLP= -mlp 1 2 # -mlpdebug # use to turn mlp on and off and make sure rest of build not broken
 BSFLAGS= $(USEMLP) -nooptimize -debug -garbagestats -mainclass Test -ownership -ownallocdepth 1 -ownwritedots final -enable-assertions -flatirusermethods -ownaliasfile aliases.txt
 
 all: $(PROGRAM).bin
index c64bc3bded79b2098034a1ee5646aa756a4705fb..a6b6f2f169c5e03caabc578c29089f3f9ae4ed4d 100644 (file)
@@ -1,3 +1,8 @@
+public class Foo {
+  public Foo() {}
+}
+
+
 public class Test {
 
   public static void main( String args[] ) {
@@ -5,10 +10,16 @@ public class Test {
     int x = 1;
     int y = 1;
 
+    //Foo f;
+
     sese fi {
       //if( true ) {
       x = y + 2;
       y = 3;   
+      
+      System.out.println( "fi: x="+x+", y="+y );
+
+      //f = new Foo();
       //}      
     }
 
@@ -41,7 +52,7 @@ public class Test {
     // forwarded to this sibling
     //sese fo {
     // expecting x=5, y=4
-    System.out.println( "x="+x+", y="+y );
+    System.out.println( "root: x="+x+", y="+y );
     //}
 
     /*