changes for running recovery version
authoradash <adash>
Tue, 13 Apr 2010 01:31:41 +0000 (01:31 +0000)
committeradash <adash>
Tue, 13 Apr 2010 01:31:41 +0000 (01:31 +0000)
Robust/src/Benchmarks/Recovery/Spider/recovery/QueryTask.java
Robust/src/Benchmarks/Recovery/Spider/recovery/Spider.java
Robust/src/Benchmarks/Recovery/Spider/recovery/Task.java
Robust/src/Benchmarks/Recovery/Spider/recovery/Worker.java
Robust/src/Benchmarks/Recovery/Spider/recovery/makefile

index 8346b6e25dc441ecf78b0610ed82aeacfa4f0bb2..4992deeea77df64b876db91803f48c5ad82b5076 100644 (file)
@@ -275,9 +275,7 @@ public class QueryTask extends Task {
     
     do {
       numchars = sock.read(buffer);
-      
       String curr = (new String(buffer)).subString(0, numchars);
-      
       lq.response.append(curr);
       buffer = new byte[1024];
     } while(numchars > 0);
index 0f82b51b320f9307fb157a44d7ab1f69d65416fb..00a2d8f6c5f0dd46b3395abeb9cd7d107d982859 100644 (file)
@@ -5,6 +5,7 @@ Usage :
 
 
 public class Spider {
+  public Spider() {}
   public static void main(String[] args) {
     int NUM_THREADS = 3;
     int maxDepth = 3;
@@ -62,6 +63,10 @@ public class Spider {
       }
       Thread.myStart(tmp, mid[i]);
     }
+
+    while(true)
+      Thread.sleep(100000);
+
     for (i = 0; i < NUM_THREADS; i++) {
       atomic {
        tmp = ts.threads[i];
index 219b1f1545dd2647c75af3da2fc11c3edf682362..1398c1c67ed26f6ba72cd9b16b9eadef2410e98f 100644 (file)
@@ -1,6 +1,7 @@
 public class Task {
   //Current worker thread
   Worker w;
+  public Task() {}
   public void execute();
   public void setWorker(Worker w) {
     this.w = w;
index e7ae0040df456de3eeec00d050746e263a2f2053..98a7c1e4160c60421d0f0bb6d7fbc3591cf263c0 100644 (file)
@@ -18,7 +18,8 @@ public class Worker extends Thread {
         if (!tasks.todo.isEmpty()) {
           //grab segment from todo list
           t=workingtask=(Task) tasks.todo.pop();
-         t.setWorker(this);
+          if(t!=null)
+            t.setWorker(this);
         } else {
           //steal work from dead threads
           Worker[] threads=tasks.threads;
@@ -27,7 +28,7 @@ public class Worker extends Thread {
             Worker w=(Worker)threads[i];
            if (w.workingtask!=null)
              shouldexit=false;
-            if (w.getStatus()==-1&&w.workingtask!=null) {
+            if (w.getStatus(i)==-1&&w.workingtask!=null) {
               //steal work from this thread
               t=workingtask=w.workingtask;
               w.workingtask=null;
@@ -42,9 +43,15 @@ public class Worker extends Thread {
       if (t!=null) {
         t.execution();
         continue;
-      } else if (notdone)
-       sleep(500000);
+      } else if (notdone) {
+        System.out.println("Not done");
+       sleep(500000);
+      }
+    }
+    System.out.println("\n\nDone\n\n");
+    while(true) {
+      sleep(100000);
     }
   }
   public static native void printRecoveryStat();
-}
\ No newline at end of file
+}
index 98039679cbc8fe8f02787ebcb88db5a1509255e2..d9c82574622671dce57e08046ce3334a424948d7 100644 (file)
@@ -3,12 +3,13 @@ SUBCLASS=Query
 SRC1=${MAINCLASS}.java
 SRC2=Global${SUBCLASS}.java
 SRC3=${SUBCLASS}Task.java
-FLAGS=-recoverystats -recovery -transstats -dsmcaching -dsm -dsmtask -debug -nooptimize -mainclass ${MAINCLASS}
-DSMFLAGS=-dsm -dsmtask -sandbox -transstats -debug -nooptimize -mainclass ${MAINCLASS}
+FLAGS=-recoverystats -recovery -transstats -dsmcaching -dsm -dsmtask -optimize -mainclass ${MAINCLASS}
+DSMFLAGS= -dsm -dsmtask -sandbox -transstats -optimize -mainclass ${MAINCLASS}
 default:
-#      ../../../../buildscript ${FLAGS} -o ${MAINCLASS} ${SRC2} ${SRC3} ${SRC1}
-       ../../../../buildscript ${DSMFLAGS} -o ${MAINCLASS}DSM *.java
+       ../../../../buildscript ${DSMFLAGS} -o ${MAINCLASS}DSM GlobalQuery.java LocalQuery.java QueryTask.java Spider.java Task.java GlobalQueue.java Worker.java TaskSet.java
+       ../../../../buildscript ${FLAGS} -o ${MAINCLASS} GlobalQuery.java LocalQuery.java QueryTask.java Spider.java Task.java GlobalQueue.java Worker.java TaskSet.java
 
 clean:
        rm -rf tmpbuilddirectory
        rm *.bin
+