changes to distributed benchmarks for ecoop submission
authoradash <adash>
Tue, 15 Dec 2009 19:59:38 +0000 (19:59 +0000)
committeradash <adash>
Tue, 15 Dec 2009 19:59:38 +0000 (19:59 +0000)
15 files changed:
Robust/src/Benchmarks/Distributed/LookUpService/dsm/makefile
Robust/src/Benchmarks/Distributed/LookUpService/dsm2/LookUpService.java
Robust/src/Benchmarks/Distributed/LookUpService/dsm2/makefile
Robust/src/Benchmarks/Distributed/RainForest/dsm/makefile
Robust/src/Benchmarks/Distributed/SpamFilter/DistributedHashMap.java
Robust/src/Benchmarks/Distributed/SpamFilter/GString.java
Robust/src/Benchmarks/Distributed/SpamFilter/HashEntry.java
Robust/src/Benchmarks/Distributed/SpamFilter/Mail.java
Robust/src/Benchmarks/Distributed/SpamFilter/SpamFilter2.java
Robust/src/Benchmarks/Distributed/SpamFilter/WhiplashSignature.java
Robust/src/Benchmarks/Distributed/SpamFilter/emails/URLList
Robust/src/Benchmarks/Distributed/SpamFilter/emails/gen.c
Robust/src/Benchmarks/Distributed/SpamFilter/emails/wordList
Robust/src/Benchmarks/Distributed/SpamFilter/makefile
Robust/src/Benchmarks/Distributed/runjava.sh

index 857dc84383dbabc005b8072d2f6b7abb29e357c4..9c6735ec7dd3c7806b2aa9bb904c64d0d9dc7525 100644 (file)
@@ -1,13 +1,14 @@
 MAINCLASS=LookUpService
 SRC1=${MAINCLASS}.java \
      DistributedHashMap.java
-FLAGS2=-dsm -dsmcaching -prefetch -optimize -excprefetch String.hashCode -excprefetch DistributedHashMap.resize -excprefetch String.equals -excprefetch LookUpService.main -mainclass ${MAINCLASS} -trueprob 0.95
-FLAGS3=-dsm -optimize -mainclass ${MAINCLASS}
-FLAGS4=-dsm -dsmcaching -optimize -mainclass ${MAINCLASS}
+FLAGS2=-dsm -transstats -dsmcaching -prefetch -optimize -excprefetch String.hashCode -excprefetch DistributedHashMap.resize -excprefetch String.equals -excprefetch LookUpService.main -mainclass ${MAINCLASS} -trueprob 0.95
+FLAGS3=-dsm -transstats -optimize -mainclass ${MAINCLASS}
+FLAGS4=-dsm -dsmcaching -transstats -debug -optimize -mainclass ${MAINCLASS}
 default:
        ../../../../buildscript ${FLAGS3} -o ${MAINCLASS}NPNC ${SRC1}
        ../../../../buildscript ${FLAGS4} -o ${MAINCLASS}NPC ${SRC1}
-#../../../../buildscript ${FLAGS2} -o ${MAINCLASS}N ${SRC1}
+       ../../../../buildscript ${FLAGS2} -o ${MAINCLASS}N ${SRC1}
+
 clean:
        rm -rf tmpbuilddirectory
        rm *.bin
index fceba44a18958ae058ee318bc093a8f1184f3c9f..eccb823ec07d34d8287b20308816f31568fd7b69 100644 (file)
@@ -59,7 +59,7 @@ public class LookUpService extends Thread {
           int rwkey = rand.nextInt(nobjs);
           Integer key = global new Integer(rwkey);
           if (rdwr < rdprob) {
-            Object o3 = mydhmap.get(key); //Read
+            Integer o3 = (Integer)(mydhmap.get(key)); //Read
           } else {
             Integer val = global new Integer(j);
             mydhmap.put(key, val); //Modify 
index 56d94de75e32e5302623a6b2333542afa7aaeb8e..5a3a85ef6df4823ed61ada72a18bddfaa51a75ed 100644 (file)
@@ -1,11 +1,13 @@
 MAINCLASS=LookUpService
 SRC1=${MAINCLASS}.java \
      DistributedHashMap.java
-FLAGS3=-dsm -optimize -mainclass ${MAINCLASS}
-FLAGS4=-dsm -dsmcaching -optimize -mainclass ${MAINCLASS}
+FLAGS3=-dsm -transstats -optimize -mainclass ${MAINCLASS}
+FLAGS4=-dsm -transstats -dsmcaching -optimize -mainclass ${MAINCLASS}
+FLAGS5=-dsm -dsmcaching -transstats -prefetch -optimize -mainclass ${MAINCLASS} -trueprob 0.95 -excprefetch DistributedHashMap.resize -excprefetch String.equals -excprefetch LookUpService.main -excprefetch String.hashCode
 default:
        ../../../../buildscript ${FLAGS3} -o ${MAINCLASS}NPNC ${SRC1}
        ../../../../buildscript ${FLAGS4} -o ${MAINCLASS}NPC ${SRC1}
+       ../../../../buildscript ${FLAGS5} -o ${MAINCLASS}N ${SRC1}
 clean:
        rm -rf tmpbuilddirectory
        rm *.bin
index 3df2a7976a34beb23c1ac2d9076e959cc899112c..6ffe73b92c83fcf57fd0dc2adadf4218e74a6f05 100644 (file)
@@ -10,16 +10,24 @@ SRC=tmp${MAINCLASS}.java \
        Node.java \
        AStarPathFinder.java 
 
-FLAGS1=-dsm -optimize -mainclass ${MAINCLASS}
-FLAGS2=-dsm -dsmcaching -abortreaders -optimize -mainclass ${MAINCLASS}
-FLAGS3=-dsm -dsmcaching -abortreaders -prefetch -optimize -mainclass ${MAINCLASS} -excprefetch BarrierServer.updateAge -excprefetch RainForest.main -excprefetch GameMap.hasRock -excprefetch GameMap.hasTree -trueprob 0.90
+FLAGS1=-dsm -transstats -optimize -mainclass ${MAINCLASS}
+FLAGS2=-dsm -transstats -dsmcaching -optimize -mainclass ${MAINCLASS}
+FLAGS3=-dsm -dsmcaching -transstats -prefetch -optimize -mainclass ${MAINCLASS} -excprefetch BarrierServer.updateAge -excprefetch RainForest.main -excprefetch GameMap.hasRock -excprefetch GameMap.hasTree -trueprob 0.90
+
+FLAGSNPNC=-dsm -optimize -mainclass ${MAINCLASS}
+FLAGSNPC=-dsm -dsmcaching -optimize -mainclass ${MAINCLASS}
+FLAGSP=-dsm -dsmcaching -prefetch -optimize -mainclass ${MAINCLASS} -excprefetch BarrierServer.updateAge -excprefetch RainForest.main -excprefetch GameMap.hasRock -excprefetch GameMap.hasTree -trueprob 0.90
+
 
 default:
        cpp ${MAINCLASS}.java > tmp1${MAINCLASS}.java
        ./extractLines
-       ../../../../buildscript ${FLAGS1} -o ${MAINCLASS}NPNC ${SRC}
-       ../../../../buildscript ${FLAGS2} -o ${MAINCLASS}NPC ${SRC}
-       ../../../../buildscript ${FLAGS3} -o ${MAINCLASS}N ${SRC}
+       ../../../../buildscript ${FLAGS1} -o ${MAINCLASS}withstatNPNC ${SRC}
+       ../../../../buildscript ${FLAGS2} -o ${MAINCLASS}withstatNPC ${SRC}
+       ../../../../buildscript ${FLAGS3} -o ${MAINCLASS}withstatN ${SRC}
+       ../../../../buildscript ${FLAGSNPNC} -o ${MAINCLASS}NPNC ${SRC}
+       ../../../../buildscript ${FLAGSNPC} -o ${MAINCLASS}NPC ${SRC}
+       ../../../../buildscript ${FLAGSP} -o ${MAINCLASS}N ${SRC}
 
 clean:
        rm tmp1RainForest.java
index 8ea2010a7089f71c718ccfb147ee9320265769cd..9a6bb7638745f3fa95bcded5db86abf042f96ca5 100644 (file)
@@ -141,7 +141,6 @@ public class DistributedHashMap {
 class DistributedHashEntry {
   public DistributedHashEntry() {
   }
-  int count;
   DHashEntry array;
 }
 
index 3b1b8f366c7e54e86e797c3cc07123c941e91282..47e3fcf332172c78b5dcfd717142faecf03d98c5 100644 (file)
@@ -1,7 +1,7 @@
 public class GString {
-  char value[];
-  int count;
-  int offset;
+  public char value[];
+  public int count;
+  public int offset;
 
   public GString() {
   }
index 918f6ba31d486d0fada581eb9696261cb6b4c329..f76828cac149b6e568a078857cf0d58607f3a54e 100644 (file)
@@ -1,7 +1,7 @@
 public class HashEntry {
-  GString engine;
-  GString signature;
-  HashStat stats;
+  public GString engine;
+  public GString signature;
+  public HashStat stats;
 
   public HashEntry() {
 
index 547030da2ad4104936ee29f0b002682b46142bf9..3afbe19c71c3ea5c85ea47628141dfae994b4dad 100644 (file)
@@ -35,7 +35,7 @@ public class Mail {
   {
     //System.out.println("DEBUG: fileName= " + fileName);
 
-    FileInputStream fileinput = new FileInputStream(fileName);
+    BufferedReader fileinput = new BufferedReader(new FileInputStream(fileName));
     String line;
     boolean chk = false;
 
@@ -332,19 +332,22 @@ public class Mail {
 
   public void setNoURLBody()
   {
-    noURLBody = new String();
-
     Vector splittedBody = body.split();
-
-    //System.out.println("DEBUG: splittedBody.size()= " + splittedBody.size());
-    for(int i=0; i< splittedBody.size();i ++)
-    {
+    int totalsize=0;
+    for(int i=0; i< splittedBody.size();i ++) {
       String segment = (String)(splittedBody.elementAt(i));
-      //System.out.println("DEBUG: segment= " + segment);
-      
       if(!(segment.startsWith("http://") || isEmailAccount(segment)))
-        noURLBody += segment;
+        totalsize+=segment.length();
     }
+
+    StringBuffer sb=new StringBuffer(totalsize);
+    for(int i=0; i< splittedBody.size();i ++) {
+      String segment = (String)(splittedBody.elementAt(i));
+      if(!(segment.startsWith("http://") || isEmailAccount(segment))) {
+        sb.append(segment);
+      }
+    }
+    noURLBody=sb.toString();
   }
 
   // setNoURLBody method has to be called before this method
@@ -353,25 +356,19 @@ public class Mail {
   {
     setNoURLBody();
     Vector returnStrings = new Vector();
+    int end=noURLBody.length();
 
-    char[] charArray = noURLBody.toCharArray();
-
-    String tmpStr = new String();
-    tmpStr += charArray[0];
-
-    for(int i=1; i< noURLBody.length(); i++)
+    for(int i=1; i< end; i+=size)
     {
-      if((i % size) == 0) {
-        returnStrings.addElement(tmpStr);
-        tmpStr = new String();
+      if((i+size)>=end) {
+        String str=noURLBody.substring(i, end);
+        returnStrings.addElement(str);
       }
       else {
-        tmpStr += charArray[i];
+        String str=noURLBody.substring(i, i+size);
+        returnStrings.addElement(str);
       }
     }
-
-    returnStrings.addElement(tmpStr);
-
     return returnStrings;
   }
 
index e8db8e1161e06bfe5f41a62210bc9e580d020d38..004b3341e0812af2af17565ad14c6fabce70bdc2 100644 (file)
@@ -42,6 +42,9 @@ public class SpamFilter extends Thread {
       thid = id;
     }
 
+    //if(thid == 0)
+    //  return;
+
     Random rand = new Random(thid);
     int i;
 
@@ -49,65 +52,41 @@ public class SpamFilter extends Thread {
       correct =0;
       wrong = 0;
       for(int j=0; j<nemails; j++) {
-        // long start = System.currentTimeMillis();
-        int pickemail = rand.nextInt(100);
-
-        //System.out.println("pickemail= " + pickemail);
+        int pickemail = rand.nextInt(nemails);
 
         // randomly pick emails
         pickemail+=1;
+        //System.out.println("pickemail= " + pickemail);
         Mail email = new Mail("emails/email"+pickemail);
         Vector signatures = email.checkMail(thid);
 
         //check with global data structure
         int[] confidenceVals=null;
-        // long startcheck = System.currentTimeMillis(); 
         atomic {
           confidenceVals = check(signatures,thid);
         }
-        // long stopcheckMail = System.currentTimeMillis(); 
-        // long diff = (stopcheckMail-startcheck);
-        // System.out.println("check takes= " + diff + "millisecs");
-
-        /* Only for debugging
-        for(int k=0; k<signatures.size();k++) {
-          System.out.println("confidenceVals["+k+"]= "+confidenceVals[k]);
-        }
-        */
 
         //---- create and  return results --------
         FilterResult filterResult = new FilterResult();
-        //long startgetResult = System.currentTimeMillis();
         boolean filterAnswer = filterResult.getResult(confidenceVals);
-        //long stopgetResult = System.currentTimeMillis();
-        //diff = (stopgetResult-startgetResult);
-        //System.out.println("getResult takes= " + diff + "millisecs");
 
         //---- get user's take on email and send feedback ------
         boolean userAnswer = email.getIsSpam();
 
//       System.out.println("userAnswer= " + userAnswer + " filterAnswer= " + filterAnswer);
       //System.out.println("userAnswer= " + userAnswer + " filterAnswer= " + filterAnswer);
 
         if(filterAnswer != userAnswer) {
           /* wrong answer from the spam filter */
           wrong++;
-          //long startsendFeedBack = System.currentTimeMillis();
           atomic {
             sendFeedBack(signatures, userAnswer, thid, rand);
           }
-          //long stopsendFeedBack = System.currentTimeMillis();
-          //diff = (stopsendFeedBack-startsendFeedBack);
-          //System.out.println("sendFeedback takes= " + diff + "millisecs");
         }
         else {
           /* Correct answer from the spam filter */
           correct++;
         }
-        //long stop = System.currentTimeMillis();
-        //diff = stop-start;
-        //System.out.println("time to complete iteration" + j + " = " + diff + " millisecs");
       } //end num emails
-      // System.out.println((i+1)+"th iteration correct = " + correct + " Wrong = " + wrong + " percentage = " + ((float)correct/(float)nemails));
     }//end num iter
     // Sanity check
     System.out.println((i)+"th iteration correct = " + correct + " Wrong = " + wrong + " percentage = " + ((float)correct/(float)nemails));
@@ -133,7 +112,7 @@ public class SpamFilter extends Thread {
     DistributedHashMap dhmap;
     SpamFilter[] spf;
     atomic {
-      dhmap = global new DistributedHashMap(500, 0.75f);
+      dhmap = global new DistributedHashMap(10000, 0.75f);
     }
     atomic {
       spf = global new SpamFilter[nthreads];
@@ -226,6 +205,9 @@ public class SpamFilter extends Thread {
    */
 
   public int[] check(Vector signatures, int userid) {
+
+    //*** Prefetch ****/
+    //prefetch(this.mydhmap.table);
     int numparts = signatures.size();
 
     //System.out.println("check() numparts= " + numparts);
@@ -234,99 +216,99 @@ public class SpamFilter extends Thread {
     for(int i=0; i<numparts; i++) {
       String part = (String)(signatures.elementAt(i));
       char tmpengine = part.charAt(0);
-      GString engine=null;
+      String enginestr=null;
       if(tmpengine == '4') { //Ephemeral Signature calculator
-        String tmpstr = new String("4");
-        engine = global new GString(tmpstr);
+        enginestr = new String("4");
       }
       if(tmpengine == '8') { //Whiplash Signature calculator
-        String tmpstr = new String("8");
-        engine = global new GString(tmpstr);
+        enginestr = new String("8");
       }
-
-      //System.out.println("check(): engine= " + engine.toLocalString());
-
-      String str = new String(part.substring(2));//a:b index of a =0, index of : =1, index of b =2
-      GString signature = global new GString(str);
-      HashEntry myhe = global new HashEntry();
-      myhe.setengine(engine);
-      myhe.setsig(signature);
+      String signaturestr = new String(part.substring(2));//a:b index of a =0, index of : =1, index of b =2
 
       //find object in distributedhashMap: if no object then add object 
-      //HashEntry tmphe = (HashEntry)(mydhmap.getKey(myhe));
       HashEntry tmphe=null;
-      int hashCode = myhe.hashCode();
+      int hashCode = enginestr.hashCode()^signaturestr.hashCode();
+      
       int index1 = mydhmap.hash1(hashCode, mydhmap.table.length);
+
+      /*** Prefetch ****/
+      //prefetch(mydhmap.table[index1].array.key.stats.userstat[userid],
+      //         mydhmap.table[index1].array.value,
+      //         mydhmap.table[index1].array.key.stats.userid,
+      //         mydhmap.table[index1].array.key.engine.value,
+      //         mydhmap.table[index1].array.key.signature.value);  
+
       DistributedHashEntry testhe = mydhmap.table[index1];
-      int point;
+      boolean foundstatistics=false;
       DHashEntry ptr=null;
-      FilterStatistic fs=null;
-      if(testhe==null) {
-        tmphe=null; 
-        fs=null;
-      } else {
+      if(testhe!=null) {
+        /*** Prefetch ****/
+        //prefetch(testhe.array.next.value,
+        //         testhe.array.next.key.engine.value,
+        //         testhe.array.next.key.stats.userid,
+        //         testhe.array.next.key.stats.userstat[userid],
+        //         testhe.array.next.key.signature,value);
+
         ptr=testhe.array;
-        point=0;
 
         while(ptr !=null) {
-          //TODO: Inline equals method
-          if(ptr.hashval==hashCode&&ptr.key.equals(myhe)) {
-            tmphe=ptr.key;
-            fs= ptr.value;
-            point=1;
-            break;
+          boolean engineVal= inLineEquals(ptr.key.engine.value, ptr.key.engine.count, ptr.key.engine.offset,
+             enginestr.value, enginestr.count, enginestr.offset);
+          boolean SignatureVal= inLineEquals(ptr.key.signature.value, ptr.key.signature.count, ptr.key.signature.offset,
+              signaturestr.value, signaturestr.count, signaturestr.offset);
+         
+          FilterStatistic tmpfs = ptr.value;
+          int tmpuserid = ptr.key.stats.userid[userid];
+          FilterStatistic myfs = ptr.key.stats.userstat[userid];
+          
+          if(ptr.hashval==hashCode&&engineVal&&SignatureVal) {
+           //Found statics...get Checked value.
+           confidenceVals[i] = tmpfs.getChecked(); 
+           foundstatistics=true;
+           break;
           }
+          /* Prefetch */
+          //prefetch(ptr.next.next.key.stats.userid,
+          //         ptr.next.next.key.engine.value,
+          //         ptr.next.next.key.signature.value,
+          //         ptr.next.next.key.stats.userstat[userid],
+          //         ptr.next.next.value);
           ptr=ptr.next;
         }
-        if(point != 1){
-          tmphe=null;
-          fs=null;
-        }
       }
 
-      if(tmphe==null) {
-        //add new object
+      if (!foundstatistics) {
+        /* Prefetch */
+        //prefetch(testhe.array);
+        HashEntry myhe = global new HashEntry();
+        GString engine = global new GString(enginestr);
+        GString signature = global new GString(signaturestr);
+
+        myhe.setengine(engine);
+        myhe.setsig(signature);
+
+        DHashEntry he = global new DHashEntry();
+        //application specific fields
         HashStat mystat = global new HashStat();
         mystat.setuser(userid, 0, 0, -1);
         myhe.setstats(mystat);
         FilterStatistic myfs =  global new FilterStatistic(0,0,-1);
-        /** put into hash map **/
-        point=0;
-        if(testhe==null){
-          testhe = global new DistributedHashEntry();
-          mydhmap.table[index1]=testhe;
-        }
-        ptr=testhe.array;
-        while(ptr !=null) {
-          if(ptr.hashval==hashCode&&ptr.key.equals(myhe)) {
-            FilterStatistic oldvalue=ptr.value;
-            ptr.value=myfs;
-            point=1;
-            break;
-          }
-          ptr=ptr.next;
-        }
-        if(point==0) {
-          DHashEntry he = global new DHashEntry();
-          he.value=myfs;
-          he.key=myhe;
-          he.hashval=hashCode;
-          he.next = testhe.array;
+        he.value=myfs;
+        he.key=myhe;
+        he.hashval=hashCode;
+        //link old element into chain
+        //build new element
+
+        if (testhe!=null) {
+          //splice into old list
+          he.next=testhe.array;
           testhe.array=he;
-          testhe.count++;
-          //System.out.println("put method returning null");
+        } else {
+          //create new header...this will cause many aborts
+          DistributedHashEntry newhe=global new DistributedHashEntry();
+          newhe.array=he;
+          mydhmap.table[index1]=newhe;
         }
-
-        //mydhmap.put(myhe,myfs);
-        confidenceVals[i] = 0;
-      } else { //read exsisting object
-        // ----- now connect to global data structure and ask for spam -----
-        //HashEntry tmphe = (HashEntry)(mydhmap.getKey(myhe));
-        //FilterStatistic fs = (FilterStatistic) (mydhmap.get(tmphe)); //get the value from hash
-
-        //System.out.println(fs.toString()+"\n");
-
-        confidenceVals[i] = fs.getChecked();
       }
     }
 
@@ -378,32 +360,26 @@ public class SpamFilter extends Thread {
 
 
       // ----- now connect to global data structure and update stats -----
-      //if(mydhmap.containsKey(myhe))
-      //HashEntry tmphe = (HashEntry)(mydhmap.getKey(myhe));
       HashEntry tmphe=null;
       FilterStatistic fs=null;
       int hashCode = myhe.hashCode();
       int index1 = mydhmap.hash1(hashCode, mydhmap.table.length);
       DistributedHashEntry testhe = mydhmap.table[index1];
-      if(testhe==null) {
-        tmphe=null;
-        fs=null;
-      } else {
+      if(testhe!=null) {
         DHashEntry ptr=testhe.array;
-        int point=0;
-        while(ptr !=null) {
-          if(ptr.hashval==hashCode&&ptr.key.equals(myhe)) {
+        while(ptr!=null) {
+          boolean engineVal= inLineEquals(ptr.key.engine.value, ptr.key.engine.count, ptr.key.engine.offset,
+              myhe.engine.value, myhe.engine.count, myhe.engine.offset);
+          boolean SignatureVal= inLineEquals(ptr.key.signature.value, ptr.key.signature.count, ptr.key.signature.offset,
+              myhe.signature.value, myhe.signature.count, myhe.signature.offset);
+
+          if(ptr.hashval==hashCode&&engineVal&&SignatureVal) {
             tmphe=ptr.key;
             fs=ptr.value;
-            point=1;
             break;
           }
           ptr=ptr.next;
         }
-        if(point != 1) {
-          tmphe=null;
-          fs=null;
-        }
       }
       //tmphe has the key at the end
       //fs has the value at the end      
@@ -418,11 +394,6 @@ public class SpamFilter extends Thread {
 
 
       //---- get value from distributed hash and update spam count
-      //FilterStatistic fs = (FilterStatistic) (mydhmap.get(myhe)); 
-
-      //---- get value from distributed hash and update spam count
-
-      //System.out.println(fs.toString());
 
       //Allow users to give incorrect feedback
       int pickemail = myrand.nextInt(100);
@@ -449,6 +420,15 @@ public class SpamFilter extends Thread {
       } //end of pickemail
     }//end of for
   }//end of sendFeedback
-}
-
 
+  public static boolean inLineEquals(char[] array1, int count1, int offset1, char[] array2, int count2, int offset2) {
+    if(count1 != count2)
+      return false;
+    for(int i=0; i<count1; i++) {
+      if(array1[i+offset1] != array2[i+offset2]) {
+        return false;
+      }
+    }
+    return true;
+  }
+}
index 4a8b0bd859f2504e19115faec6ec9d2326c552c5..3d3e6b206dacf86687d2d8d9eb2aeb1ca686201e 100644 (file)
@@ -19,7 +19,7 @@
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
 
- $Id: WhiplashSignature.java,v 1.4 2009/11/15 00:03:04 adash Exp $
+ $Id: WhiplashSignature.java,v 1.5 2009/12/15 19:59:38 adash Exp $
  */
 public class WhiplashSignature {
   char[] b64table;
@@ -178,6 +178,11 @@ public class WhiplashSignature {
       int endidx = buf.indexOf(strcom);
       String host = buf.subString(0, endidx);
       //System.out.println("DEBUG: http links extracted host= " + host);
+      
+      buf = buf.subString(endidx);
+      endidx = buf.indexOf(strcom);
+      host += buf.subString(0, endidx);
+
       hosts.addElement(host);
       buf = buf.subString(endidx+strcom.length());
     }
@@ -192,6 +197,11 @@ public class WhiplashSignature {
       int endidx = buf.indexOf(strdot);
       String host = buf.subString(0, endidx);
       //System.out.println("DEBUG: email addr extracted host= " + host);
+
+      buf = buf.subString(endidx);
+      endidx = buf.indexOf(strdot);
+      host += buf.subString(0, endidx);
+
       hosts.addElement(host);
       buf = buf.subString(endidx+strdot.length());
     }
index 85a8ed4d85268de94c62e54ae200a808eac6a02b..d0ddb91f620a5a09a4011c78a4b5510276165055 100644 (file)
@@ -3,7 +3,6 @@ http://www.Chandler.co.uk
 http://www.San.ca
 http://www.Bernardino.co.kr
 http://www.Oil.ca
-http://www.City.co.kr
 http://www.La.co.uk
 http://www.Puente.com
 http://www.Lincoln.ca
@@ -164,7 +163,6 @@ http://www.Herrod.com
 http://www.David.co.uk
 http://www.Samuel.com
 http://www.Raymond.com
-http://www.Calvin.co.kr
 http://www.Lance.com
 http://www.Julian.co.kr
 http://www.Quinlan.co.kr
@@ -295,7 +293,6 @@ http://www.Santa.co.kr
 http://www.Cruz.co.uk
 http://www.Elkhart.co.kr
 http://www.Rapid.com
-http://www.City.com
 http://www.Dover.com
 http://www.Battle.co.kr
 http://www.Creek.ca
@@ -305,7 +302,6 @@ http://www.du.co.uk
 http://www.Lac.co.kr
 http://www.Newburgh.co.uk
 http://www.Michigan.ca
-http://www.City.ca
 http://www.Half.com
 http://www.Moon.ca
 http://www.Bay.co.kr
index d4a56236053bde76078885ab07c6c28a6a4a13f4..ef70923f8f015f3e46df293ebf8f0c13ed83421f 100644 (file)
@@ -3,11 +3,11 @@
 #include<string.h>
 #include<time.h>
 
-#define WORD_FILE "wordList"
+#define WORD_FILE "wordList1"
 #define URL_FILE  "URLList"
 #define ACCOUNT_FILE "accountList"
 #define FILE_NAME "email"
-#define NUM_EMAIL 600
+#define NUM_EMAIL 5000
 
 char** readList(char* fileName,int* num);
 void generateEmails(int,char**,int,char**,int,char**,int,char*);
@@ -135,7 +135,7 @@ void generateEmails(int num_email,char** wl,int word_num,char** ul,int url_num,c
 
      // write Body
      //TODO change this to make length of email small
-     bodyLength = rand() % 200 + 150;
+     bodyLength = rand() % 100 + 50;
 
      for(j=1;j<bodyLength;j++)
      {
index d4525662d7f62e640b6d0f0a632087ac7cfe5f71..967ceb0b5118e1e43a80326158eacaf8d7906381 100644 (file)
@@ -3,7 +3,6 @@ accumsan
 laoreet
 ipsum.
 Curabitur
-consequat,
 lectus
 sit
 amet
@@ -15,7 +14,6 @@ semper
 erat,
 in
 consectetuer
-ipsum
 nunc
 id
 enim.
@@ -79,25 +77,15 @@ ullamcorper
 eu,
 euismod
 fermentum
-vel,
-mauris.
 Integer
-elit,
 pharetra
-ut,
-sed,
 hendrerit
-a,
-arcu.
 Sed
-libero.
 Proin
-mi.
 gravida
 mauris
 Duis
 risus
-odio,
 auctor
 vitae,
 aliquet
@@ -1494,7 +1482,6 @@ convallis,
 aliquam,
 tortor,
 Lorem
-laoreet,
 lobortis,
 hendrerit.
 consectetuer,
index f83947a9a662192883939ca4f3c356d1b8e69d18..58098d3a670853ecac43eb06c408e010ca598230 100644 (file)
@@ -23,15 +23,22 @@ SRC2=${MAINCLASS}2.java \
      GString.java \
      WhiplashSignature.java
 
-FLAGS1=-dsm -transstats -optimize -mainclass ${MAINCLASS}
-FLAGS2=-dsm -transstats -dsmcaching -optimize -mainclass ${MAINCLASS}
-FLAGS3=-dsm -dsmcaching -transstats -prefetch -optimize -mainclass ${MAINCLASS} -excprefetch HashStat.setuser -excprefetch HashStat.incHamCount -excprefetch String.hashCode -excprefetch String.equals -excprefetch HashStat.HashStat -excprefetch GString.toLocalCharArray -excprefetch SpamFilter.main -excprefetch HashEntry.getEngine -excprefetch HashEntry.getSignature -excprefetch HashStat.setuserid -excprefetch HashEntry.hashCode -excprefetch HashEntry.equals -excprefetch GString.GString -excprefetch HashStat.incSpamCount -trueprob 0.98
+FLAGS1=-dsm -transstats -optimize -builddir tmpbuilddirectory3 -mainclass ${MAINCLASS}
+FLAGS2=-dsm -dsmcaching -builddir tmpbuilddirectory1 -transstats -optimize -mainclass ${MAINCLASS}
+FLAGS3=-dsm -dsmcaching -prefetch -builddir tmpbuilddirectory2 -transstats -optimize -mainclass ${MAINCLASS} -excprefetch HashStat.setuser -excprefetch String.hashCode -excprefetch String.equals -excprefetch HashStat.HashStat -excprefetch GString.toLocalCharArray -excprefetch SpamFilter.main -excprefetch HashEntry.getEngine -excprefetch HashEntry.getSignature -excprefetch HashStat.setuserid -excprefetch HashEntry.hashCode -excprefetch HashEntry.equals -excprefetch GString.GString -excprefetch SpamFilter.sendFeedBack -excprefetch HashStat.incSpamCount -excprefetch HashStat.incHamCount -trueprob 0.98
+
+FLAGSNPNC=-dsm -optimize -mainclass ${MAINCLASS}
+FLAGSNPC=-dsm -dsmcaching -optimize -mainclass ${MAINCLASS}
+FLAGSP=-dsm -dsmcaching -prefetch -optimize -mainclass ${MAINCLASS} -excprefetch HashStat.setuser -excprefetch String.hashCode -excprefetch String.equals -excprefetch HashStat.HashStat -excprefetch GString.toLocalCharArray -excprefetch SpamFilter.main -excprefetch HashEntry.getEngine -excprefetch HashEntry.getSignature -excprefetch HashStat.setuserid -excprefetch HashEntry.hashCode -excprefetch HashEntry.equals -excprefetch GString.GString -excprefetch SpamFilter.sendFeedBack -excprefetch HashStat.incSpamCount -excprefetch HashStat.incHamCount -trueprob 0.98
 
 default:
-       ../../../buildscript ${FLAGS1} -o ${MAINCLASS}NPNC ${SRC2}
-       ../../../buildscript ${FLAGS2} -o ${MAINCLASS}NPC ${SRC2}
-       ../../../buildscript ${FLAGS3} -o ${MAINCLASS}N ${SRC2}
+       ../../../buildscript ${FLAGS1} -o ${MAINCLASS}withstatNPNC ${SRC2}
+       ../../../buildscript ${FLAGS2} -o ${MAINCLASS}withstatNPC ${SRC2}
+       ../../../buildscript ${FLAGS3} -o ${MAINCLASS}withstatN ${SRC2}
+       ../../../buildscript ${FLAGSNPNC} -o ${MAINCLASS}NPNC ${SRC2}
+       ../../../buildscript ${FLAGSNPC} -o ${MAINCLASS}NPC ${SRC2}
+       ../../../buildscript ${FLAGSP} -o ${MAINCLASS}N ${SRC2}
 
 clean:
-       rm -rf tmpbuilddirectory
+       rm -rf tmpbuilddirectory*
        rm *.bin
index 4c58a505d52e3de234a99cd118406ceb714c2f51..2683599f1809194cd471f87915f5b713161e2371 100755 (executable)
@@ -29,6 +29,7 @@ function runjava {
    echo "Running Server ... "
    /usr/bin/time -f "%e" ./Server.bin -N $1 $SERVER_ARGS 2>> ${LOGDIR}/server_${1}_${BM_NAME}_java.out &
    # Start the clients
+   sleep 2;
    k=1;
    echo ${BASEDIR}/${BM_DIR} > ~/.tmpdir
    while [ $k -le $1 ]; do