Changeset: 054d98a88600 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=054d98a88600
Added Files:
monetdb5/scheduler/mut_aggr.c
monetdb5/scheduler/mut_aggr.h
monetdb5/scheduler/mut_join.c
monetdb5/scheduler/mut_join.h
Removed Files:
monetdb5/scheduler/mut_transforms.c
monetdb5/scheduler/mut_transforms.h
Modified Files:
monetdb5/scheduler/Makefile.ag
monetdb5/scheduler/Tests/All
monetdb5/scheduler/Tests/mutation00.mal
monetdb5/scheduler/Tests/mutation00.stable.out
monetdb5/scheduler/Tests/query00.mal
monetdb5/scheduler/mut_leftjoin.c
monetdb5/scheduler/mut_policy.c
monetdb5/scheduler/mut_util.c
monetdb5/scheduler/run_multicore.c
Branch: mutation
Log Message:
Further code cleanup and reorganization
diffs (truncated from 1043 to 300 lines):
diff --git a/monetdb5/scheduler/Makefile.ag b/monetdb5/scheduler/Makefile.ag
--- a/monetdb5/scheduler/Makefile.ag
+++ b/monetdb5/scheduler/Makefile.ag
@@ -31,10 +31,11 @@ lib_scheduler = {
run_adder.c run_adder.h \
run_isolate.c run_isolate.h \
run_multicore.c run_multicore.h \
- mut_transforms.c mut_transforms.h \
mut_util.c mut_util.h \
mut_select.c mut_select.h \
+ mut_join.c mut_join.h \
mut_leftjoin.c mut_leftjoin.h \
+ mut_aggr.c mut_aggr.h \
mut_matpack.c mut_matpack.h \
mut_policy.c mut_policy.h \
run_memo.c run_memo.h \
diff --git a/monetdb5/scheduler/Tests/All b/monetdb5/scheduler/Tests/All
--- a/monetdb5/scheduler/Tests/All
+++ b/monetdb5/scheduler/Tests/All
@@ -2,4 +2,4 @@ sched00
memo01
memo02
mutation00
-query00
+#query00
diff --git a/monetdb5/scheduler/Tests/mutation00.mal
b/monetdb5/scheduler/Tests/mutation00.mal
--- a/monetdb5/scheduler/Tests/mutation00.mal
+++ b/monetdb5/scheduler/Tests/mutation00.mal
@@ -36,7 +36,7 @@ barrier z:= language.dataflow();
exit z;
t1:= alarm.usec();
t2 := t1-t0;
- io.printf("#%d\n",t2);
+ io.printf("# total running time %d\n",t2);
end query;
#multiple calls should produce more parallel plans.
diff --git a/monetdb5/scheduler/Tests/mutation00.stable.out
b/monetdb5/scheduler/Tests/mutation00.stable.out
--- a/monetdb5/scheduler/Tests/mutation00.stable.out
+++ b/monetdb5/scheduler/Tests/mutation00.stable.out
@@ -47,7 +47,7 @@ barrier z := language.dataflow();
exit z;
t1 := alarm.usec();
t2 := calc.-(t1,t0);
- io.printf("#%d\n",t2);
+ io.printf("# total running time %d\n",t2);
end query;
function user.main():void;
# example framework for a mutation based execution stack
@@ -60,18 +60,20 @@ function user.main():void;
user.query();
user.query();
end main;
-#1164605
-#mutation candidate 4 cost 6666
-#mutation candidate 5 cost 5806
-#mutation candidate 6 cost 6703
-#mutation calls 1 cost 1000
-#mutation target instruction 6 cost 6703
+# total running time 1059805
+# call 1 invocation Time 1066216
+#mutation candidate 5 calls 1 cost 8857
-&1 0 17 1 17
+#mutation candidate 6 calls 1 cost 10045
+
+#mutation candidate 7 calls 1 cost 10086
+
+#mutation winner 7 calls 1 cost 10086
+&1 0 20 1 20
% .explain # table_name
% mal # name
% clob # type
-% 210 # length
+% 207 # length
@@ -89,49 +91,20 @@ end main;
-#1209270
-#mutation candidate 4 cost 3800
-#mutation candidate 5 cost 3804
-#mutation candidate 8 cost 3416
-#mutation candidate 9 cost 3475
-#mutation calls 1 cost 2000
-#mutation target instruction 5 cost 3804
-&1 0 21 1 21
-% .explain # table_name
-% mal # name
-% clob # type
-% 210 # length
+# total running time 1072186
+# call 1 invocation Time 1072280
+#mutation candidate 6 calls 1 cost 1938
+#mutation candidate 8 calls 1 cost 1980
+#mutation candidate 11 calls 1 cost 8447
+#mutation candidate 12 calls 1 cost 8468
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-#1212455
-#mutation candidate 4 cost 12739
-#mutation candidate 7 cost 1872
-#mutation candidate 8 cost 1877
-#mutation candidate 12 cost 1837
-#mutation candidate 13 cost 1843
-#mutation calls 1 cost 3000
-#mutation target instruction 4 cost 12739
-
+#mutation winner 12 calls 1 cost 8468
&1 0 25 1 25
% .explain # table_name
% mal # name
@@ -162,17 +135,58 @@ end main;
-#1215574
-#mutation candidate 6 cost 1853
-#mutation candidate 7 cost 1858
-#mutation candidate 11 cost 1839
-#mutation candidate 12 cost 1802
-#mutation candidate 16 cost 1816
-#mutation candidate 17 cost 1840
-#mutation calls 1 cost 4000
-#mutation target instruction 7 cost 1858
+# total running time 1096429
+# call 1 invocation Time 1096501
+#mutation candidate 6 calls 1 cost 2050
-&1 0 28 1 28
+#mutation candidate 11 calls 1 cost 8476
+
+#mutation winner 11 calls 1 cost 8476
+&1 0 30 1 30
+% .explain # table_name
+% mal # name
+% clob # type
+% 210 # length
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# total running time 1086935
+# call 1 invocation Time 1087026
+#mutation candidate 6 calls 1 cost 1937
+
+#mutation candidate 8 calls 1 cost 1973
+
+#mutation candidate 12 calls 1 cost 1976
+
+#mutation winner 12 calls 1 cost 1976
+&1 0 34 1 34
% .explain # table_name
% mal # name
% clob # type
diff --git a/monetdb5/scheduler/Tests/query00.mal
b/monetdb5/scheduler/Tests/query00.mal
--- a/monetdb5/scheduler/Tests/query00.mal
+++ b/monetdb5/scheduler/Tests/query00.mal
@@ -59,6 +59,6 @@ end testrun;
# runs based on sizes
testrun(100000:lng); #400K
-testrun(1000000:lng); #4MB
-testrun(10000000:lng); #40MB
-testrun(100000000:lng); #400MB
+#testrun(1000000:lng); #4MB
+#testrun(10000000:lng); #40MB
+#testrun(100000000:lng); #400MB
diff --git a/monetdb5/scheduler/mut_aggr.c b/monetdb5/scheduler/mut_aggr.c
new file mode 100644
--- /dev/null
+++ b/monetdb5/scheduler/mut_aggr.c
@@ -0,0 +1,56 @@
+/*
+ * The contents of this file are subject to the MonetDB Public License
+ * Version 1.1 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://www.monetdb.org/Legal/MonetDBLicense
+ *
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * The Original Code is the MonetDB Database System.
+ *
+ * The Initial Developer of the Original Code is CWI.
+ * Portions created by CWI are Copyright (C) 1997-July 2008 CWI.
+ * Copyright August 2008-2013 MonetDB B.V.
+ * All Rights Reserved.
+ */
+
+/*
+ * (c) M. Kersten, M. Gawade
+ * The infrastructure to adapatively create multi-processor parallel plans.
+ * Be careful in handling the stk, because it is also used by the caller
functions.
+ */
+#include "monetdb_config.h"
+#include "mut_util.h"
+#include "mut_aggr.h"
+#include "mal_interpreter.h"
+#include "opt_prelude.h"
+
+/* Sample plan mutation actions
+ * The aggr.sum operation performs parallel sums and consolidates the result
+ */
+void
+mutationSum(Client cntxt, Mutant m){
+ int pc = m->target, i, limit;
+ InstrPtr p=0, *old= m->src->stmt;
+
+ (void) cntxt;
+ limit= m->src->stop;
+ if ( newMalBlkStmt(m->src, m->src->ssize) < 0)
+ return;
+
+ pushInstruction(m->src, old[0]);
+ for (i = 1; i < limit; i++) {
+ p= old[i];
+ if ( i == pc){
+ /* replace the instruction, e.g. with a partioned one */
+ pushInstruction(m->src,p);
+ m->comment = GDKstrdup("mutationSum");
+ } else
+ pushInstruction(m->src,p);
+ }
+ GDKfree(old);
+}
+
diff --git a/monetdb5/scheduler/mut_aggr.h b/monetdb5/scheduler/mut_aggr.h
new file mode 100644
--- /dev/null
+++ b/monetdb5/scheduler/mut_aggr.h
@@ -0,0 +1,30 @@
+/*
+ * The contents of this file are subject to the MonetDB Public License
+ * Version 1.1 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://www.monetdb.org/Legal/MonetDBLicense
+ *
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * The Original Code is the MonetDB Database System.
+ *
+ * The Initial Developer of the Original Code is CWI.
+ * Portions created by CWI are Copyright (C) 1997-July 2008 CWI.
+ * Copyright August 2008-2013 MonetDB B.V.
+ * All Rights Reserved.
_______________________________________________
checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list