Changeset: 7ee663a33caf for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7ee663a33caf
Added Files:
        monetdb5/modules/mal/Tests/pqueueElim.mal
        monetdb5/modules/mal/Tests/pqueueElim.stable.err
        monetdb5/modules/mal/Tests/pqueueElim.stable.out
Modified Files:
        monetdb5/modules/mal/Tests/All
        monetdb5/modules/mal/Tests/pqueue.mal
        monetdb5/modules/mal/Tests/pqueue.stable.out
        monetdb5/modules/mal/pqueue.c
        monetdb5/modules/mal/pqueue.h
        monetdb5/modules/mal/pqueue.mal
Branch: default
Log Message:

Extension of the pqueue module
First step in retrofitting the pqueue module.
Extension with new top-{min,max} using a shuffle exchange approach.
Given the size of the top, this should be enough.


diffs (truncated from 741 to 300 lines):

diff --git a/monetdb5/modules/mal/Tests/All b/monetdb5/modules/mal/Tests/All
--- a/monetdb5/modules/mal/Tests/All
+++ b/monetdb5/modules/mal/Tests/All
@@ -81,3 +81,4 @@ clients-getpasswd
 #cpustat too system dependent to always run.
 
 pqueue
+pqueueElim
diff --git a/monetdb5/modules/mal/Tests/pqueue.mal 
b/monetdb5/modules/mal/Tests/pqueue.mal
--- a/monetdb5/modules/mal/Tests/pqueue.mal
+++ b/monetdb5/modules/mal/Tests/pqueue.mal
@@ -1,6 +1,31 @@
-# init pqueue
-X_buffer_type:bat[:oid,:int] := bat.new(:oid,:int,1);
-X_buffer := pqueue.init(X_buffer_type,5:wrd);
+# enqueue something 
+b:= bat.new(:oid,:int);
 
-# enqueue something 
-pqueue.enqueue_max(X_buffer,5:oid,5:int);
+bat.append(b,1);
+bat.append(b,0);
+bat.append(b,2);
+bat.append(b,2);
+bat.append(b,5);
+bat.append(b,5);
+bat.append(b,3);
+
+io.print(b);
+
+bp:= pqueue.topn_min(b,0:wrd,false);
+io.print(bp);
+bp:= pqueue.topn_min(b,1:wrd,false);
+io.print(bp);
+bp:= pqueue.topn_min(b,2:wrd,false);
+io.print(bp);
+bp:= pqueue.topn_min(b,3:wrd,false);
+io.print(bp);
+bp:= pqueue.topn_min(b,4:wrd,false);
+io.print(bp);
+bp:= pqueue.topn_min(b,5:wrd,false);
+io.print(bp);
+bp:= pqueue.topn_min(b,6:wrd,false);
+io.print(bp);
+bp:= pqueue.topn_min(b,7:wrd,false);
+io.print(bp);
+bp:= pqueue.topn_min(b,8:wrd,false);
+io.print(bp);
diff --git a/monetdb5/modules/mal/Tests/pqueue.stable.out 
b/monetdb5/modules/mal/Tests/pqueue.stable.out
--- a/monetdb5/modules/mal/Tests/pqueue.stable.out
+++ b/monetdb5/modules/mal/Tests/pqueue.stable.out
@@ -19,12 +19,117 @@ stdout of test 'pqueue` in directory 'mo
 # MonetDB/JAQL module loaded
 # MonetDB/SQL module loaded
 function user.main():void;
-# init pqueue 
-    X_buffer_type:bat[:oid,:int]  := bat.new(:oid,:int,1);
-    X_buffer := pqueue.init(X_buffer_type,5:wrd);
 # enqueue something  
-    pqueue.enqueue_max(X_buffer,5@0:oid,5:int);
+    b := bat.new(:oid,:int);
+    bat.append(b,1);
+    bat.append(b,0);
+    bat.append(b,2);
+    bat.append(b,2);
+    bat.append(b,5);
+    bat.append(b,5);
+    bat.append(b,3);
+    io.print(b);
+    bp := pqueue.topn_min(b,0:wrd,false);
+    io.print(bp);
+    bp := pqueue.topn_min(b,1:wrd,false);
+    io.print(bp);
+    bp := pqueue.topn_min(b,2:wrd,false);
+    io.print(bp);
+    bp := pqueue.topn_min(b,3:wrd,false);
+    io.print(bp);
+    bp := pqueue.topn_min(b,4:wrd,false);
+    io.print(bp);
+    bp := pqueue.topn_min(b,5:wrd,false);
+    io.print(bp);
+    bp := pqueue.topn_min(b,6:wrd,false);
+    io.print(bp);
+    bp := pqueue.topn_min(b,7:wrd,false);
+    io.print(bp);
+    bp := pqueue.topn_min(b,8:wrd,false);
+    io.print(bp);
 end main;
+#--------------------------#
+# h    t  # name
+# void int  # type
+#--------------------------#
+[ 0@0, 1  ]
+[ 1@0, 0  ]
+[ 2@0, 2  ]
+[ 3@0, 2  ]
+[ 4@0, 5  ]
+[ 5@0, 5  ]
+[ 6@0, 3  ]
+#--------------------------#
+# h    t  # name
+# void oid  # type
+#--------------------------#
+#--------------------------#
+# h    t  # name
+# void oid  # type
+#--------------------------#
+[ 0@0, 1@0  ]
+#--------------------------#
+# h    t  # name
+# void oid  # type
+#--------------------------#
+[ 0@0, 1@0  ]
+[ 1@0, 0@0  ]
+#--------------------------#
+# h    t  # name
+# void oid  # type
+#--------------------------#
+[ 0@0, 1@0  ]
+[ 1@0, 0@0  ]
+[ 2@0, 2@0  ]
+#--------------------------#
+# h    t  # name
+# void oid  # type
+#--------------------------#
+[ 0@0, 1@0  ]
+[ 1@0, 0@0  ]
+[ 2@0, 2@0  ]
+[ 3@0, 3@0  ]
+#--------------------------#
+# h    t  # name
+# void oid  # type
+#--------------------------#
+[ 0@0, 1@0  ]
+[ 1@0, 0@0  ]
+[ 2@0, 2@0  ]
+[ 3@0, 3@0  ]
+[ 4@0, 6@0  ]
+#--------------------------#
+# h    t  # name
+# void oid  # type
+#--------------------------#
+[ 0@0, 1@0  ]
+[ 1@0, 0@0  ]
+[ 2@0, 2@0  ]
+[ 3@0, 3@0  ]
+[ 4@0, 6@0  ]
+[ 5@0, 5@0  ]
+#--------------------------#
+# h    t  # name
+# void oid  # type
+#--------------------------#
+[ 0@0, 1@0  ]
+[ 1@0, 0@0  ]
+[ 2@0, 2@0  ]
+[ 3@0, 3@0  ]
+[ 4@0, 6@0  ]
+[ 5@0, 5@0  ]
+[ 6@0, 4@0  ]
+#--------------------------#
+# h    t  # name
+# void oid  # type
+#--------------------------#
+[ 0@0, 1@0  ]
+[ 1@0, 0@0  ]
+[ 2@0, 2@0  ]
+[ 3@0, 3@0  ]
+[ 4@0, 6@0  ]
+[ 5@0, 5@0  ]
+[ 6@0, 4@0  ]
 
 # 21:06:19 >  
 # 21:06:19 >  "Done."
diff --git a/monetdb5/modules/mal/Tests/pqueueElim.mal 
b/monetdb5/modules/mal/Tests/pqueueElim.mal
new file mode 100644
--- /dev/null
+++ b/monetdb5/modules/mal/Tests/pqueueElim.mal
@@ -0,0 +1,31 @@
+# enqueue something 
+b:= bat.new(:oid,:int);
+
+bat.append(b,1);
+bat.append(b,0);
+bat.append(b,2);
+bat.append(b,2);
+bat.append(b,5);
+bat.append(b,5);
+bat.append(b,3);
+
+io.print(b);
+
+bp:= pqueue.topn_min(b,0:wrd,true);
+io.print(bp);
+bp:= pqueue.topn_min(b,1:wrd,true);
+io.print(bp);
+bp:= pqueue.topn_min(b,2:wrd,true);
+io.print(bp);
+bp:= pqueue.topn_min(b,3:wrd,true);
+io.print(bp);
+bp:= pqueue.topn_min(b,4:wrd,true);
+io.print(bp);
+bp:= pqueue.topn_min(b,5:wrd,true);
+io.print(bp);
+bp:= pqueue.topn_min(b,6:wrd,true);
+io.print(bp);
+bp:= pqueue.topn_min(b,7:wrd,true);
+io.print(bp);
+bp:= pqueue.topn_min(b,8:wrd,true);
+io.print(bp);
diff --git a/monetdb5/modules/mal/Tests/pqueueElim.stable.err 
b/monetdb5/modules/mal/Tests/pqueueElim.stable.err
new file mode 100644
--- /dev/null
+++ b/monetdb5/modules/mal/Tests/pqueueElim.stable.err
@@ -0,0 +1,30 @@
+stderr of test 'pqueueElim` in directory 'monetdb5/modules/mal` itself:
+
+
+# 22:54:13 >  
+# 22:54:13 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=38195" "--set" 
"mapi_usock=/var/tmp/mtest-25516/.s.monetdb.38195" "--set" "monet_prompt=" 
"--forcemito" "--set" "mal_listing=2" 
"--dbpath=/export/scratch1/mk/current//Linux/var/MonetDB/mTests_monetdb5_modules_mal"
 "pqueueElim.mal"
+# 22:54:13 >  
+
+# builtin opt  gdk_dbpath = 
/export/scratch1/mk/current//Linux/var/monetdb5/dbfarm/demo
+# builtin opt  gdk_debug = 0
+# builtin opt  gdk_vmtrim = no
+# builtin opt  monet_prompt = >
+# builtin opt  monet_daemon = no
+# builtin opt  mapi_port = 50000
+# builtin opt  mapi_open = false
+# builtin opt  mapi_autosense = false
+# builtin opt  sql_optimizer = default_pipe
+# builtin opt  sql_debug = 0
+# cmdline opt  gdk_nr_threads = 0
+# cmdline opt  mapi_open = true
+# cmdline opt  mapi_port = 38195
+# cmdline opt  mapi_usock = /var/tmp/mtest-25516/.s.monetdb.38195
+# cmdline opt  monet_prompt = 
+# cmdline opt  mal_listing = 2
+# cmdline opt  gdk_dbpath = 
/export/scratch1/mk/current//Linux/var/MonetDB/mTests_monetdb5_modules_mal
+# cmdline opt  gdk_debug = 536870922
+
+# 22:54:13 >  
+# 22:54:13 >  "Done."
+# 22:54:13 >  
+
diff --git a/monetdb5/modules/mal/Tests/pqueueElim.stable.out 
b/monetdb5/modules/mal/Tests/pqueueElim.stable.out
new file mode 100644
--- /dev/null
+++ b/monetdb5/modules/mal/Tests/pqueueElim.stable.out
@@ -0,0 +1,132 @@
+stdout of test 'pqueueElim` in directory 'monetdb5/modules/mal` itself:
+
+
+# 22:54:13 >  
+# 22:54:13 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=38195" "--set" 
"mapi_usock=/var/tmp/mtest-25516/.s.monetdb.38195" "--set" "monet_prompt=" 
"--forcemito" "--set" "mal_listing=2" 
"--dbpath=/export/scratch1/mk/current//Linux/var/MonetDB/mTests_monetdb5_modules_mal"
 "pqueueElim.mal"
+# 22:54:13 >  
+
+# MonetDB 5 server v11.18.0
+# This is an unreleased version
+# Serving database 'mTests_monetdb5_modules_mal', using 8 threads
+# Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs dynamically 
linked
+# Found 15.591 GiB available main-memory.
+# Copyright (c) 1993-July 2008 CWI.
+# Copyright (c) August 2008-2014 MonetDB B.V., all rights reserved
+# Visit http://www.monetdb.org/ for further information
+# Listening for connection requests on mapi:monetdb://vienna.ins.cwi.nl:38195/
+# Listening for UNIX domain connection requests on 
mapi:monetdb:///var/tmp/mtest-25516/.s.monetdb.38195
+# MonetDB/GIS module loaded
+# MonetDB/JAQL module loaded
+# MonetDB/SQL module loaded
+function user.main():void;
+# enqueue something  
+    b := bat.new(:oid,:int);
+    bat.append(b,1);
+    bat.append(b,0);
+    bat.append(b,2);
+    bat.append(b,2);
+    bat.append(b,5);
+    bat.append(b,5);
+    bat.append(b,3);
+    io.print(b);
+    bp := pqueue.topn_min(b,0:wrd,true);
+    io.print(bp);
+    bp := pqueue.topn_min(b,1:wrd,true);
+    io.print(bp);
+    bp := pqueue.topn_min(b,2:wrd,true);
+    io.print(bp);
+    bp := pqueue.topn_min(b,3:wrd,true);
+    io.print(bp);
+    bp := pqueue.topn_min(b,4:wrd,true);
+    io.print(bp);
+    bp := pqueue.topn_min(b,5:wrd,true);
+    io.print(bp);
+    bp := pqueue.topn_min(b,6:wrd,true);
+    io.print(bp);
+    bp := pqueue.topn_min(b,7:wrd,true);
+    io.print(bp);
+    bp := pqueue.topn_min(b,8:wrd,true);
+    io.print(bp);
+end main;
+#--------------------------#
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to