changes to enable no caching and no prefetching by adding DCACHE flag to
authoradash <adash>
Wed, 13 Aug 2008 01:31:32 +0000 (01:31 +0000)
committeradash <adash>
Wed, 13 Aug 2008 01:31:32 +0000 (01:31 +0000)
buildscript. Tested on Em3d

Robust/src/Benchmarks/Prefetch/Em3d/dsm/makefile
Robust/src/Benchmarks/Prefetch/bm.txt
Robust/src/Runtime/DSTM/interface/addUdpEnhance.h
Robust/src/Runtime/DSTM/interface/dstmserver.c
Robust/src/Runtime/DSTM/interface/prelookup.c
Robust/src/Runtime/DSTM/interface/signal.c
Robust/src/Runtime/DSTM/interface/trans.c
Robust/src/buildscript

index ca304c77eb1b1c15850dc83c514540dce938236a..f0304c52f227996a75b6b7c8fa500752dfddae78 100644 (file)
@@ -14,22 +14,28 @@ SRC3=${MAINCLASS}2.java \
        EVector.java 
 
 FLAGS=-dsm -prefetch -optimize -excprefetch Em3d.main -excprefetch BiGraph.create -excprefetch Node.Node -excprefetch Node.fillTable -excprefetch Node.makeUniqueNeighbors -excprefetch Node.makeFromNodes -excprefetch Node.updateFromNodes -debug -mainclass ${MAINCLASS} -trueprob 0.91
-FLAGS1=-dsm -prefetch -optimize -excprefetch Node.makeUniqueNeighbors -excprefetch EVector.ensureCapacity -excprefetch EVector.addElement -excprefetch BiGraph.makeFromNodes -excprefetch EVector.elementAt -excprefetch BiGraph.initializeNodes -excprefetch BiGraph.allocateNodes -mainclass ${MAINCLASS} -trueprob 0.91
-FLAGS2=-dsm -optimize -mainclass ${MAINCLASS}
+FLAGS1=-dsm -prefetch -dsmcaching -optimize -excprefetch Node.makeUniqueNeighbors -excprefetch EVector.ensureCapacity -excprefetch EVector.addElement -excprefetch BiGraph.makeFromNodes -excprefetch EVector.elementAt -excprefetch BiGraph.initializeNodes -excprefetch BiGraph.allocateNodes -mainclass ${MAINCLASS} -trueprob 0.91
+FLAGS2=-dsm -dsmcaching -optimize -excprefetch Node.makeUniqueNeighbors -excprefetch EVector.ensureCapacity -excprefetch EVector.addElement -excprefetch BiGraph.makeFromNodes -excprefetch EVector.elementAt -excprefetch BiGraph.initializeNodes -excprefetch BiGraph.allocateNodes -mainclass ${MAINCLASS} -trueprob 0.91
+FLAGS3=-dsm -optimize -mainclass ${MAINCLASS}
 
 default:
 #      ../../../../buildscript ${FLAGS2} -o ${MAINCLASS}NP ${SRC}
 #      ../../../../buildscript ${FLAGS} -o ${MAINCLASS} ${SRC}
-       ../../../../buildscript ${FLAGS2} -o ${MAINCLASS}NNP ${SRC3}
+       ../../../../buildscript ${FLAGS3} -o ${MAINCLASS}NPNC ${SRC3}
+       ../../../../buildscript ${FLAGS2} -o ${MAINCLASS}NP ${SRC3}
        ../../../../buildscript ${FLAGS1} -o ${MAINCLASS}N ${SRC3}
-       cp ${MAINCLASS}NNP.bin ${MAINCLASS}1NP.bin
+       cp ${MAINCLASS}NPNC.bin ${MAINCLASS}1NPNC.bin
+       cp ${MAINCLASS}NP.bin ${MAINCLASS}1NP.bin
        cp ${MAINCLASS}N.bin ${MAINCLASS}1.bin
-       cp ${MAINCLASS}NNP.bin ${MAINCLASS}2NP.bin
+       cp ${MAINCLASS}NPNC.bin ${MAINCLASS}2NPNC.bin
+       cp ${MAINCLASS}NP.bin ${MAINCLASS}2NP.bin
        cp ${MAINCLASS}N.bin ${MAINCLASS}2.bin
-       cp ${MAINCLASS}NNP.bin ${MAINCLASS}3NP.bin
+       cp ${MAINCLASS}NPNC.bin ${MAINCLASS}3NPNC.bin
+       cp ${MAINCLASS}NP.bin ${MAINCLASS}3NP.bin
+       cp ${MAINCLASS}N.bin ${MAINCLASS}3.bin
+       cp ${MAINCLASS}NPNC.bin ${MAINCLASS}3NPNC.bin
+       cp ${MAINCLASS}NP.bin ${MAINCLASS}3NP.bin
        cp ${MAINCLASS}N.bin ${MAINCLASS}3.bin
-       cp ${MAINCLASS}NNP.bin ${MAINCLASS}4NP.bin
-       cp ${MAINCLASS}N.bin ${MAINCLASS}4.bin
 
 clean:
        rm -rf tmpbuilddirectory
index 31331325ed0150e70cccf968b53ca1ffe26bb319..fbee3ceebf4c73c64efb37342b1c73a595163dee 100644 (file)
@@ -1,7 +1,11 @@
-JGFSORBenchSizeA:SOR/dsm::2:3:4:sorverA
-JGFLUFactBenchSizeA:LUFact/dsm::2:4:lufactverA
+JGFSORBenchSizeA:SOR/dsm:1:2:3:4:sorverA
+JGFSORBenchSizeC:SOR/dsm:1:2:3:4:sorverC
+JGFSORBenchSizeD:SOR/dsm:1:2:3:4:sorverD
+JGFMolDynBenchSizeA:Moldyn/dsm:1:2:3:4:moldynverA
+JGFLUFactBenchSizeA:LUFact/dsm:1:2:3:4:lufactverA
 MatrixMultiply:MatrixMultiply:1 200 30:2 200 30:3 200 30:4 200 30:mmver200
 MatrixMultiply:MatrixMultiply:1 600:2 600:3 600:4 600:mmver600
 Em3d:Em3d/dsm:-T 1 -N 4000 -d 130 -p -i 3:-T 2 -N 4000 -d 130 -p -i 3:-T 3 -N 4000 -d 130 -p -i 3:-T 4 -N 4000 -d 130 -p -i 3:em3dver40001303
+Em3d:Em3d/dsm:-T 1 -N 4000 -d 130 -p -i 100000:-T 2 -N 4000 -d 130 -p -i 100000:-T 3 -N 4000 -d 130 -p -i 100000:-T 4 -N 4000 -d 130 -p -i 100000:em3dver4000130100000
 Chase:Chase:::::chase
 Array:Array:::::array
index f68e5ca08ba1768238a5662ef84eb1c05c8cbba0..1691473d6ed3b5930e170c1e89bd77cf4b3002ca 100644 (file)
@@ -2,6 +2,7 @@
 #define _ADDUDPENHANCE_H
 
 #include "dstm.h"
+#include "mlookup.h"
 
 
 /*******************************
index 0928321c310245151796b6cbe686c879d8c0a515..e5a2beedf8b87a0a1cf9239870787124bc2d0ab0 100644 (file)
@@ -469,12 +469,6 @@ char handleTransReq(fixed_data_t *fixed, trans_commit_data_t *transinfo, unsigne
               numBytes += size;
               /* Send TRANS_DISAGREE to Coordinator */
               control = TRANS_DISAGREE;
-#ifdef CHECKTA
-  char b[] = "version mismatch";
-  char c[] = "object type";
-  TABORT3(__func__, b, c, TYPE(mobj));
-#endif
-
             }
           } else {/* If Obj is not locked then lock object */
             /* Save all object oids that are locked on this machine during this transaction request call */
@@ -491,12 +485,6 @@ char handleTransReq(fixed_data_t *fixed, trans_commit_data_t *transinfo, unsigne
               size += sizeof(objheader_t);
               numBytes += size;
               control = TRANS_DISAGREE;
-
-#ifdef CHECKTA
-  char b[] = "version mismatch";
-  char c[] = "object type";
-  TABORT3(__func__, b, c, TYPE(mobj));
-#endif
             }
           }
         }
@@ -504,6 +492,7 @@ char handleTransReq(fixed_data_t *fixed, trans_commit_data_t *transinfo, unsigne
        
        /* send TRANS_DISAGREE and objs*/
     if(v_nomatch > 0) {
+#ifdef CACHE
       char *objs = calloc(1, numBytes);
       int j, offset = 0;
       for(j = 0; j<objvernotmatch; j++) {
@@ -514,6 +503,7 @@ char handleTransReq(fixed_data_t *fixed, trans_commit_data_t *transinfo, unsigne
         memcpy(objs+offset, header, size);
         offset += size;
       }
+#endif
       if (objlocked > 0) {
         for(j = 0; j < objlocked; j++) {
           if((headptr = mhashSearch(oidlocked[j])) == NULL) {
@@ -525,12 +515,14 @@ char handleTransReq(fixed_data_t *fixed, trans_commit_data_t *transinfo, unsigne
         free(oidlocked);
       }
       send_data(acceptfd, &control, sizeof(char));
+#ifdef CACHE
       send_data(acceptfd, &numBytes, sizeof(int));
       send_data(acceptfd, objs, numBytes);
       transinfo->objvernotmatch = oidvernotmatch;
       transinfo->numvernotmatch = objvernotmatch;
       free(objs);
       free(transinfo->objvernotmatch);
+#endif
       return control;
     }
 
index 7e81d5f394fce7c65afbaa7755a7df8326399fd4..f003e0f1645a712112656cb056e7c50c8dabe67f 100644 (file)
@@ -191,6 +191,7 @@ unsigned int prehashResize(unsigned int newsize) {
 
 //Note: This is based on the implementation of the inserting a key in the first position of the hashtable 
 void prehashClear() {
+#ifdef CACHE
   int i, isFirstBin;
   prehashlistnode_t *ptr, *prev, *curr;
   
@@ -220,5 +221,6 @@ void prehashClear() {
   }
   pflookup.hack2=pflookup.hack;
   pflookup.hack=oldcache;
+#endif
 }
 
index 942c83203794a645e1284a743347e8c9cc45771d..b670548a6d991c87055c11bfda55c77a1ca8f6d6 100644 (file)
@@ -21,9 +21,9 @@ void transStatsHandler(int sig, siginfo_t* info, void *context) {
   printf("nmhashSearch = %d\n", nmhashSearch);
   printf("nprehashSearch = %d\n", nprehashSearch);
   printf("nRemoteReadSend = %d\n", nRemoteSend);
-  int i;
   //TODO Remove later
   /*
+  int i;
   for(i=0; i<numprefetchsites; i++) {
     printf("siteid = %d,  callCount = %d\n", i, evalPrefetch[i].callcount);
   }
index c0dfe4e5f038c80a54e090e1cee1c2c5c618d3d4..2f28d677f5547922c67cf037eb859e1e86b91538 100644 (file)
 /* Global Variables */
 extern int classsize[];
 pfcstats_t *evalPrefetch;
+extern pthread_mutex_t mainobjstore_mutex;// Mutex to lock main Object store
 objstr_t *prefetchcache; //Global Prefetch cache
 pthread_mutex_t prefetchcache_mutex;// Mutex to lock Prefetch Cache
 pthread_mutexattr_t prefetchcache_mutex_attr; /* Attribute for lock to make it a recursive lock */
-extern pthread_mutex_t mainobjstore_mutex;// Mutex to lock main Object store
 extern prehashtable_t pflookup; //Global Prefetch cache's lookup table
 pthread_t wthreads[NUM_THREADS]; //Worker threads for working on the prefetch queue
 pthread_t tPrefetch;           /* Primary Prefetch thread that processes the prefetch queue */
@@ -194,10 +194,12 @@ int dstmStartup(const char * option) {
   transInit();
   
   fd=startlistening();
-  udpfd = udpInit();
   pthread_attr_init(&attr);
   pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+#ifdef CACHE
+  udpfd = udpInit();
   pthread_create(&udp_thread_Listen, &attr, udpListenBroadcast, (void*)udpfd);
+#endif
   if (master) {
     pthread_create(&thread_Listen, &attr, dstmListen, (void*)fd);
     return 1;
@@ -238,24 +240,24 @@ void *pCacheAlloc(objstr_t *store, unsigned int size) {
  * prefetch requests */
 
 void transInit() {
-  int t, rc;
-  int retval;
   //Create and initialize prefetch cache structure
+#ifdef CACHE
   prefetchcache = objstrCreate(PREFETCH_CACHE_SIZE);
   initializePCache();
   if((evalPrefetch = initPrefetchStats()) == NULL) {
     printf("%s() Error allocating memory at %s, %d\n", __func__, __FILE__, __LINE__);
     exit(0);
   }
+#endif
   
   /* Initialize attributes for mutex */
   pthread_mutexattr_init(&prefetchcache_mutex_attr);
   pthread_mutexattr_settype(&prefetchcache_mutex_attr, PTHREAD_MUTEX_RECURSIVE_NP);
   
   pthread_mutex_init(&prefetchcache_mutex, &prefetchcache_mutex_attr);
-  
   pthread_mutex_init(&notifymutex, NULL);
   pthread_mutex_init(&atomicObjLock, NULL);
+#ifdef CACHE
   //Create prefetch cache lookup table
   if(prehashCreate(HASH_SIZE, LOADFACTOR)) {
     printf("ERROR\n");
@@ -268,18 +270,22 @@ void transInit() {
   mcpileqInit();
   
   //Create the primary prefetch thread 
+  int retval;
   do {
     retval=pthread_create(&tPrefetch, NULL, transPrefetch, NULL);
   } while(retval!=0);
   pthread_detach(tPrefetch);
+#endif
 }
 
 /* This function stops the threads spawned */
 void transExit() {
+#ifdef CACHE
   int t;
   pthread_cancel(tPrefetch);
   for(t = 0; t < NUM_THREADS; t++)
     pthread_cancel(wthreads[t]);
+#endif
   
   return;
 }
@@ -352,44 +358,39 @@ objheader_t *transRead(transrecord_t *record, unsigned int oid) {
 #else
     return objcopy;
 #endif
-  } else if((tmp = (objheader_t *) prehashSearch(oid)) != NULL) { 
+  } else {
+#ifdef CACHE
+    if((tmp = (objheader_t *) prehashSearch(oid)) != NULL) { 
 #ifdef TRANSSTATS
-    nprehashSearch++;
+      nprehashSearch++;
 #endif
-#ifdef CHECKTA
-    printf("Prefetch cache read, oid = %x, oidtype =%d\n", oid, TYPE(tmp));
-    fflush(stdout);
-#endif
-    /* Look up in prefetch cache */
-    GETSIZE(size, tmp);
-    size+=sizeof(objheader_t);
-    objcopy = (objheader_t *) objstrAlloc(record->cache, size);
-    memcpy(objcopy, tmp, size);
-    /* Insert into cache's lookup table */
-    chashInsert(record->lookupTable, OID(tmp), objcopy); 
+      /* Look up in prefetch cache */
+      GETSIZE(size, tmp);
+      size+=sizeof(objheader_t);
+      objcopy = (objheader_t *) objstrAlloc(record->cache, size);
+      memcpy(objcopy, tmp, size);
+      /* Insert into cache's lookup table */
+      chashInsert(record->lookupTable, OID(tmp), objcopy); 
 #ifdef COMPILER
-    return &objcopy[1];
+      return &objcopy[1];
 #else
-    return objcopy;
+      return objcopy;
+#endif
+    }
 #endif
-  } else {
     /* Get the object from the remote location */
     if((machinenumber = lhashSearch(oid)) == 0) {
       printf("Error: %s() No machine found for oid =% %s,%dx\n",__func__, machinenumber, __FILE__, __LINE__);
       return NULL;
     }
     objcopy = getRemoteObj(record, machinenumber, oid);
-    
+
     if(objcopy == NULL) {
       printf("Error: Object not found in Remote location %s, %d\n", __FILE__, __LINE__);
       return NULL;
     } else {
 #ifdef TRANSSTATS
-    nRemoteSend++;
-#endif
-#ifdef CHECKTA
-    printf("Remote read, oid = %x, oidtype =%d\n", oid, TYPE(objcopy));
-    fflush(stdout);
+      nRemoteSend++;
 #endif
       STATUS(objcopy)=0;      
 #ifdef COMPILER
@@ -629,10 +630,6 @@ int transCommit(transrecord_t *record) {
   if(treplyctrl == TRANS_ABORT) {
 #ifdef TRANSSTATS
     numTransAbort++;
-#endif
-#ifdef CHECKTA
-    char a[] = "Aborting";
-    TABORT1(a);
 #endif
     /* Free Resources */
     objstrDelete(record->cache);
@@ -644,10 +641,6 @@ int transCommit(transrecord_t *record) {
   } else if(treplyctrl == TRANS_COMMIT) {
 #ifdef TRANSSTATS
     numTransCommit++;
-#endif
-#ifdef CHECKTA
-    char a[] = "Commiting";
-    TABORT1(a);
 #endif
     /* Free Resources */
     objstrDelete(record->cache);
@@ -713,6 +706,7 @@ void *transRequest(void *threadarg) {
   /* Read control message from Participant */
   recv_data(sd, &control, sizeof(char));
   /* Recv Objects if participant sends TRANS_DISAGREE */
+#ifdef CACHE
   if(control == TRANS_DISAGREE) {
     int length;
     recv_data(sd, &length, sizeof(int));
@@ -730,11 +724,6 @@ void *transRequest(void *threadarg) {
       objheader_t * header;
       header = (objheader_t *) (((char *)newAddr) + offset);
       oidToPrefetch = OID(header);
-#ifdef CHECKTA
-      printf("Trans disagree for oid = %x: ", OID(header));
-      char a[] = "object type";
-      TABORT8(__func__, a, TYPE(header));
-#endif
       int size = 0;
       GETSIZE(size, header);
       size += sizeof(objheader_t);
@@ -750,6 +739,7 @@ void *transRequest(void *threadarg) {
       offset += size;
     }
   }
+#endif
 
   recvcontrol = control;
   /* Update common data structure and increment count */
@@ -793,6 +783,7 @@ void *transRequest(void *threadarg) {
   }
   */
 
+#ifdef CACHE
   if(*(tdata->replyctrl) == TRANS_COMMIT) {
     int retval;
      /* Update prefetch cache */
@@ -809,6 +800,7 @@ void *transRequest(void *threadarg) {
       }
     }
   }
+#endif
   
   /* Send the final response such as TRANS_COMMIT or TRANS_ABORT 
    * to all participants in their respective socket */
@@ -861,8 +853,10 @@ void decideResponse(thread_data_array_t *tdata) {
     /* Send Abort */
     *(tdata->replyctrl) = TRANS_ABORT;
     *(tdata->replyretry) = 0;
+#ifdef CACHE
     /* clear objects from prefetch cache */
     cleanPCache(tdata);
+#endif
   } else if(transagree == tdata->buffer->f.mcount){
     /* Send Commit */
     *(tdata->replyctrl) = TRANS_COMMIT;
@@ -998,19 +992,6 @@ void *handleLocalReq(void *threadarg) {
           v_nomatch++;
           /* Send TRANS_DISAGREE to Coordinator */
           localtdata->tdata->recvmsg[localtdata->tdata->thread_id].rcv_status = TRANS_DISAGREE;
-#ifdef CHECKTA
-      printf("Trans disagree for oid = %x: ", OID(mobj));
-      char a[] = "object type";
-      TABORT8(__func__, a, TYPE(mobj));
-#endif
-
-#ifdef CHECKTA
-  //char a[] = "mid";
-  //char b[] = "version mismatch";
-  //char c[] = "object type";
-  //char d[] = "oid";
-  //TABORT9(__func__, b, a, c, d, localtdata->tdata->mid, TYPE(mobj), OID(mobj));
-#endif
           break;
         }
       } else {
@@ -1024,18 +1005,6 @@ void *handleLocalReq(void *threadarg) {
           v_nomatch++;
           /* Send TRANS_DISAGREE to Coordinator */
           localtdata->tdata->recvmsg[localtdata->tdata->thread_id].rcv_status = TRANS_DISAGREE;
-#ifdef CHECKTA
-      printf("Trans disagree for oid = %x: ", OID(mobj));
-      char a[] = "object type";
-      TABORT8(__func__, a, TYPE(mobj));
-#endif
-#ifdef CHECKTA
-  //char a[] = "mid";
-  //char b[] = "version mismatch";
-  //char c[] = "object type";
-  //char d[] = "oid";
-  //TABORT9(__func__, b, a, c, d, localtdata->tdata->mid, TYPE(mobj), OID(mobj));
-#endif
           break;
         }
       }
@@ -1047,13 +1016,6 @@ void *handleLocalReq(void *threadarg) {
   }
   /* Condition to send TRANS_SOFT_ABORT */
   if((v_matchlock > 0 && v_nomatch == 0) || (numoidnotfound > 0 && v_nomatch == 0)) {
-#ifdef CHECKTA
-  //char a[] = "mid";
-  //char b[] = "version mismatch";
-  //char c[] = "object type";
-  //TABORT7(__func__, b, a, c, localtdata->tdata->mid, TYPE(mobj));
-  printf("%s() Soft abort\n", __func__);
-#endif
     localtdata->tdata->recvmsg[localtdata->tdata->thread_id].rcv_status = TRANS_SOFT_ABORT;
   }
   
@@ -1084,6 +1046,7 @@ void *handleLocalReq(void *threadarg) {
       pthread_exit(NULL);
     }
   } else if(*(localtdata->tdata->replyctrl) == TRANS_COMMIT) {
+#ifdef CACHE
     /* Invalidate objects in other machine cache */
     if(localtdata->tdata->buffer->f.nummod > 0) {
       int retval;
@@ -1092,6 +1055,7 @@ void *handleLocalReq(void *threadarg) {
         return;
       }
     }
+#endif
     if(transComProcess(localtdata) != 0) {
       printf("Error in transComProcess() %s,%d\n", __FILE__, __LINE__);
       fflush(stdout);
@@ -1432,7 +1396,9 @@ unsigned short getObjType(unsigned int oid) {
   short fieldoffset[] ={};
 
   if ((objheader = (objheader_t *) mhashSearch(oid)) == NULL) {
+#ifdef CACHE
     if ((objheader = (objheader_t *) prehashSearch(oid)) == NULL) {
+#endif
       unsigned int mid = lhashSearch(oid);
       int sd = getSock2(transReadSockPool, mid);
       char remotereadrequest[sizeof(char)+sizeof(unsigned int)];
@@ -1452,6 +1418,7 @@ unsigned short getObjType(unsigned int oid) {
         /* Read object if found into local cache */
         int size;
         recv_data(sd, &size, sizeof(int));
+#ifdef CACHE
         pthread_mutex_lock(&prefetchcache_mutex);
         if ((objheader = prefetchobjstrAlloc(size)) == NULL) {
           printf("Error: %s() objstrAlloc error for copying into prefetch cache %s, %d\n", __func__, __FILE__, __LINE__);
@@ -1460,8 +1427,24 @@ unsigned short getObjType(unsigned int oid) {
         pthread_mutex_unlock(&prefetchcache_mutex);
         recv_data(sd, objheader, size);
         prehashInsert(oid, objheader);
+        return TYPE(objheader);
+#else
+        char *buffer;
+        if((buffer = calloc(1, size)) == NULL) {
+          printf("%s() Calloc Error %s at line %d\n", __func__, __FILE__, __LINE__);
+          fflush(stdout);
+          return 0;
+        }
+        recv_data(sd, buffer, size);
+        objheader = (objheader_t *)buffer;
+        unsigned short type = TYPE(objheader);
+        free(buffer);
+        return type;
+#endif
       }
+#ifdef CACHE
     }
+#endif
   }
   return TYPE(objheader);
 }
@@ -1741,10 +1724,12 @@ void threadNotify(unsigned int oid, unsigned short version, unsigned int tid) {
                                printf("threadNotify(): New version %d has not changed since last version for oid = %d, %s, %d\n", version, oid, __FILE__, __LINE__);
                                return;
                        } else {
+#ifdef CACHE
                                /* Clear from prefetch cache and free thread related data structure */
                                if((ptr = prehashSearch(oid)) != NULL) {
                                        prehashRemove(oid);
                                }
+#endif
                                pthread_cond_signal(&(ndata->threadcond));
                        }
                }
index a9bea668513c68dc57fbc592535380601d3f2ff7..a257d8ead84f5a979593cbfd7c4bdcdbcf53b009 100755 (executable)
@@ -4,6 +4,7 @@ printhelp() {
 echo -robustroot set up the ROBUSTROOT to directory other than default one
 echo -dsm distributed shared memory
 echo -trueprob double - probabiltiy of true branch
+echo -dsmcaching -enable caching in dsm runtime
 echo -mac distributed shared memory mac support
 echo -check generate check code
 echo -dmalloc link in dmalloc
@@ -190,8 +191,10 @@ RAWDEBUGFLAG=true
 EXTRAOPTIONS="$EXTRAOPTIONS -g"
 elif [[ $1 = '-runtimedebug' ]]
 then
-#EXTRAOPTIONS="$EXTRAOPTIONS -DDEBUG"
-EXTRAOPTIONS="$EXTRAOPTIONS -DCHECKTB"
+EXTRAOPTIONS="$EXTRAOPTIONS -DCHECKTA"
+elif [[ $1 = '-dsmcaching' ]]
+then
+EXTRAOPTIONS="$EXTRAOPTIONS -DCACHE"
 elif [[ $1 = '-nooptimize' ]]
 then
 EXTRAOPTIONS="$EXTRAOPTIONS -O0"