Changeset: 5992069e78e2 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5992069e78e2 Modified Files: MonetDB5/src/mal/mal_interpreter.mx Branch: default Log Message:
merged Martin's dataflow fixes from Jun2010 diffs (82 lines): diff -r 76be7701721b -r 5992069e78e2 MonetDB5/src/mal/mal_interpreter.mx --- a/MonetDB5/src/mal/mal_interpreter.mx Thu Jul 29 13:37:44 2010 +0200 +++ b/MonetDB5/src/mal/mal_interpreter.mx Thu Jul 29 18:46:34 2010 +0200 @@ -1114,6 +1114,8 @@ thr = THRnew(MT_getpid(), "DFLOWworker"); while(task) { fs = (FlowStep)q_dequeue(task->todo); + PARDEBUG + mnstr_printf(GDKstdout,"#execute pc=%d thread =%d \n",fs->pc, task->id); if ( fs == oldfs){ q_requeue(task->todo,fs); MT_sleep_ms(10); @@ -1188,10 +1190,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) ) @@ -1204,8 +1205,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]); } @@ -1219,8 +1220,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 */ @@ -1252,10 +1255,11 @@ fs[i].status = DFLOWrunning; PARDEBUG { - mnstr_printf(GDKstdout,"#enqueue %d", fs[i].pc); + mnstr_printf(GDKstdout,"#enqueue pc=%d", fs[i].pc); for(j=p->retc; j<p->argc; j++) mnstr_printf(GDKstdout," %d ",flow->inuse[getArg(p,j)]); printInstruction(GDKstdout, flow->mb, 0, p, LIST_MAL_STMT); + mnstr_printf(GDKstdout,"\n"); } } @- @@ -1312,7 +1316,7 @@ } else { p = getInstrPtr(flow->mb, f->pc); PARDEBUG{ - mnstr_printf(GDKstdout,"#dequeue %d", f->pc); + mnstr_printf(GDKstdout,"#dequeue pc=%d", f->pc); for(j=p->retc; j<p->argc; j++) mnstr_printf(GDKstdout," %d ",flow->inuse[getArg(p,j)]); printInstruction(GDKstdout, flow->mb, 0, p, LIST_MAL_STMT); @@ -1898,9 +1902,7 @@ if ( garbage[i] >= 0){ bid = ABS(stk->stk[garbage[i]].val.bval); BBPdecref( bid, TRUE); -#ifdef DEBUG_GC - mnstr_printf(GDKstdout,"GC %d %d %s done %d\n",bid,garbage[i], getVarName(mb,garbage[i]), BBP_lrefs(bid)); -#endif + PARDEBUG mnstr_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