Changeset: 6a375679ddef for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6a375679ddef
Modified Files:
        monetdb5/scheduler/Tests/8RunsJoinCorrectness.mal
        monetdb5/scheduler/mut_transforms.c
        monetdb5/scheduler/run_multicore.h
Branch: mutation
Log Message:

second mat.pack added


diffs (166 lines):

diff --git a/monetdb5/scheduler/Tests/8RunsJoinCorrectness.mal 
b/monetdb5/scheduler/Tests/8RunsJoinCorrectness.mal
--- a/monetdb5/scheduler/Tests/8RunsJoinCorrectness.mal
+++ b/monetdb5/scheduler/Tests/8RunsJoinCorrectness.mal
@@ -48,14 +48,16 @@ exit z;
        ticks:= profiler.getTrace("ticks");
        thread:= profiler.getTrace("thread");
        time1:= profiler.getTrace("time");
-   io.print(time1,thread,ticks,stmt);
+#       io.print(time1,thread,ticks,stmt);
 end query;
 
 optimizer.multicore("user","query");
 function testrun();
 
-        a:= initializeFirst();
+       a:= initializeFirst();
+        bat.setReadMode(a);
         b:= initializeNext();
+        bat.setReadMode(b);
         user.query(0,a,b);
         user.query(1,a,b);
         user.query(2,a,b);
@@ -67,6 +69,15 @@ function testrun();
 #        user.query(8,a,b);
 #        user.query(9,a,b);
 #        user.query(10,a,b);
-
+#        user.query(11,a,b);
+#        user.query(12,a,b);
+#        user.query(13,a,b);
+#        user.query(14,a,b);
+#        user.query(15,a,b);
+#        user.query(16,a,b);
+#        user.query(17,a,b);
+#        user.query(18,a,b);
+#        user.query(19,a,b);
+#        user.query(20,a,b);
 end testrun;
 testrun();
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
@@ -51,17 +51,18 @@ mutationJoin(Client cntxt, Mutant m){
                if ( i == pc){
                        /* replace the instruction, e.g. with a partioned one.
                           Dont use any partition intelligence, simple half 
split
-                          v := algebra.join(b,Y) =>
+                          x1,x2 := algebra.join(b,Y) =>
                                b1 := bat.partition(b,2,0);
                                b2 := bat.partition(b,2,1);
                                v1,z1:= algebra.join(b1,Y);
                                v2,z2:= algebra.join(b2,Y);
-                               v:= mat.pack(v1,v2);
+                               x1:= mat.pack(v1,v2);
+                               x2:= mat.pack(z1,z2);
                          Be careful not to change the size of the stack,
                          for we can not easily pass it back to the 
                          current interpreter call sequence
                        */
-                       if ( m->stk->stksize < m->src->vtop + 5){
+                       if ( m->stk->stksize < m->src->vtop + 7){
                                pushInstruction(m->src,p);
                                continue;
                        }
@@ -91,11 +92,6 @@ mutationJoin(Client cntxt, Mutant m){
                        // inherit profiling
                        m->src->profiler[m->src->stop-1].trace = profiler;
 
-                       q= newStmt(m->src, languageRef, passRef);
-                       q = pushArgument(m->src,q,getArg(p,p->retc));
-                       // inherit profiling
-                       m->src->profiler[m->src->stop-1].trace = profiler;
-
                        q= copyInstruction(p);
                        getArg(q,2)= b1;
                        v1 = getArg(q,0)= newTmpVariable(m->src,TYPE_any);
@@ -104,11 +100,6 @@ mutationJoin(Client cntxt, Mutant m){
                        // inherit profiling
                        m->src->profiler[m->src->stop-1].trace = profiler;
 
-                       q= newStmt(m->src, languageRef, passRef);
-                       q = pushArgument(m->src,q,b1);
-                       // inherit profiling
-                       m->src->profiler[m->src->stop-1].trace = profiler;
-
                        q= copyInstruction(p);
                        getArg(q,2)= b2;
                        v2 = getArg(q,0)= newTmpVariable(m->src,TYPE_any);
@@ -118,19 +109,10 @@ mutationJoin(Client cntxt, Mutant m){
                        m->src->profiler[m->src->stop-1].trace = profiler;
 
                        q= newStmt(m->src, languageRef, passRef);
-                       q = pushArgument(m->src,q,b2);
-                       // inherit profiling
-                       m->src->profiler[m->src->stop-1].trace = profiler;
-
-                       //To silent the scheduler artifact where smallest 
instructions is always scheduled in a serial manner
-                       q= newStmt(m->src, languageRef, passRef);
                        q = pushArgument(m->src,q, getArg(p,p->retc+1));
                        // inherit profiling
                        m->src->profiler[m->src->stop-1].trace = profiler;
 
-                       (void)z1;
-                       (void)z2;
-
                        // replace its use in other mat packs
                        for (j = i+1; j < limit; j++) {
                                q= old[j];
@@ -142,7 +124,25 @@ mutationJoin(Client cntxt, Mutant m){
                                                        delArgument(old[j],k);
                                                        old[j] = 
setArgument(m->src,old[j],k, v2);
                                                        old[j] = 
setArgument(m->src,old[j],k, v1);
+                                                       break;
                                                }
+                                                               
+                               }
+                               if(matpc>0 && j+1<limit)
+                               {       
+                                       j++;
+                                       q= old[j];
+                                       if ( getModuleId(q) == matRef && 
getFunctionId(q) == packRef){
+                                               for( k= old[j]->retc; k < 
old[j]->argc; k++)
+                                                       if ( getArg(q,k) == 
getArg(p,1)){
+                                                               // replace this 
argument 
+                                                               matpc++;
+                                                               
delArgument(old[j],k);
+                                                               old[j] = 
setArgument(m->src,old[j],k, z2);
+                                                               old[j] = 
setArgument(m->src,old[j],k, z1);
+                                                               break;
+                                                       }
+                                       }
                                }
                        }
 
@@ -153,6 +153,11 @@ mutationJoin(Client cntxt, Mutant m){
                                q= pushArgument(m->src,q,v2);
                                m->src->profiler[m->src->stop-1].trace = 
profiler;
 
+                               q= newStmt(m->src,matRef,packRef);
+                               getArg(q,0)= getArg(p,1);
+                               q= pushArgument(m->src,q,z1);
+                               q= pushArgument(m->src,q,z2);
+                               m->src->profiler[m->src->stop-1].trace = 
profiler;
                        }
 
                        //pushInstruction(m->src,p);
@@ -232,7 +237,6 @@ mutationSelect(Client cntxt, Mutant m){
                        // inherit profiling
                        m->src->profiler[m->src->stop-1].trace = profiler;
 
-
                        q= copyInstruction(p);
                        getArg(q,1)= b1;
                        v1 = getArg(q,0)= newTmpVariable(m->src,TYPE_any);
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
@@ -48,7 +48,7 @@ typedef struct MUTANT{
        int target;             // operation changed from previous
        struct MUTANT *next;
 } *Mutant;
-#define DEBUG_MULTICORE if(1)
+#define DEBUG_MULTICORE if(0)
 run_multicore_export str RUNmulticore(Client cntxt, MalBlkPtr mb, MalStkPtr 
stk, InstrPtr p);
 run_multicore_export void multicorePrint(Client cntxt, Mutant m);
 #endif /* MAL_RUN_MULTICORE */
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to