Changeset: 2033a11b0643 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2033a11b0643
Modified Files:
gdk/gdk_utils.c
gdk/gdk_utils.h
monetdb5/optimizer/opt_accumulators.c
monetdb5/optimizer/opt_aliases.c
monetdb5/optimizer/opt_coercion.c
monetdb5/optimizer/opt_commonTerms.c
monetdb5/optimizer/opt_constants.c
monetdb5/optimizer/opt_costModel.c
monetdb5/optimizer/opt_dataflow.c
monetdb5/optimizer/opt_deadcode.c
monetdb5/optimizer/opt_emptySet.c
monetdb5/optimizer/opt_evaluate.c
monetdb5/optimizer/opt_garbageCollector.c
monetdb5/optimizer/opt_groups.c
monetdb5/optimizer/opt_history.c
monetdb5/optimizer/opt_inline.c
monetdb5/optimizer/opt_joinpath.c
monetdb5/optimizer/opt_mergetable.c
monetdb5/optimizer/opt_mitosis.c
monetdb5/optimizer/opt_multiplex.c
monetdb5/optimizer/opt_origin.c
monetdb5/optimizer/opt_prejoin.c
monetdb5/optimizer/opt_prelude.h
monetdb5/optimizer/opt_reduce.c
monetdb5/optimizer/opt_remap.c
monetdb5/optimizer/opt_support.h
monetdb5/optimizer/opt_wrapper.c
Branch: Feb2013
Log Message:
Cleanup output of --optimizers flag
It can be used in conjunction with mclient -f raw to get quick insight
in the cost and activities of the optimizers in the pipeline.
diffs (truncated from 451 to 300 lines):
diff --git a/gdk/gdk_utils.c b/gdk/gdk_utils.c
--- a/gdk/gdk_utils.c
+++ b/gdk/gdk_utils.c
@@ -145,7 +145,7 @@ GDKgetenv_istrue(const char *name)
return 0;
}
-static int
+int
GDKgetenv_int(const char *name, int def)
{
char *val = GDKgetenv(name);
diff --git a/gdk/gdk_utils.h b/gdk/gdk_utils.h
--- a/gdk/gdk_utils.h
+++ b/gdk/gdk_utils.h
@@ -31,6 +31,8 @@ gdk_export int GDKgetenv_isyes(const cha
gdk_export int GDKgetenv_istrue(const char *name);
+gdk_export int GDKgetenv_int(const char *name, int def);
+
gdk_export void GDKsetenv(str name, str value);
/*
diff --git a/monetdb5/optimizer/opt_accumulators.c
b/monetdb5/optimizer/opt_accumulators.c
--- a/monetdb5/optimizer/opt_accumulators.c
+++ b/monetdb5/optimizer/opt_accumulators.c
@@ -112,7 +112,5 @@ OPTaccumulatorsImplementation(Client cnt
freeInstruction(old[i]);
GDKfree(old);
GDKfree(span);
- DEBUGoptimizers
- mnstr_printf(cntxt->fdout,"#opt_accumulators:%d
accumulations\n",actions);
return actions;
}
diff --git a/monetdb5/optimizer/opt_aliases.c b/monetdb5/optimizer/opt_aliases.c
--- a/monetdb5/optimizer/opt_aliases.c
+++ b/monetdb5/optimizer/opt_aliases.c
@@ -79,7 +79,5 @@ OPTaliasesImplementation(Client cntxt, M
*/
GDKfree(span);
GDKfree(alias);
- DEBUGoptimizers
- mnstr_printf(cntxt->fdout,"#opt_aliases: %d removed\n",actions);
return actions;
}
diff --git a/monetdb5/optimizer/opt_coercion.c
b/monetdb5/optimizer/opt_coercion.c
--- a/monetdb5/optimizer/opt_coercion.c
+++ b/monetdb5/optimizer/opt_coercion.c
@@ -68,7 +68,5 @@ OPTcoercionImplementation(Client cntxt,M
* This optimizer affects the flow, but not the type and declaration
* structure. A cheaper optimizer is sufficient.
*/
- DEBUGoptimizers
- mnstr_printf(cntxt->fdout,"#opt_coercion: %d coersions
applied\n",actions);
return actions;
}
diff --git a/monetdb5/optimizer/opt_commonTerms.c
b/monetdb5/optimizer/opt_commonTerms.c
--- a/monetdb5/optimizer/opt_commonTerms.c
+++ b/monetdb5/optimizer/opt_commonTerms.c
@@ -188,10 +188,5 @@ OPTcommonTermsImplementation(Client cntx
GDKfree(vars);
GDKfree(old);
GDKfree(alias);
- DEBUGoptimizers
- mnstr_printf(cntxt->fdout,"#opt_commonTerms: %d statements
catched\n",actions);
-#ifdef DEBUG_OPT_COMMONTERMS_MORE
- mnstr_printf(cntxt->fdout,"#opt_commonTerms: %d statements
catched\n",actions);
-#endif
return actions;
}
diff --git a/monetdb5/optimizer/opt_constants.c
b/monetdb5/optimizer/opt_constants.c
--- a/monetdb5/optimizer/opt_constants.c
+++ b/monetdb5/optimizer/opt_constants.c
@@ -93,8 +93,6 @@ OPTconstantsImplementation(Client cntxt,
for (k=0; k < p->argc; k++)
getArg(p,k) = alias[getArg(p,k)];
}
- DEBUGoptimizers
- mnstr_printf(cntxt->fdout,"#opt_constants: %d constant
duplicates removed\n", actions);
GDKfree(alias);
GDKfree(cst);
GDKfree(index);
diff --git a/monetdb5/optimizer/opt_costModel.c
b/monetdb5/optimizer/opt_costModel.c
--- a/monetdb5/optimizer/opt_costModel.c
+++ b/monetdb5/optimizer/opt_costModel.c
@@ -66,7 +66,7 @@ OPTbackpropagate(MalBlkPtr mb, int i, in
int
OPTcostModelImplementation(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr
pci)
{
- int i, actions = 1;
+ int i;
wrd k, c1, c2;
InstrPtr p;
str sortrevRef= putName("sortReverse",11);
@@ -199,7 +199,5 @@ OPTcostModelImplementation(Client cntxt,
}
}
}
- DEBUGoptimizers
- mnstr_printf(cntxt->fdout,"#opt_costModel: processed\n");
return 1;
}
diff --git a/monetdb5/optimizer/opt_dataflow.c
b/monetdb5/optimizer/opt_dataflow.c
--- a/monetdb5/optimizer/opt_dataflow.c
+++ b/monetdb5/optimizer/opt_dataflow.c
@@ -320,7 +320,5 @@ OPTdataflowImplementation(Client cntxt,
GDKfree(old);
GDKfree(span);
GDKfree(init);
- DEBUGoptimizers
- mnstr_printf(cntxt->fdout,"#opt_dataflow: %d flow blocks
created\n",actions);
return actions;
}
diff --git a/monetdb5/optimizer/opt_deadcode.c
b/monetdb5/optimizer/opt_deadcode.c
--- a/monetdb5/optimizer/opt_deadcode.c
+++ b/monetdb5/optimizer/opt_deadcode.c
@@ -80,8 +80,6 @@ OPTdeadcodeImplementation(Client cntxt,
for(; i<slimit; i++)
if( old[i])
freeInstruction(old[i]);
- DEBUGoptimizers
- mnstr_printf(cntxt->fdout,"#opt_deadcode: %d statements
removed\n", actions);
GDKfree(old);
/* we may have uncovered new use-less operations */
if (actions)
diff --git a/monetdb5/optimizer/opt_emptySet.c
b/monetdb5/optimizer/opt_emptySet.c
--- a/monetdb5/optimizer/opt_emptySet.c
+++ b/monetdb5/optimizer/opt_emptySet.c
@@ -227,8 +227,6 @@ ESevaluate(Client cntxt, MalBlkPtr mb, c
freeInstruction(old[i]);
GDKfree(old);
if (actions) {
- DEBUGoptimizers
- mnstr_printf(cntxt->fdout,"#opt_emptyset: %d empty sets
statements removed\n",actions);
clrAllTypes(mb); /* force a complete resolve */
}
GDKfree(constraints);
diff --git a/monetdb5/optimizer/opt_evaluate.c
b/monetdb5/optimizer/opt_evaluate.c
--- a/monetdb5/optimizer/opt_evaluate.c
+++ b/monetdb5/optimizer/opt_evaluate.c
@@ -184,8 +184,6 @@ OPTevaluateImplementation(Client cntxt,
}
}
actions += OPTremoveUnusedBlocks(cntxt, mb);
- DEBUGoptimizers
- mnstr_printf(cntxt->fdout, "#opt_evaluate: %d constant
expressions\n", actions);
GDKfree(span);
GDKfree(alias);
freeStack(env);
diff --git a/monetdb5/optimizer/opt_garbageCollector.c
b/monetdb5/optimizer/opt_garbageCollector.c
--- a/monetdb5/optimizer/opt_garbageCollector.c
+++ b/monetdb5/optimizer/opt_garbageCollector.c
@@ -116,8 +116,6 @@ OPTgarbageCollectorImplementation(Client
}
GDKfree(span);
- DEBUGoptimizers
- mnstr_printf(cntxt->fdout,"#opt_garbagecollector: %d variables
reset\n",actions);
return actions+1;
}
diff --git a/monetdb5/optimizer/opt_groups.c b/monetdb5/optimizer/opt_groups.c
--- a/monetdb5/optimizer/opt_groups.c
+++ b/monetdb5/optimizer/opt_groups.c
@@ -84,7 +84,5 @@ OPTgroupsImplementation(Client cntxt, Ma
freeInstruction(old[i]);
GDKfree(old);
GDKfree(ref);
- DEBUGoptimizers
- mnstr_printf(cntxt->fdout,"#opt_groups: %d statements
glued\n",actions);
return actions;
}
diff --git a/monetdb5/optimizer/opt_history.c b/monetdb5/optimizer/opt_history.c
--- a/monetdb5/optimizer/opt_history.c
+++ b/monetdb5/optimizer/opt_history.c
@@ -37,7 +37,7 @@ OPTforgetPrevious(Client cntxt, MalBlkPt
int
OPThistoryImplementation(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr
pci)
{
- int i, limit, slimit, actions = 1;
+ int i, limit, slimit;
InstrPtr p = 0, *old= mb->stmt, q,r;
int argc, inblock, oublock, arg, ctime;
int xtime=0, rtime = 0, foot=0, memory, tuples=0;
@@ -203,7 +203,5 @@ OPThistoryImplementation(Client cntxt, M
if(old[i])
freeInstruction(old[i]);
GDKfree(old);
- DEBUGoptimizers
- mnstr_printf(cntxt->fdout,"#opt_history: code added\n");
return 1;
}
diff --git a/monetdb5/optimizer/opt_inline.c b/monetdb5/optimizer/opt_inline.c
--- a/monetdb5/optimizer/opt_inline.c
+++ b/monetdb5/optimizer/opt_inline.c
@@ -40,13 +40,12 @@ isCorrectInline(MalBlkPtr mb){
int
OPTinlineImplementation(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p)
{
- int i,limit;
+ int i;
InstrPtr q,sig;
int actions = 0;
(void) p;
- limit = mb->stop;
for (i = 1; i < mb->stop; i++) {
q = getInstrPtr(mb, i);
if( q->blk ){
@@ -106,8 +105,6 @@ OPTinlineImplementation(Client cntxt, Ma
OPTDEBUGinline
mnstr_printf(cntxt->fdout,"#mal program: %d MAL instr %d vars
(" SZFMT " K)\n",mb->stop,mb->vtop,
((sizeof( MalBlkRecord) +mb->ssize * sizeof(InstrRecord)+
mb->vtop* sizeof(VarRecord) + mb->vsize*sizeof(VarPtr)+1023)/1024));
- DEBUGoptimizers
- mnstr_printf(cntxt->fdout,"#opt_inline: actions %d MAL
%d->%d\n",actions,limit,mb->stop);
return actions;
}
@@ -122,7 +119,6 @@ int OPTinlineMultiplex(Client cntxt, Mal
if( (s= findSymbol(cntxt->nspace, mod,fcn)) ==0 )
return FALSE;
/*
- * @-
* Before we decide to propagate the inline request
* to the multiplex operation, we check some basic properties
* of the target function. Moreover, we apply the inline optimizer
diff --git a/monetdb5/optimizer/opt_joinpath.c
b/monetdb5/optimizer/opt_joinpath.c
--- a/monetdb5/optimizer/opt_joinpath.c
+++ b/monetdb5/optimizer/opt_joinpath.c
@@ -293,7 +293,5 @@ OPTjoinPathImplementation(Client cntxt,
GDKfree(old);
GDKfree(pc);
if (varcnt ) GDKfree(varcnt);
- DEBUGoptimizers
- mnstr_printf(cntxt->fdout,"#opt_joinpath: %d statements
glued\n",actions);
return actions;
}
diff --git a/monetdb5/optimizer/opt_mergetable.c
b/monetdb5/optimizer/opt_mergetable.c
--- a/monetdb5/optimizer/opt_mergetable.c
+++ b/monetdb5/optimizer/opt_mergetable.c
@@ -1402,8 +1402,6 @@ OPTmergetableImplementation(Client cntxt
GDKfree(old);
}
- DEBUGoptimizers
- mnstr_printf(cntxt->fdout,"#opt_mergetable: %d merge
actions\n",actions);
GDKfree(mat);
return actions;
}
diff --git a/monetdb5/optimizer/opt_mitosis.c b/monetdb5/optimizer/opt_mitosis.c
--- a/monetdb5/optimizer/opt_mitosis.c
+++ b/monetdb5/optimizer/opt_mitosis.c
@@ -20,6 +20,7 @@
#include "opt_mitosis.h"
#include "opt_octopus.h"
#include "mal_interpreter.h"
+#include <gdk_utils.h>
static int
eligible(MalBlkPtr mb)
@@ -41,7 +42,7 @@ eligible(MalBlkPtr mb)
int
OPTmitosisImplementation(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p)
{
- int i, j, limit, estimate = 0, pieces = 1;
+ int i, j, limit, estimate = 0, pieces = 1, mito_parts = 0, mito_size =
0, row_size = 0;
str schema = 0, table = 0;
wrd r = 0, rowcnt = 0; /* table should be sizeable to consider
parallel execution*/
InstrPtr q, *old, target = 0;
@@ -87,6 +88,8 @@ OPTmitosisImplementation(Client cntxt, M
*/
r = getVarRows(mb, getArg(p, 0));
if (r >= rowcnt) {
+ /* the rowsize depends on the column types, assume
void-headed */
+ row_size = ATOMsize(getTailType(getArgType(mb,p,0)));
rowcnt = r;
target = p;
estimate++;
@@ -135,15 +138,26 @@ OPTmitosisImplementation(Client cntxt, M
if (pieces > MAXSLICES)
pieces = MAXSLICES;
}
+ /* to enable experimentation we introduce the option to set
+ * the number of parts required and/or the size of each chunk (in K)
+ */
+ mito_parts = GDKgetenv_int("mito_parts", 0);
+ if (mito_parts > 0)
+ pieces = mito_parts;
+ mito_size = GDKgetenv_int("mito_size", 0);
+ if (mito_size > 0)
+ pieces = (rowcnt * row_size)/ (mito_size * 1024);
+
+ OPTDEBUGmitosis
+ mnstr_printf(cntxt->fdout, "#opt_mitosis: target is %s.%s "
+ " with " SSZFMT "
rows of size %d into " SSZFMT
+ " rows/piece %d
threads %d pieces"
+ " fixed parts
%d fixed size %d\n",
+ getVarConstant(mb, getArg(target, 2)).val.sval,
_______________________________________________
checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list