Changeset: dba84ac306ce for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=dba84ac306ce
Modified Files:
        gdk/gdk_utils.c
        monetdb5/scheduler/mut_transforms.c
        monetdb5/scheduler/run_multicore.c
        monetdb5/scheduler/run_multicore.h
Branch: mutation
Log Message:

mdb hack to get mdb working with multicore_pipeline


diffs (127 lines):

diff --git a/gdk/gdk_utils.c b/gdk/gdk_utils.c
--- a/gdk/gdk_utils.c
+++ b/gdk/gdk_utils.c
@@ -926,7 +926,7 @@ GDKvmtrim(void *limit)
                prevrss = rss;
 
                 if (rss > 0.8 * (ssize_t) MT_npages() * MT_pagesize()) {
-                    BBPtrim(0.2 * (ssize_t) MT_npages() * MT_pagesize());
+                    BBPtrim(0.2 * (size_t) MT_npages() * MT_pagesize());
                     highload = 1;
                 } else {
                     highload = 0;
diff --git a/monetdb5/scheduler/mut_transforms.c 
b/monetdb5/scheduler/mut_transforms.c
--- a/monetdb5/scheduler/mut_transforms.c
+++ b/monetdb5/scheduler/mut_transforms.c
@@ -1134,17 +1134,43 @@ mutationMatPack(Client cntxt, Mutant m) 
        p= old[stmtLoop];
 
        // Temporary hack to break in mdb
-       if ( getModuleId(old[stmtLoop-1]) == schedulerRef) 
+/*     if ( getModuleId(old[stmtLoop-1]) == schedulerRef) 
        {
                if (getFunctionId(old[stmtLoop-1]) == multicoreRef)
                {
                        profiler = m->src->profiler[stmtLoop].trace;
                        // Temporary hack to break in mdb
                         newStmt(m->src, mdbRef, startRef); // The instruction 
below should be remembered if done correct                                      
          
+                        m->src->profiler[m->src->stop-1].trace = profiler;
+
+                        newStmt(m->src, mdbRef, startRef); // The instruction 
below should be remembered if done correct                                      
          
+                        m->src->profiler[m->src->stop-1].trace = profiler;
+
+                        newStmt(m->src, mdbRef, startRef); // The instruction 
below should be remembered if done correct                                      
          
+                        m->src->profiler[m->src->stop-1].trace = profiler;
+
+                        newStmt(m->src, mdbRef, startRef); // The instruction 
below should be remembered if done correct                                      
          
+                        m->src->profiler[m->src->stop-1].trace = profiler;
+
+                        newStmt(m->src, mdbRef, startRef); // The instruction 
below should be remembered if done correct                                      
          
+                        m->src->profiler[m->src->stop-1].trace = profiler;
+
+                        newStmt(m->src, mdbRef, startRef); // The instruction 
below should be remembered if done correct                                      
          
+                        m->src->profiler[m->src->stop-1].trace = profiler;
+
+                        newStmt(m->src, mdbRef, startRef); // The instruction 
below should be remembered if done correct                                      
          
+                        m->src->profiler[m->src->stop-1].trace = profiler;
+
+                        newStmt(m->src, mdbRef, startRef); // The instruction 
below should be remembered if done correct                                      
          
+                        m->src->profiler[m->src->stop-1].trace = profiler;
+
+
+//                        newStmt(m->src, mdbRef, trapRef); // The instruction 
below should be remembered if done correct                                      
          
                        // newStmt(m->src, mdbRef, setCatchRef); // The 
instruction below should be remembered if done correct                          
                      
-                        m->src->profiler[m->src->stop-1].trace = profiler;
+ //                       m->src->profiler[m->src->stop-1].trace = profiler;   
                }
        }
+*/
 
         if (stmtLoop == pc){
                //  Be careful not to change the size of the stack,
diff --git a/monetdb5/scheduler/run_multicore.c 
b/monetdb5/scheduler/run_multicore.c
--- a/monetdb5/scheduler/run_multicore.c
+++ b/monetdb5/scheduler/run_multicore.c
@@ -31,6 +31,7 @@
 #include "mut_transforms.h"
 #include "mut_policy.h"
 #include "mut_stopRuns.h"
+#include "mdb.h"
 
 void
 multicorePrint(Client cntxt, Mutant m)
@@ -46,7 +47,7 @@ RUNmulticore(Client cntxt, MalBlkPtr mb,
        Mutant mutant;
        str msg;
        lng clk, clkInit;
-       int isRun, err;
+       int isRun, err, k;
 
        int *ret = (int*) getArgReference(stk,pci,0);
 
@@ -93,6 +94,8 @@ RUNmulticore(Client cntxt, MalBlkPtr mb,
        {       
                // Keep old version in the history
                // and collect the multicore arguments
+               int k1;
+               
                mutant = (Mutant) GDKzalloc(sizeof(struct MUTANT));
                mutant->next = ((Mutant)mb->mutants);
                mutant->currentRun = mutant->next->currentRun + 1;
@@ -111,7 +114,24 @@ RUNmulticore(Client cntxt, MalBlkPtr mb,
                malGarbageCollector(mb);
 
                clk = GDKusec();
-               msg = runMALdataflow(cntxt, mutant->src, getPC(mb,pci), 
mutant->stk);
+               
+               // Hack to get mdb working with run_multicore pipeline. Force 
mdb to ignore dataflow and execute instructions in serial mode, by ignoring
+               // the parallel data flow block.
+
+               DEBUG_MDB
+                       MDBstart(cntxt, mutant->src, mutant->stk, 
getInstrPtr(mutant->src,1));
+
+               if(mutant->stk->cmd =='n')      
+               {
+                       for(k= 2;k<mutant->src->stop;k++)
+                                       runMALsequence(cntxt, mutant->src, k, 
k+1, mutant->stk, 0, 0);
+               }
+               else    
+                       runMALdataflow(cntxt, mutant->src, k1=getPC(mb,pci), 
mutant->stk);
+               
+               DEBUG_MDB
+                       MDBstop(cntxt, mutant->src, mutant->stk, 
getInstrPtr(mutant->src,mutant->src->stop));
+               
                mutant->src->calls++;
                mutant->runtime += GDKusec()- clk;
                mutant->totalQueryTime = GDKusec() - clkInit;
diff --git a/monetdb5/scheduler/run_multicore.h 
b/monetdb5/scheduler/run_multicore.h
--- a/monetdb5/scheduler/run_multicore.h
+++ b/monetdb5/scheduler/run_multicore.h
@@ -63,6 +63,7 @@ typedef struct MUTANT{
        
 } *Mutant;
 
+#define DEBUG_MDB if(0)                                // activate mdb if 1
 #define DEBUG_PRINT_TIME if(1)                 
 #define DEBUG_MULTICORE if(1)
 #define DEBUG_MULTICORE_PRINT_BALANCE if(0)    
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to