Changeset: 6276e21102c3 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6276e21102c3
Modified Files:
        MonetDB5/src/mal/mal_interpreter.mx
Branch: Jun2010
Log Message:

More fixes to dataflow
There appeared a few more initialization glitches.
The SQL test set runs again as expected.


diffs (85 lines):

diff -r 9f0d67e80fb0 -r 6276e21102c3 MonetDB5/src/mal/mal_interpreter.mx
--- a/MonetDB5/src/mal/mal_interpreter.mx       Wed Jul 28 14:42:17 2010 +0200
+++ b/MonetDB5/src/mal/mal_interpreter.mx       Thu Jul 29 14:42:12 2010 +0200
@@ -1083,9 +1083,8 @@
        thr = THRnew(MT_getpid(), "DFLOWworker");
        while(task) {
                fs = (FlowStep)q_dequeue(task->todo);
-#ifdef DEBUG_FLOW
-               printInstruction(GDKstdout, fs->flow->mb, 0, 
getInstrPtr(fs->flow->mb,fs->pc), LIST_MAL_STMT);
-#endif
+               PARDEBUG
+                       stream_printf(GDKstdout,"#execute pc=%d thread =%d 
\n",fs->pc, task->id);
                while ((fs->error = DFLOWstep(task, fs)) && 
(err=strstr(fs->error,"GDKmallocmax: failed")) != NULL){
                        /* restore the instruction and wait*/
                        THRprintf(GDKerr, "#Thread %d needs 
memory:%s\n",task->id,err);
@@ -1145,10 +1144,9 @@
                for (j=0; j<p->argc; j++){
                        a = getArg(p, j);
 
-                       if (j<p->retc && assign[a] == 0 ){
+                       if (j<p->retc && assign[a] == 0 && flow->inuse[a] == 0) 
{
                                assign[a] = i;
-                               if ( isNotUsedIn(p, p->retc,a))
-                                       flow->blocked[a] = 1;
+                               flow->blocked[a] = isNotUsedIn(p,p->retc,a)?1:0;
                        }
 
                        if (j>=p->retc  && !isVarConstant(flow->mb, a)  )
@@ -1161,8 +1159,8 @@
        PARDEBUG
        for (i=0; i < flow->mb->vtop; i++) 
        if ( flow->blocked[i] || flow->inuse[i] || assign[i] ){
-               printf("%s %d [ %1d %2d ]\n", getVarName(flow->mb,i), 
-                       getEndOfLife(flow->mb,i),
+               printf("%s %d %d [ %1d %2d ]\n", getVarName(flow->mb,i), 
+                       getEndOfLife(flow->mb,i), i,
                        flow->blocked[i],
                        flow->inuse[i]);
        }
@@ -1176,8 +1174,10 @@
        (void) pc;
 
        for(j=0; j<p->argc && !blocked; j++) {
-               if (j>=p->retc && flow->blocked[getArg(p,j)] )
-                               blocked++;
+               if ( j >= p->retc && flow->blocked[getArg(p,j)] )
+                       blocked++;
+               if (j < p->retc && flow->inuse[getArg(p,j)] )
+                       blocked++;
                else
                if ( getEndOfLife(flow->mb,getArg(p,j))  == fs[i].pc ) {
                        /* make sure all instructions interested have already 
been executed */
@@ -1209,10 +1209,11 @@
        fs[i].status = DFLOWrunning;
 
        PARDEBUG {
-               stream_printf(GDKstdout,"#enqueue %d", fs[i].pc);
+               stream_printf(GDKstdout,"#enqueue pc=%d", fs[i].pc);
                for(j=p->retc; j<p->argc; j++)
                        stream_printf(GDKstdout," %d 
",flow->inuse[getArg(p,j)]);
                printInstruction(GDKstdout, flow->mb, 0, p, LIST_MAL_STMT);
+               stream_printf(GDKstdout,"\n");
        }
 }
 
@@ -1257,7 +1258,7 @@
                } else {
                        p = getInstrPtr(flow->mb, f->pc);
                        PARDEBUG{
-                               stream_printf(GDKstdout,"#dequeue %d", f->pc);
+                               stream_printf(GDKstdout,"#dequeue pc=%d", 
f->pc);
                                for(j=p->retc; j<p->argc; j++)
                                        stream_printf(GDKstdout," %d 
",flow->inuse[getArg(p,j)]);
                                printInstruction(GDKstdout, flow->mb, 0, p, 
LIST_MAL_STMT);
@@ -1841,9 +1842,7 @@
                        if ( garbage[i] >= 0){
                                bid = ABS(stk->stk[garbage[i]].val.bval);
                                BBPdecref( bid, TRUE);
-#ifdef DEBUG_GC
-                               stream_printf(GDKstdout,"GC %d %d %s done 
%d\n",bid,garbage[i], getVarName(mb,garbage[i]), BBP_lrefs(bid));
-#endif
+                               PARDEBUG stream_printf(GDKstdout,"#GC pc=%d 
bid=%d %s done\n",stkpc,bid,getVarName(mb,garbage[i]));
                                stk->stk[garbage[i]].val.bval = 0;
                        }
                } else if( i < pci->retc && stk->stk[getArg(pci,i)].vtype == 
TYPE_str){
_______________________________________________
Checkin-list mailing list
Checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to