Changeset: 6e166ce6744e for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6e166ce6744e
Modified Files:
gdk/gdk_utils.c
gdk/gdk_utils.h
monetdb5/optimizer/opt_mitosis.c
Branch: default
Log Message:
allow fixed number of partitions using --set mito_parts=?
diffs (56 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_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, gdk_mito_parts = 0;
str schema = 0, table = 0;
wrd r = 0, rowcnt = 0; /* table should be sizeable to consider
parallel execution*/
InstrPtr q, *old, target = 0;
@@ -137,6 +138,11 @@ OPTmitosisImplementation(Client cntxt, M
}
if (pieces <= 1)
return 0;
+ gdk_mito_parts = GDKgetenv_int("mito_parts", 0);
+ printf("fixed parts %d\n", gdk_mito_parts);
+ fflush(stdout);
+ if (gdk_mito_parts > 0)
+ pieces = gdk_mito_parts;
OPTDEBUGmitosis
mnstr_printf(cntxt->fdout, "#opt_mitosis: target is %s.%s "
" with " SSZFMT "
rows into " SSZFMT " rows/piece %d threads %d pieces\n",
_______________________________________________
checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list