Changeset: fe7ba8832f80 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fe7ba8832f80 Modified Files: monetdb5/scheduler/Tests/8RunsJoinCorrectness.mal monetdb5/scheduler/mut_transforms.c monetdb5/scheduler/run_multicore.h Branch: mutation Log Message:
Clean up poluted code. diffs (186 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 @@ -28,25 +28,27 @@ end initializeNext; function query(run:int, a:bat[:oid,:lng], b:bat[:oid,:lng]); profiler.activate("ticks"); - profiler.activate("thread"); - profiler.activate("stmt"); - profiler.activate("time"); - profiler.setAll(); - profiler.start(); + profiler.activate("thread"); + profiler.activate("stmt"); + profiler.activate("time"); + profiler.setAll(); + profiler.start(); - t0:= alarm.usec(); + t0:= alarm.usec(); + s1:= nil:bat[:oid,:oid]; + s2:= nil:bat[:oid,:oid]; barrier z:= language.dataflow(); - (s1,s2) := algebra.join(a,b); + (s1,s2) := algebra.join(a,b); exit z; - t1:= alarm.usec(); - t2 := t1-t0; - io.printf("#run %d %d\n",run,t2); - stmt:= profiler.getTrace("stmt"); - ticks:= profiler.getTrace("ticks"); - thread:= profiler.getTrace("thread"); - time1:= profiler.getTrace("time"); - io.print(time1,thread,ticks,stmt); - + io.print(s1,s2); + t1:= alarm.usec(); + t2 := t1-t0; + io.printf("#run %d %d\n",run,t2); + stmt:= profiler.getTrace("stmt"); + ticks:= profiler.getTrace("ticks"); + thread:= profiler.getTrace("thread"); + time1:= profiler.getTrace("time"); + io.print(time1,thread,ticks,stmt); end query; optimizer.multicore("user","query"); 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 @@ -36,7 +36,7 @@ void mutationJoin(Client cntxt, Mutant m){ - int pc = m->target, i, j, k, limit, b1,b2, v1,v2, z1,z2, g1, h1; + int pc = m->target, i, j, k, limit, b1,b2, v1,v2, z1,z2; InstrPtr p=0, *old= m->src->stmt, q; int matpc = 0, profiler; @@ -66,22 +66,6 @@ mutationJoin(Client cntxt, Mutant m){ continue; } - // make the previous io.print statement associated with this algebra.join operator a no-op - if (getModuleId(old[i+1]) == ioRef && getFunctionId(old[i+1]) == printRef) - { - old[i+1]->token=NOOPsymbol; - - if (getModuleId(old[i+2]) == batRef && getFunctionId(old[i+2]) == infoRef) - { - old[i+2]->token = NOOPsymbol; - - if (getModuleId(old[i+3]) == ioRef && getFunctionId(old[i+3]) == printRef) - { - old[i+3]->token = NOOPsymbol; - } - } - } - profiler = m->src->profiler[i].trace; q= newStmt(m->src, batRef, partitionRef); setVarType(m->src, getArg(q,0), getArgType(m->src, p, p->retc)); @@ -120,22 +104,6 @@ mutationJoin(Client cntxt, Mutant m){ // inherit profiling m->src->profiler[m->src->stop-1].trace = profiler; - q= newStmt(m->src, ioRef, printRef); - q = pushArgument(m->src,q, b1); - // inherit profiling - m->src->profiler[m->src->stop-1].trace = profiler; - - q = newStmt(m->src, batRef, infoRef); - q = pushArgument(m->src,q, b1); - g1 = getArg(q,0) = newTmpVariable(m->src, newBatType(TYPE_oid, TYPE_str)); - h1 = getArg(q,1) = newTmpVariable(m->src, newBatType(TYPE_oid, TYPE_str)); - m->src->profiler[m->src->stop-1].trace = profiler; - - q = newStmt(m->src, ioRef, printRef); - q = pushArgument(m->src,q, g1); - q = pushArgument(m->src,q, h1); - m->src->profiler[m->src->stop-1].trace = profiler; - q= newStmt(m->src, languageRef, passRef); q = pushArgument(m->src,q,b1); // inherit profiling @@ -149,24 +117,6 @@ mutationJoin(Client cntxt, Mutant m){ // inherit profiling m->src->profiler[m->src->stop-1].trace = profiler; - q= newStmt(m->src, ioRef, printRef); - q = pushArgument(m->src,q, b2); - // inherit profiling - m->src->profiler[m->src->stop-1].trace = profiler; - - // print bat.info for tracing problem in bat corruption -/* q = newStmt(m->src, batRef, infoRef); - q = pushArgument(m->src,q, b2); - g1 = getArg(q,0) = newTmpVariable(m->src, newBatType(TYPE_oid, TYPE_str)); - h1 = getArg(q,1) = newTmpVariable(m->src, newBatType(TYPE_oid, TYPE_str)); - m->src->profiler[m->src->stop-1].trace = profiler; - - q = newStmt(m->src, ioRef, printRef); - q = pushArgument(m->src,q, g1); - q = pushArgument(m->src,q, h1); - m->src->profiler[m->src->stop-1].trace = profiler; -*/ - q= newStmt(m->src, languageRef, passRef); q = pushArgument(m->src,q,b2); // inherit profiling @@ -201,11 +151,6 @@ mutationJoin(Client cntxt, Mutant m){ getArg(q,0)= getArg(p,0); q= pushArgument(m->src,q,v1); q= pushArgument(m->src,q,v2); - - // added support for printing the joined bat for verification - q= newStmt(m->src, ioRef, printRef); - q = pushArgument(m->src,q, getArg(p,0)); - // inherit profiling m->src->profiler[m->src->stop-1].trace = profiler; } @@ -214,30 +159,7 @@ mutationJoin(Client cntxt, Mutant m){ m->target = pc; m->comment = GDKstrdup("mutationJoin"); } else - { - pushInstruction(m->src,p); - if (getModuleId(p) == algebraRef && getFunctionId(p) == joinRef) - { - // to avoid the case of a double push of ioRef and printRef on an already present algebra.join - if (getModuleId(old[i+1]) != ioRef && getFunctionId(old[i+1]) != printRef) - { - q = newStmt(m->src, ioRef, printRef); - q = pushArgument(m->src,q, getArg(p, p->retc)); - m->src->profiler[m->src->stop-1].trace = profiler; - - q = newStmt(m->src, batRef, infoRef); - q = pushArgument(m->src,q, getArg(p, p->retc)); - g1 = getArg(q,0) = newTmpVariable(m->src, newBatType(TYPE_oid, TYPE_str)); - h1 = getArg(q,1) = newTmpVariable(m->src, newBatType(TYPE_oid, TYPE_str)); - m->src->profiler[m->src->stop-1].trace = profiler; - - q = newStmt(m->src, ioRef, printRef); - q = pushArgument(m->src,q, g1); - q = pushArgument(m->src,q, h1); - m->src->profiler[m->src->stop-1].trace = profiler; - } - } - } + pushInstruction(m->src,p); } GDKfree(old); } 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(0) +#define DEBUG_MULTICORE if(1) 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