investigating OOPSLA benchmarks further
authorjjenista <jjenista>
Wed, 14 Oct 2009 15:09:54 +0000 (15:09 +0000)
committerjjenista <jjenista>
Wed, 14 Oct 2009 15:09:54 +0000 (15:09 +0000)
Robust/src/Benchmarks/mlp/directto/README.txt [new file with mode: 0644]
Robust/src/Benchmarks/mlp/directto/mlp-java/D2.java
Robust/src/Benchmarks/mlp/directto/mlp-java/MessageList.java
Robust/src/Tests/OwnershipAnalysisTest/mappingWeakness/makefile [new file with mode: 0644]
Robust/src/Tests/OwnershipAnalysisTest/mappingWeakness/test.java [new file with mode: 0644]

diff --git a/Robust/src/Benchmarks/mlp/directto/README.txt b/Robust/src/Benchmarks/mlp/directto/README.txt
new file mode 100644 (file)
index 0000000..3bc08be
--- /dev/null
@@ -0,0 +1,3 @@
+The DirectTo benchmark reads in a text file to build a list of
+messages for tracking and routing aircraft without conflicts.
+
index 874a1d18065ccf9746e3b9a42561594349f2ae6e..477e9d3495ce9661cf29e790f3459da801463115 100755 (executable)
@@ -5,23 +5,24 @@
 //import java.io.*;
 
 public class D2 {
 //import java.io.*;
 
 public class D2 {
-  public ReadWrite rw;
 
 
-  private Static                singletonStatic               ; public Static                getStatic               () { return singletonStatic               ; }
-  private AircraftList         singletonAircraftList         ; public AircraftList          getAircraftList         () { return singletonAircraftList         ; }   
-  private Algorithm            singletonAlgorithm            ; public Algorithm             getAlgorithm            () { return singletonAlgorithm            ; }
-  private FixList              singletonFixList              ; public FixList               getFixList              () { return singletonFixList              ; }
-  private Flight               singletonFlight               ; public Flight                getFlight               () { return singletonFlight               ; }
-  private FlightList           singletonFlightList           ; public FlightList            getFlightList           () { return singletonFlightList           ; }
-  private MessageList          singletonMessageList          ; public MessageList           getMessageList          () { return singletonMessageList          ; }
-  private TrajectorySynthesizer singletonTrajectorySynthesizer; public TrajectorySynthesizer getTrajectorySynthesizer() { return singletonTrajectorySynthesizer; }
+  public ReadWrite             singletonReadWrite            ; public ReadWrite             getReadWrite            () { return singletonReadWrite            ; }
+  public Static                singletonStatic               ; public Static                getStatic               () { return singletonStatic               ; }
+  public AircraftList         singletonAircraftList         ; public AircraftList          getAircraftList         () { return singletonAircraftList         ; }   
+  public Algorithm            singletonAlgorithm            ; public Algorithm             getAlgorithm            () { return singletonAlgorithm            ; }
+  public FixList               singletonFixList                     ; public FixList               getFixList              () { return singletonFixList              ; }
+  public Flight                singletonFlight              ; public Flight                getFlight               () { return singletonFlight               ; }
+  public FlightList           singletonFlightList           ; public FlightList            getFlightList           () { return singletonFlightList           ; }
+  public MessageList          singletonMessageList          ; public MessageList           getMessageList          () { return singletonMessageList          ; }
+  public TrajectorySynthesizer singletonTrajectorySynthesizer; public TrajectorySynthesizer getTrajectorySynthesizer() { return singletonTrajectorySynthesizer; }
 
   public D2() {
 
   public D2() {
+    singletonReadWrite             = new ReadWrite            ();
     singletonStatic                = new Static               ();
     singletonAircraftList         = new AircraftList         ();
     singletonFixList              = new FixList              ();
     singletonAlgorithm            = new Algorithm            ();
     singletonStatic                = new Static               ();
     singletonAircraftList         = new AircraftList         ();
     singletonFixList              = new FixList              ();
     singletonAlgorithm            = new Algorithm            ();
-    singletonFlight                = new Flight               ( "" );
+    singletonFlight                = new Flight               ("");
     singletonFlightList                   = new FlightList           (); 
     singletonMessageList          = new MessageList          ();
     singletonTrajectorySynthesizer = new TrajectorySynthesizer();
     singletonFlightList                   = new FlightList           (); 
     singletonMessageList          = new MessageList          ();
     singletonTrajectorySynthesizer = new TrajectorySynthesizer();
@@ -31,28 +32,17 @@ public class D2 {
     System.out.println("D2 - Application started");
 
     D2 d2 = new D2();
     System.out.println("D2 - Application started");
 
     D2 d2 = new D2();
-
     
     
-    d2.rw=new ReadWrite();
-    d2.rw.read(d2);
+    d2.getReadWrite().read(d2);
     
     
-
     d2.getMessageList().executeAll(d2);
     
     d2.getMessageList().executeAll(d2);
     
-    int count = 0;
     while( d2.getFlightList().anyPlanesAlive() ) {
       d2.getAlgorithm().doIteration(d2);
     while( d2.getFlightList().anyPlanesAlive() ) {
       d2.getAlgorithm().doIteration(d2);
-      
-      count++;
-      if( count % 10000 == 0 ) {
-       //System.out.println( "iteration "+count );
-      }
-
-      if( count == 1000 ) {
-       break;
-      }
     }
 
     }
 
-    d2.rw.write(d2);
+    d2.getReadWrite().write(d2);
+
+    System.out.println("D2 - Application finished");
   }
 }
   }
 }
index c91db3bbd4ea375dcb90afedf76d3d0974f200bb..2f268cb414a4ff7dc2008aa3e53f0f4c39a511f2 100755 (executable)
@@ -10,12 +10,13 @@ public class MessageList {
 
   public Message data() {
     Message m = (Message) messages.elementAt(0);
 
   public Message data() {
     Message m = (Message) messages.elementAt(0);
-    messages.removeElementAt(0);
     return m;
   }
     
   public Message next() {
     return m;
   }
     
   public Message next() {
-    return data();
+    Message m = (Message) messages.elementAt(0);
+    messages.removeElementAt(0);
+    return m;
   }
 
   public boolean hasNext() {
   }
 
   public boolean hasNext() {
diff --git a/Robust/src/Tests/OwnershipAnalysisTest/mappingWeakness/makefile b/Robust/src/Tests/OwnershipAnalysisTest/mappingWeakness/makefile
new file mode 100644 (file)
index 0000000..fdfcf35
--- /dev/null
@@ -0,0 +1,27 @@
+PROGRAM=test
+
+SOURCE_FILES=$(PROGRAM).java
+
+BUILDSCRIPT=~/research/Robust/src/buildscript
+BSFLAGS= -mainclass Test -justanalyze -ownership -ownallocdepth 1 -ownwritedots final -ownaliasfile aliases.txt -enable-assertions
+
+all: $(PROGRAM).bin
+
+view: PNGs
+       eog *.png &
+
+PNGs: DOTs
+       d2p *COMPLETE*.dot
+
+DOTs: $(PROGRAM).bin
+
+$(PROGRAM).bin: $(SOURCE_FILES)
+       $(BUILDSCRIPT) $(BSFLAGS) -o $(PROGRAM) $(SOURCE_FILES)
+
+clean:
+       rm -f  $(PROGRAM).bin
+       rm -fr tmpbuilddirectory
+       rm -f  *~
+       rm -f  *.dot
+       rm -f  *.png
+       rm -f  aliases.txt
diff --git a/Robust/src/Tests/OwnershipAnalysisTest/mappingWeakness/test.java b/Robust/src/Tests/OwnershipAnalysisTest/mappingWeakness/test.java
new file mode 100644 (file)
index 0000000..b5d6ffa
--- /dev/null
@@ -0,0 +1,10 @@
+public class Test {
+  static public void main( String[] args ) {    
+    int n = 10;
+    Vector v1 = new Vector( n );
+    for( int i = 0; i < n; ++i ) {
+      Vector v1prime = disjoint v1p new Vector( n );
+      v1.setElementAt( v1prime, i );
+    }    
+  }
+}