Changeset: 7dcbd6c83bb9 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7dcbd6c83bb9
Modified Files:
monetdb5/scheduler/run_mutation.c
Branch: mutation
Log Message:
Fix the mutation administration
which was accidentally removed during latest code reshuffle.
diffs (60 lines):
diff --git a/monetdb5/scheduler/run_mutation.c
b/monetdb5/scheduler/run_mutation.c
--- a/monetdb5/scheduler/run_mutation.c
+++ b/monetdb5/scheduler/run_mutation.c
@@ -72,26 +72,23 @@ RUNmutationInternal(Client cntxt, MalStk
s = findSymbol(cntxt->nspace, modnme, fcnnme);
if (s == NULL || (src= s->def) == NULL)
throw(MAL, "scheduler.mutation", SEMANTIC_OPERATION_MISSING);
-
src = s->def;
- mutant = (Mutant) GDKzalloc(sizeof(struct MUTANT));
- mutant->src = src;
- mutant->stk = stk;
- mutant->calls = 0;
- mutant->next = ((Mutant)src->mutants);
- src->mutants = (void*) mutant;
// if called the first time, just execute the call
if ( src->calls == 0){
initProfiler(src);
setFilterAll();
+ mutant = (Mutant) GDKzalloc(sizeof(struct MUTANT));
+ mutant->src = src;
+ mutant->stk = stk;
+ src->mutants = (void*) mutant;
// turn off the scheduler call
RUNtoggleMutation(src);
clk = GDKusec();
// assume scheduler call is at line 1
- // msg = runMALsequence(cntxt, src, 2,src->stop,stk,0,0);
+ // msg = runMALsequence(cntxt, src,
2,mutant->src->stop,stk,0,0);
msg = runMAL(cntxt, src, 0, 0);
mutant->calls++;
mutant->runtime += GDKusec()- clk;
@@ -100,6 +97,15 @@ RUNmutationInternal(Client cntxt, MalStk
return msg;
}
+ // Keep old version in the history
+ // and collect the mutation arguments
+ mutant = (Mutant) GDKzalloc(sizeof(struct MUTANT));
+ mutant->next = ((Mutant)src->mutants);
+ mutant->src = src;
+ mutant->stk = stk;
+ ((Mutant) src->mutants)->src = copyMalBlk(src);
+ src->mutants = (void *) mutant;
+
// Find an expensive instruction to replace
msg = MUTpolicy(cntxt,mutant);
if ( msg != MAL_SUCCEED)
@@ -111,7 +117,7 @@ RUNmutationInternal(Client cntxt, MalStk
clk = GDKusec();
// assume scheduler call is at line 1
- //msg = runMALsequence(cntxt, src, 2,src->stop,stk,0, 0);
+ //msg = runMALsequence(cntxt, src, 2,mutant->src->stop,mutant->stk,0,
0);
msg = runMAL(cntxt, src, 0, 0);
mutant->runtime += GDKusec()- clk;
_______________________________________________
checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list