MonetDB: default - Code reshuffling for variable propagation

2010-08-23 Thread mk
Changeset: 059b0977071a for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=059b0977071a
Modified Files:
MonetDB5/src/optimizer/opt_tarantula.mx
Branch: default
Log Message:

Code reshuffling for variable propagation
The source code calls for a more global perspective on the re-use
of variables in the remainder of a plan. Queries compile, and seem
to run, but still incomplete.


diffs (truncated from 385 to 300 lines):

diff -r 134cdc4cc0c4 -r 059b0977071a MonetDB5/src/optimizer/opt_tarantula.mx
--- a/MonetDB5/src/optimizer/opt_tarantula.mx   Fri Aug 20 17:04:56 2010 +0200
+++ b/MonetDB5/src/optimizer/opt_tarantula.mx   Mon Aug 23 08:20:08 2010 +0200
@@ -391,84 +391,45 @@
 Likewise, look for variables that are produced by other legs and will become 
input parameters.
 @c
 static MalBlkPtr 
-TARmakeleg(Client cntxt, MalBlkPtr mb, InstrPtr *old, int pc, int idx, 
Lifespan span, int *map)
+TARmakeleg(Client cntxt, MalBlkPtr mb, InstrPtr *old, int pc, int idx, int 
*input, int *output, InstrPtr *list)
 {
MalBlkPtr tm = NULL;
InstrPtr p = NULL, sig;
-   int i, j, top=0, fnd, block = 0;
+   int i, top=0, fnd, *alias;
char buf[BUFSIZ];
-   InstrPtr *list = (InstrPtr*) GDKzalloc(sizeof(InstrPtr) * mb-ssize);
-   char *needed= (char*) GDKzalloc(mb-vtop);
-   int *alias= (int*) GDKzalloc(mb-vtop * sizeof(int));
-   int itop = 0, *input = ( int*) GDKzalloc(mb-vtop * sizeof(int));
-   int otop = 0, *output = ( int*) GDKzalloc(mb-vtop * sizeof(int));
Symbol s;
 
assert(old[pc]-fcnname == packRef);
 
-   OPTDEBUGtarantula {
+   OPTDEBUGtarantula 
mnstr_printf(cntxt-fdout,#create leg for %d %d %d\n,pc,idx 
-old[pc]-retc, getArg(old[pc],idx));
-   }
-...@-
-Find the instructions needed. Beware pack operations
-already have been handled and produce their target.
-Build the variable admin table.
-...@c
-   needed[getArg(old[pc],idx)]=1;
-   output[otop++]= getArg(old[pc],idx);
-   for ( j = old[0]-retc; j old[0]-argc; j++)
-   input[itop++]= getArg(old[0],j);
-   for (i = pc-1; i  0; i--){
-   p = old[i];
-
-   fnd = 0;
-   switch( p-barrier ){
-   case EXITsymbol: block++; break;
-   case CATCHsymbol: block--; break;
-   case BARRIERsymbol: block--; break;
-   }
-   if ( block ){
-   for (j = 0; j  p-argc; j++)
-   needed[getArg(p,j)]= 1;
-   fnd = 1;
-   }
-   for (j = 0; j  p-retc; j++)
-   fnd += needed[getArg(p,j)];
-   if ( fnd) { /* instruction is needed */
-   for (j = 0; j  p-argc; j++){
-   assert(getArg(p,j) =0);
-   needed[getArg(p,j)]= 1;
-   if ( getEndLifespan(span, getArg(p,j))  pc)
-   output[otop++]= getArg(p,j);
-   if ( map[getArg(p,j)] != getArg(p,j) )
-   input[itop++] = getArg(p,j);
-   }
-   list[top++] = p;
-   }
-   }
 @-
 The leg should have enough instructions to warrant a distributed execution. 
This should involve
 a careful analysis of the instructions assembled. For the time being, we only 
allow for a leg 
 if at least a sql.bind operation belongs to the list and the leg has a 
minimimal number of statements.
 @c
fnd = 0;
-   for( i=0; itop; i++) {
+   for( i=0; list[i]; i++) {
 fnd += getModuleId(list[i]) == sqlRef  getFunctionId(list[i]) == 
bindRef;
 fnd += getModuleId(list[i]) == sqlRef  getFunctionId(list[i]) == 
bindidxRef;
 fnd += getModuleId(list[i]) == sqlRef  getFunctionId(list[i]) == 
binddbatRef;
}
+   top = i;
 
-   if ( top - fnd = MINLEGSIZE) {
-   GDKfree(list);
-   GDKfree(alias);
-   GDKfree(needed);
-   GDKfree(input);
-   GDKfree(output);
+   if ( top - fnd = MINLEGSIZE)
return 0;
+
+   OPTDEBUGtarantula{
+   mnstr_printf(cntxt-fdout,#input );
+   for(i=0; input[i]; i++)
+   mnstr_printf(cntxt-fdout,%d, , input[i]);
+   mnstr_printf(cntxt-fdout,\n#output );
+   for(i=0; output[i]; i++)
+   mnstr_printf(cntxt-fdout,%d, , output[i]);
+   mnstr_printf(cntxt-fdout,\n);
}
-...@-
-Create the leg function.
-...@c
+   alias= (int*) GDKzalloc(mb-vtop * sizeof(int));
+
snprintf(buf,BUFSIZ,%s_%d_%d, getFunctionId(getInstrPtr(mb,0)), 
getArg(old[pc],0), idx-old[pc]-retc);
putName(buf,strlen(buf));
 
@@ -478,15 +439,16 @@
sig= getInstrPtr(tm,0);
setVarType(tm,getArg(sig,0), 

MonetDB: default - Merge with branch, not changing any files.

2010-08-23 Thread Sjoerd Mullender
Changeset: fec324448e55 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fec324448e55
Modified Files:
MonetDB/MonetDB.spec
MonetDB/NT/MonetDB-Common/MonetDB-Common.vdproj
MonetDB/NT/MonetDB-Common/MonetDB-Common64.vdproj
MonetDB/NT/rules.msc
MonetDB/configure.ag
MonetDB/src/gdk/libbat.rc
MonetDB/vertoo.data
MonetDB4/MonetDB-server.spec
MonetDB4/NT/MonetDB.iss
MonetDB4/NT/MonetDB4-Server/MonetDB4-Server.vdproj
MonetDB4/NT/MonetDB4-Server/MonetDB4-Server64.vdproj
MonetDB4/NT/rules.msc
MonetDB4/VERSION
MonetDB4/configure.ag
MonetDB4/src/monet/libmonet.rc
MonetDB4/vertoo.data
MonetDB5/MonetDB-server.spec
MonetDB5/NT/MonetDB5-Server/MonetDB5-Server.vdproj
MonetDB5/NT/MonetDB5-Server/MonetDB5-Server64.vdproj
MonetDB5/NT/rules.msc
MonetDB5/VERSION
MonetDB5/configure.ag
MonetDB5/src/mal/libmonetdb5.rc
MonetDB5/vertoo.data
clients/MonetDB-client.spec
clients/NT/MonetDB-Clients/MonetDB-Clients.vdproj
clients/NT/MonetDB-Clients/MonetDB-Clients64.vdproj
clients/NT/rules.msc
clients/configure.ag
clients/src/mapilib/Mapi.rc
clients/src/odbc/driver/driver.rc

clients/src/odbc/winsetup/MonetDB-ODBC-Installer/MonetDB-ODBC-Installer.vdproj

clients/src/odbc/winsetup/MonetDB-ODBC-Installer64/MonetDB-ODBC-Installer.vdproj
clients/src/odbc/winsetup/setup.rc
clients/vertoo.data
geom/MonetDB-geom.spec
geom/NT/MonetDB5-Geom/MonetDB5-Geom-Module.vdproj
geom/NT/MonetDB5-Geom64/MonetDB5-Geom-Module.vdproj
geom/NT/rules.msc
geom/configure.ag
geom/vertoo.data
java/configure.ag
java/vertoo.data
pathfinder/MonetDB-XQuery.spec
pathfinder/NT/MonetDB4-XQuery/MonetDB4-XQuery-Installer.vdproj
pathfinder/NT/MonetDB4-XQuery/MonetDB4-XQuery.vdproj
pathfinder/NT/MonetDB4-XQuery/MonetDB4-XQuery64.vdproj
pathfinder/NT/MonetDB4-XQuery64/MonetDB4-XQuery-Installer.vdproj
pathfinder/NT/rules.msc
pathfinder/VERSION
pathfinder/configure.ag
pathfinder/runtime/pathfinder.mx
pathfinder/runtime/xrpc/admin/title.html.in
pathfinder/vertoo.data
sql/MonetDB-SQL.spec
sql/NT/MonetDB5-SQL/MonetDB5-SQL-Installer.vdproj
sql/NT/MonetDB5-SQL/MonetDB5-SQL.vdproj
sql/NT/MonetDB5-SQL/MonetDB5-SQL64.vdproj
sql/NT/MonetDB5-SQL64/MonetDB5-SQL-Installer.vdproj
sql/NT/rules.msc
sql/VERSION
sql/configure.ag
sql/vertoo.data
template/configure.ag
template/vertoo.data
testing/MonetDB-testing.spec
testing/NT/rules.msc
testing/configure.ag
testing/vertoo.data
Branch: default
Log Message:

Merge with branch, not changing any files.

___
Checkin-list mailing list
Checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Jun2010 - Preparations for building the Jun2010-SP2 rel...

2010-08-23 Thread Sjoerd Mullender
Changeset: 19ede2d368c6 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=19ede2d368c6
Modified Files:
MonetDB/ChangeLog-Archive
MonetDB/ChangeLog.Jun2010
MonetDB/MonetDB.spec
MonetDB/debian/changelog
MonetDB4/ChangeLog-Archive
MonetDB4/ChangeLog.Jun2010
MonetDB4/MonetDB-server.spec
MonetDB4/debian/changelog
MonetDB5/ChangeLog-Archive
MonetDB5/ChangeLog.Jun2010
MonetDB5/MonetDB-server.spec
MonetDB5/debian/changelog
buildtools/ChangeLog-Archive
buildtools/ChangeLog.Jun2010
buildtools/conf/MonetDB.m4
buildtools/conf/winconfig.h
clients/ChangeLog-Archive
clients/ChangeLog.Jun2010
clients/MonetDB-client.spec
clients/debian/changelog
geom/MonetDB-geom.spec
geom/debian/changelog
java/ChangeLog-Archive
java/ChangeLog.Jun2010
pathfinder/MonetDB-XQuery.spec
pathfinder/debian/changelog
sql/ChangeLog-Archive
sql/ChangeLog.Jun2010
sql/MonetDB-SQL.spec
sql/debian/changelog
sql/src/backends/monet5/merovingian/ChangeLog-Archive
sql/src/backends/monet5/merovingian/ChangeLog.Jun2010
template/ChangeLog-Archive
template/ChangeLog.Jun2010
testing/MonetDB-testing.spec
testing/debian/changelog
Branch: Jun2010
Log Message:

Preparations for building the Jun2010-SP2 release.

Moved contents of ChangeLog.Jun2010 to .spec file and debian/changelog.


diffs (truncated from 1244 to 300 lines):

diff -r fd41b90216dd -r 19ede2d368c6 MonetDB/ChangeLog-Archive
--- a/MonetDB/ChangeLog-Archive Mon Aug 23 09:48:06 2010 +0200
+++ b/MonetDB/ChangeLog-Archive Mon Aug 23 10:13:19 2010 +0200
@@ -1,6 +1,11 @@
 # DO NOT EDIT THIS FILE -- MAINTAINED AUTOMATICALLY
 # This file contains past ChangeLog entries
 
+* Fri Aug 20 2010 Sjoerd Mullender sjo...@acm.org - 1.38.5-20100823
+- Fixed a bug where some internal reference counting was done incorrectly,
+  causing an infinite loop when exiting the server due to it being killed.
+  This bug probably only manifested itself in MonetDB/XQuery.  Bug 2658.
+
 * Mon May 31 2010 Sjoerd Mullender sjo...@acm.org - 1.38.1-20100618
 - Updated Vendor information.
 
diff -r fd41b90216dd -r 19ede2d368c6 MonetDB/ChangeLog.Jun2010
--- a/MonetDB/ChangeLog.Jun2010 Mon Aug 23 09:48:06 2010 +0200
+++ b/MonetDB/ChangeLog.Jun2010 Mon Aug 23 10:13:19 2010 +0200
@@ -1,8 +1,3 @@
 # ChangeLog file for MonetDB
 # This file is updated with Maddlog
 
-* Fri Aug 20 2010 Sjoerd Mullender sjo...@acm.org
-- Fixed a bug where some internal reference counting was done incorrectly,
-  causing an infinite loop when exiting the server due to it being killed.
-  This bug probably only manifested itself in MonetDB/XQuery.  Bug 2658.
-
diff -r fd41b90216dd -r 19ede2d368c6 MonetDB/MonetDB.spec
--- a/MonetDB/MonetDB.spec  Mon Aug 23 09:48:06 2010 +0200
+++ b/MonetDB/MonetDB.spec  Mon Aug 23 10:13:19 2010 +0200
@@ -26,7 +26,7 @@
 Group: Applications/Databases
 License: MPL - http://monetdb.cwi.nl/Legal/MonetDBLicense-1.1.html
 URL: http://monetdb.cwi.nl/
-Source: 
http://dev.monetdb.org/downloads/sources/Jun2010-SP1/%{name}-%{version}.tar.gz
+Source: 
http://dev.monetdb.org/downloads/sources/Jun2010-SP2/%{name}-%{version}.tar.gz
 BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XX)
 
 BuildRequires: zlib-devel, bzip2-devel, openssl-devel
@@ -106,6 +106,14 @@
 %{_libdir}/libbat.so
 
 %changelog
+* Mon Aug 23 2010 Sjoerd Mullender sjo...@acm.org - 1.38.5-20100823
+- Rebuilt.
+
+* Fri Aug 20 2010 Sjoerd Mullender sjo...@acm.org - 1.38.5-20100823
+- Fixed a bug where some internal reference counting was done incorrectly,
+  causing an infinite loop when exiting the server due to it being killed.
+  This bug probably only manifested itself in MonetDB/XQuery.  Bug 2658.
+
 * Tue Jul 13 2010 Sjoerd Mullender sjo...@acm.org - 1.38.3-20100713
 - Rebuilt.
 
diff -r fd41b90216dd -r 19ede2d368c6 MonetDB/debian/changelog
--- a/MonetDB/debian/changelog  Mon Aug 23 09:48:06 2010 +0200
+++ b/MonetDB/debian/changelog  Mon Aug 23 10:13:19 2010 +0200
@@ -1,3 +1,17 @@
+monetdb (1.38.5-20100823) unstable; urgency=low
+
+  * Rebuilt.
+
+ -- Sjoerd Mullender sjo...@acm.org  Mon, 23 Aug 2010 10:13:12 +0200
+
+monetdb (1.38.5-20100823) unstable; urgency=low
+
+  * Fixed a bug where some internal reference counting was done incorrectly,
+causing an infinite loop when exiting the server due to it being killed.
+This bug probably only manifested itself in MonetDB/XQuery.  Bug 2658.
+
+ -- Sjoerd Mullender sjo...@acm.org  Fri, 20 Aug 2010 10:13:11 +0200
+
 monetdb (1.38.3-20100713) unstable; urgency=low
 
   * Rebuilt.
diff -r fd41b90216dd -r 19ede2d368c6 MonetDB4/ChangeLog-Archive
--- a/MonetDB4/ChangeLog-ArchiveMon Aug 23 09:48:06 2010 +0200
+++ b/MonetDB4/ChangeLog-ArchiveMon Aug 23 10:13:19 2010 +0200
@@ -1,6

MonetDB: default - Merge with Jun2010 branch.

2010-08-23 Thread Sjoerd Mullender
Changeset: e13b7117093b for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e13b7117093b
Modified Files:
MonetDB/MonetDB.spec
MonetDB4/MonetDB-server.spec
MonetDB5/MonetDB-server.spec
buildtools/conf/MonetDB.m4
clients/MonetDB-client.spec
geom/MonetDB-geom.spec
pathfinder/MonetDB-XQuery.spec
sql/ChangeLog.Jun2010
sql/MonetDB-SQL.spec
testing/MonetDB-testing.spec
Branch: default
Log Message:

Merge with Jun2010 branch.


diffs (truncated from 1228 to 300 lines):

diff -r fec324448e55 -r e13b7117093b .hgtags
--- a/.hgtags   Mon Aug 23 09:48:20 2010 +0200
+++ b/.hgtags   Mon Aug 23 10:41:27 2010 +0200
@@ -421,3 +421,4 @@
 9aa479df22dda265b8c685f9e15b0899244b0184 Jun2010_3
 9aa479df22dda265b8c685f9e15b0899244b0184 Jun2010_3
 a6dd584e5bee4d0ec428e6aade193c263c55cdb3 Jun2010_3
+19ede2d368c6cba18d6b67cd8bde9d51af2ac9f8 Jun2010_5
diff -r fec324448e55 -r e13b7117093b MonetDB/ChangeLog-Archive
--- a/MonetDB/ChangeLog-Archive Mon Aug 23 09:48:20 2010 +0200
+++ b/MonetDB/ChangeLog-Archive Mon Aug 23 10:41:27 2010 +0200
@@ -1,6 +1,11 @@
 # DO NOT EDIT THIS FILE -- MAINTAINED AUTOMATICALLY
 # This file contains past ChangeLog entries
 
+* Fri Aug 20 2010 Sjoerd Mullender sjo...@acm.org - 1.38.5-20100823
+- Fixed a bug where some internal reference counting was done incorrectly,
+  causing an infinite loop when exiting the server due to it being killed.
+  This bug probably only manifested itself in MonetDB/XQuery.  Bug 2658.
+
 * Mon May 31 2010 Sjoerd Mullender sjo...@acm.org - 1.38.1-20100618
 - Updated Vendor information.
 
diff -r fec324448e55 -r e13b7117093b MonetDB/ChangeLog.Jun2010
--- a/MonetDB/ChangeLog.Jun2010 Mon Aug 23 09:48:20 2010 +0200
+++ b/MonetDB/ChangeLog.Jun2010 Mon Aug 23 10:41:27 2010 +0200
@@ -1,8 +1,3 @@
 # ChangeLog file for MonetDB
 # This file is updated with Maddlog
 
-* Fri Aug 20 2010 Sjoerd Mullender sjo...@acm.org
-- Fixed a bug where some internal reference counting was done incorrectly,
-  causing an infinite loop when exiting the server due to it being killed.
-  This bug probably only manifested itself in MonetDB/XQuery.  Bug 2658.
-
diff -r fec324448e55 -r e13b7117093b MonetDB/MonetDB.spec
--- a/MonetDB/MonetDB.spec  Mon Aug 23 09:48:20 2010 +0200
+++ b/MonetDB/MonetDB.spec  Mon Aug 23 10:41:27 2010 +0200
@@ -26,7 +26,7 @@
 Group: Applications/Databases
 License: MPL - http://monetdb.cwi.nl/Legal/MonetDBLicense-1.1.html
 URL: http://monetdb.cwi.nl/
-Source: 
http://dev.monetdb.org/downloads/sources/Jun2010-SP1/%{name}-%{version}.tar.gz
+Source: 
http://dev.monetdb.org/downloads/sources/Jun2010-SP2/%{name}-%{version}.tar.gz
 BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XX)
 
 BuildRequires: zlib-devel, bzip2-devel, openssl-devel
@@ -106,6 +106,14 @@
 %{_libdir}/libbat.so
 
 %changelog
+* Mon Aug 23 2010 Sjoerd Mullender sjo...@acm.org - 1.38.5-20100823
+- Rebuilt.
+
+* Fri Aug 20 2010 Sjoerd Mullender sjo...@acm.org - 1.38.5-20100823
+- Fixed a bug where some internal reference counting was done incorrectly,
+  causing an infinite loop when exiting the server due to it being killed.
+  This bug probably only manifested itself in MonetDB/XQuery.  Bug 2658.
+
 * Tue Jul 13 2010 Sjoerd Mullender sjo...@acm.org - 1.38.3-20100713
 - Rebuilt.
 
diff -r fec324448e55 -r e13b7117093b MonetDB/debian/changelog
--- a/MonetDB/debian/changelog  Mon Aug 23 09:48:20 2010 +0200
+++ b/MonetDB/debian/changelog  Mon Aug 23 10:41:27 2010 +0200
@@ -1,3 +1,17 @@
+monetdb (1.38.5-20100823) unstable; urgency=low
+
+  * Rebuilt.
+
+ -- Sjoerd Mullender sjo...@acm.org  Mon, 23 Aug 2010 10:13:12 +0200
+
+monetdb (1.38.5-20100823) unstable; urgency=low
+
+  * Fixed a bug where some internal reference counting was done incorrectly,
+causing an infinite loop when exiting the server due to it being killed.
+This bug probably only manifested itself in MonetDB/XQuery.  Bug 2658.
+
+ -- Sjoerd Mullender sjo...@acm.org  Fri, 20 Aug 2010 10:13:11 +0200
+
 monetdb (1.38.3-20100713) unstable; urgency=low
 
   * Rebuilt.
diff -r fec324448e55 -r e13b7117093b MonetDB4/ChangeLog-Archive
--- a/MonetDB4/ChangeLog-ArchiveMon Aug 23 09:48:20 2010 +0200
+++ b/MonetDB4/ChangeLog-ArchiveMon Aug 23 10:41:27 2010 +0200
@@ -1,6 +1,11 @@
 # DO NOT EDIT THIS FILE -- MAINTAINED AUTOMATICALLY
 # This file contains past ChangeLog entries
 
+* Thu Jul 22 2010 Sjoerd Mullender sjo...@acm.org - 4.38.5-20100823
+- Slight change to Fedora, Debian, Ubuntu installers: the database
+  directory now has the group setuid bit set so that new databases
+  inherit the group ownership (monetdb).
+
 * Mon May 31 2010 Sjoerd Mullender sjo...@acm.org - 4.38.1-20100618
 - Updated Vendor information.
 
diff -r fec324448e55 -r e13b7117093b MonetDB4/ChangeLog.Jun2010
--- a/MonetDB4/ChangeLog.Jun2010Mon Aug 23 09:48:20 2010 +0200
+++ b/MonetDB4/ChangeLog.Jun2010Mon Aug 23 10:41:27 2010 +0200

MonetDB: default - The registration of the partitions is not sor...

2010-08-23 Thread Romulo Goncalves
Changeset: c9197f503709 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c9197f503709
Modified Files:
MonetDB5/src/optimizer/opt_datacyclotron.mx
Branch: default
Log Message:

The registration of the partitions is not sorted, so when you inject the bind 
call make sure you are using the right partition number


diffs (123 lines):

diff -r e13b7117093b -r c9197f503709 MonetDB5/src/optimizer/opt_datacyclotron.mx
--- a/MonetDB5/src/optimizer/opt_datacyclotron.mx   Mon Aug 23 10:41:27 
2010 +0200
+++ b/MonetDB5/src/optimizer/opt_datacyclotron.mx   Mon Aug 23 15:48:17 
2010 +0200
@@ -30,7 +30,7 @@
 comment Datacyclotron code injection;
 
 
-pattern addReg(sch:str, tab:str, col:str, acc:int, f_bun:int, l_bun:int):int
+pattern addReg(sch:str, tab:str, col:str, acc:int, part:int, f_bun:int, 
l_bun:int):int
 address addRegWrap
 comment Add a regist for partition;
 
@@ -72,6 +72,7 @@
 column[COLUMN_LENG];
int access;
int partitions;
+   int *part_id;
int *f_bun;
int *l_bun;

@@ -80,7 +81,7 @@
 
 DCYcatalog *catalog;
 
-opt_export DCYcatalog* addRegist( str sch, str tab, str col, int acc, int 
f_bun, int l_bun );
+opt_export DCYcatalog* addRegist( str sch, str tab, str col, int acc, int 
part, int f_bun, int l_bun );
 opt_export DCYcatalog* findRegist( str sch, str tab, str col, int acc);
 opt_export DCYcatalog* removePartRegist( str sch, str tab, str col, int acc, 
int part);
 opt_export int dropRegist( str sch, str tab, str col, int acc );
@@ -101,14 +102,15 @@
str *tab = (str*) getArgReference(stk,pc,2);
str *col = (str*) getArgReference(stk,pc,3);
int acc = *(int*) getArgReference(stk,pc,4);
-   int f_b = *(int*) getArgReference(stk,pc,5);
-   int l_b = *(int*) getArgReference(stk,pc,6);
+   int part = *(int*) getArgReference(stk,pc,5);
+   int f_b = *(int*) getArgReference(stk,pc,6);
+   int l_b = *(int*) getArgReference(stk,pc,7);
 
(void) res;
(void) cntxt;
(void) mb;
 
-   addRegist(*sch, *tab, *col, acc, f_b, l_b);
+   addRegist(*sch, *tab, *col, acc, part, f_b, l_b);
 
return MAL_SUCCEED;
 }
@@ -116,24 +118,23 @@
 str
 printRegists(void) {
DCYcatalog *reg = NULL;
-   int chunks = 0, parts = 0;
-   char *res = NULL;
+   int chunks = 0, parts = 0, j = 0;
 
-   reg = catalog;
-   
while(reg) {
chunks++;
+   for (j = 0; j  reg-partitions; j++)
+   printf(X1 := 
datacyclotron.addReg(\%s\,\%s\,\%s\,%d,%d,%d,%d);\n, reg-schema, 
reg-column, reg-column, reg-access, reg-part_id[j], reg-f_bun[j], 
reg-l_bun[j]);
parts += reg-partitions;
 reg = reg-next;
 }
 
-   sprintf(res, The catalog for the datacyclotron optimizer contains %d 
chunks and %d partitions.\n, chunks, parts); 
+   printf(The catalog for the datacyclotron optimizer contains %d chunks 
and %d partitions.\n, chunks, parts);
 
return res; 
 }
 
 DCYcatalog*
-addRegist( str sch, str tab, str col, int acc, int f_bun, int l_bun ) {
+addRegist( str sch, str tab, str col, int acc, int part, int f_bun, int l_bun 
) {
DCYcatalog *reg = NULL;
 
if (!(reg = findRegist(sch, tab, col, acc))) {
@@ -146,15 +147,18 @@
reg-next = catalog;
catalog = reg;
 
+   reg-part_id = GDKmalloc(DCYPARTITIONS*sizeof(int));
reg-f_bun = GDKmalloc(DCYPARTITIONS*sizeof(int));
reg-l_bun = GDKmalloc(DCYPARTITIONS*sizeof(int));
}
 
if ( reg-partitions  !(reg-partitions%DCYPARTITIONS) ) {
+   reg-part_id = GDKrealloc(reg-part_id, (reg-partitions + 
DCYPARTITIONS) *sizeof(int));
reg-f_bun = GDKrealloc(reg-f_bun, (reg-partitions + 
DCYPARTITIONS) *sizeof(int));
reg-l_bun = GDKrealloc(reg-l_bun, (reg-partitions + 
DCYPARTITIONS) *sizeof(int));
}
 
+   reg-part_id[reg-partitions] = part;
reg-f_bun[reg-partitions] = f_bun;
reg-l_bun[reg-partitions] = l_bun;
reg-partitions++;
@@ -171,6 +175,7 @@
return NULL;
 
for (i = part; i  (reg-partitions-1); i++) {
+   reg-part_id[i] = reg-part_id[i+1];
reg-f_bun[i] = reg-f_bun[i+1];
reg-l_bun[i] = reg-l_bun[i+1];
}
@@ -200,6 +205,8 @@
prev_reg-next = reg-next;
else
catalog = reg-next;
+   if (reg-part_id)
+   GDKfree(reg-part_id);
if (reg-f_bun)
GDKfree(reg-f_bun);
if (reg-l_bun)
@@ -316,7 +323,7 @@
new = pushStr(mb,new,reg-table);
new = pushStr(mb,new,reg-column);
new = pushInt(mb,new,reg-access);
-   new 

MonetDB: default - Fix compilation broken by a previous commit

2010-08-23 Thread Romulo Goncalves
Changeset: 71015fc33f82 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=71015fc33f82
Modified Files:
MonetDB5/src/optimizer/opt_datacyclotron.mx
Branch: default
Log Message:

Fix compilation broken by a previous commit


diffs (12 lines):

diff -r c9197f503709 -r 71015fc33f82 MonetDB5/src/optimizer/opt_datacyclotron.mx
--- a/MonetDB5/src/optimizer/opt_datacyclotron.mx   Mon Aug 23 15:48:17 
2010 +0200
+++ b/MonetDB5/src/optimizer/opt_datacyclotron.mx   Mon Aug 23 16:24:50 
2010 +0200
@@ -130,7 +130,7 @@
 
printf(The catalog for the datacyclotron optimizer contains %d chunks 
and %d partitions.\n, chunks, parts);
 
-   return res; 
+   return MAL_SUCCEED;
 }
 
 DCYcatalog*
___
Checkin-list mailing list
Checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Fix the command... print the table name and c...

2010-08-23 Thread Romulo Goncalves
Changeset: e10a0732838c for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e10a0732838c
Modified Files:
MonetDB5/src/optimizer/opt_datacyclotron.mx
Branch: default
Log Message:

Fix the command... print the table name and column name instead of the column 
name twice.


diffs (12 lines):

diff -r 71015fc33f82 -r e10a0732838c MonetDB5/src/optimizer/opt_datacyclotron.mx
--- a/MonetDB5/src/optimizer/opt_datacyclotron.mx   Mon Aug 23 16:24:50 
2010 +0200
+++ b/MonetDB5/src/optimizer/opt_datacyclotron.mx   Mon Aug 23 16:38:52 
2010 +0200
@@ -123,7 +123,7 @@
while(reg) {
chunks++;
for (j = 0; j  reg-partitions; j++)
-   printf(X1 := 
datacyclotron.addReg(\%s\,\%s\,\%s\,%d,%d,%d,%d);\n, reg-schema, 
reg-column, reg-column, reg-access, reg-part_id[j], reg-f_bun[j], 
reg-l_bun[j]);
+   printf(X1 := 
datacyclotron.addReg(\%s\,\%s\,\%s\,%d,%d,%d,%d);\n, reg-schema, 
reg-table, reg-column, reg-access, reg-part_id[j], reg-f_bun[j], 
reg-l_bun[j]);
parts += reg-partitions;
 reg = reg-next;
 }
___
Checkin-list mailing list
Checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Jun2010 - replaced ATOMput() by Tputvalue() to ensure c...

2010-08-23 Thread Stefan Manegold
Changeset: d2bb75d965f7 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d2bb75d965f7
Modified Files:
MonetDB4/src/modules/plain/aggrX3_be_minmax.mx
MonetDB4/src/modules/plain/aggrX3_bge_minmax.mx
MonetDB5/src/modules/kernel/aggr_be_minmax.mx
MonetDB5/src/modules/kernel/aggr_bge_minmax.mx
MonetDB5/src/modules/kernel/batcast.mx
Branch: Jun2010
Log Message:

replaced ATOMput() by Tputvalue() to ensure correct string handling

Triggered by crashes (segfaults or bus errors) due to non-aligned memory access
with some customer tests on our Sun Solaris T1000 machine:
To insert string values into a BAT, we need to use [HT]putvalue()
instead of ATOMput(), as only the former ensures correct handling
of variable/adaptive BUNheap type/width.


diffs (105 lines):

diff -r 820b55208c5c -r d2bb75d965f7 
MonetDB4/src/modules/plain/aggrX3_be_minmax.mx
--- a/MonetDB4/src/modules/plain/aggrX3_be_minmax.mxMon Aug 23 10:15:54 
2010 +0200
+++ b/MonetDB4/src/modules/plain/aggrX3_be_minmax.mxMon Aug 23 22:17:30 
2010 +0200
@@ -115,7 +115,7 @@
ptr val = extrem...@8];
(void) h;   /* silence compiler about unused variable */
/* trick: using a void head-type, only the tail are 
(over)written */
-   ATOMput(bn-ttype, bn-T-vheap, BUNtloc(bni,r), val?val:nil);
+   Tputvalue(bn, BUNtloc(bni,r), val?val:nil, 0);
}
 @c
 /* aggrX3_minmax_oid
@@ -200,7 +200,7 @@
oid val = h...@8] ? extrem...@8] : *(oid*)nil;
(void) h;   /* silence compiler about unused variable */
/* trick: using a void head-type, only the tail are 
(over)written */
-   ATOMput(bn-ttype, bn-T-vheap, BUNtloc(bni,r), val);
+   Tputvalue(bn, BUNtloc(bni,r), val, 0);
}
 @c
 
diff -r 820b55208c5c -r d2bb75d965f7 
MonetDB4/src/modules/plain/aggrX3_bge_minmax.mx
--- a/MonetDB4/src/modules/plain/aggrX3_bge_minmax.mx   Mon Aug 23 10:15:54 
2010 +0200
+++ b/MonetDB4/src/modules/plain/aggrX3_bge_minmax.mx   Mon Aug 23 22:17:30 
2010 +0200
@@ -127,7 +127,7 @@
oid *h = (oid*)b...@4(bni,r);
ptr val = extrem...@8];
(void) h;   /* silence compiler about unused variable */
-   ATOMput(bn-ttype, bn-T-vheap, BUNtloc(bni,r), val?val:nil);
+   Tputvalue(bn, BUNtloc(bni,r), val?val:nil, 0);
}
 @c
 /* aggrX3_minmax3_oid
@@ -224,7 +224,7 @@
oid *h = (oid*)b...@4(bni,r);
oid val = h...@8] ? extrem...@8] : *(oid*)nil;
(void) h;   /* silence compiler about unused variable */
-   ATOMput(bn-ttype, bn-T-vheap, BUNtloc(bni,r), val);
+   Tputvalue(bn, BUNtloc(bni,r), val, 0);
}
 @c
 
diff -r 820b55208c5c -r d2bb75d965f7 
MonetDB5/src/modules/kernel/aggr_be_minmax.mx
--- a/MonetDB5/src/modules/kernel/aggr_be_minmax.mx Mon Aug 23 10:15:54 
2010 +0200
+++ b/MonetDB5/src/modules/kernel/aggr_be_minmax.mx Mon Aug 23 22:17:30 
2010 +0200
@@ -118,7 +118,7 @@
ptr val = extrem...@8];
(void) h;   /* silence compiler about unused variable */
/* trick: using a void head-type, only the tail are 
(over)written */
-   ATOMput(bn-ttype, bn-T-vheap, BUNtloc(bni,r), val?val:nil);
+   Tputvalue(bn, BUNtloc(bni,r), val?val:nil, 0);
}
BATaccessEnd(bn,USE_HEAD|USE_TAIL,MMAP_SEQUENTIAL);
 @c
@@ -209,7 +209,7 @@
oid val = h...@8] ? extrem...@8] : *(oid*)nil;
(void) h;   /* silence compiler about unused variable */
/* trick: using a void head-type, only the tail are 
(over)written */
-   ATOMput(bn-ttype, bn-T-vheap, BUNtloc(bni,r), val);
+   Tputvalue(bn, BUNtloc(bni,r), val, 0);
}
BATaccessEnd(bn,USE_HEAD|USE_TAIL,MMAP_SEQUENTIAL);
 @c
diff -r 820b55208c5c -r d2bb75d965f7 
MonetDB5/src/modules/kernel/aggr_bge_minmax.mx
--- a/MonetDB5/src/modules/kernel/aggr_bge_minmax.mxMon Aug 23 10:15:54 
2010 +0200
+++ b/MonetDB5/src/modules/kernel/aggr_bge_minmax.mxMon Aug 23 22:17:30 
2010 +0200
@@ -98,7 +98,7 @@
oid *h = (oid*)b...@4(bni,r);
ptr val = extrem...@8];
(void) h;   /* silence compiler about unused variable */
-   ATOMput(bn-ttype, bn-T-vheap, BUNtloc(bni,r), val?val:nil);
+   Tputvalue(bn, BUNtloc(bni,r), val?val:nil, 0);
}
BATaccessEnd(bn,USE_HEAD|USE_TAIL,MMAP_SEQUENTIAL);
 @c
@@ -264,7 +264,7 @@
oid *h = (oid*)b...@4(bni,r);
oid val = h...@8] ? extrem...@8] : *(oid*)nil;
(void) h;   /* silence compiler about unused variable */
-   ATOMput(bn-ttype, bn-T-vheap, BUNtloc(bni,r), val);
+   Tputvalue(bn, BUNtloc(bni,r), val, 0);
}
 @c
 
diff -r 

MonetDB: default - merged with Jun2010 branch

2010-08-23 Thread Stefan Manegold
Changeset: 63636aa65bcb for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=63636aa65bcb
Modified Files:

Branch: default
Log Message:

merged with Jun2010 branch


diffs (105 lines):

diff -r 394707c186c7 -r 63636aa65bcb 
MonetDB4/src/modules/plain/aggrX3_be_minmax.mx
--- a/MonetDB4/src/modules/plain/aggrX3_be_minmax.mxMon Aug 23 16:53:50 
2010 +0200
+++ b/MonetDB4/src/modules/plain/aggrX3_be_minmax.mxMon Aug 23 22:21:43 
2010 +0200
@@ -115,7 +115,7 @@
ptr val = extrem...@8];
(void) h;   /* silence compiler about unused variable */
/* trick: using a void head-type, only the tail are 
(over)written */
-   ATOMput(bn-ttype, bn-T-vheap, BUNtloc(bni,r), val?val:nil);
+   Tputvalue(bn, BUNtloc(bni,r), val?val:nil, 0);
}
 @c
 /* aggrX3_minmax_oid
@@ -200,7 +200,7 @@
oid val = h...@8] ? extrem...@8] : *(oid*)nil;
(void) h;   /* silence compiler about unused variable */
/* trick: using a void head-type, only the tail are 
(over)written */
-   ATOMput(bn-ttype, bn-T-vheap, BUNtloc(bni,r), val);
+   Tputvalue(bn, BUNtloc(bni,r), val, 0);
}
 @c
 
diff -r 394707c186c7 -r 63636aa65bcb 
MonetDB4/src/modules/plain/aggrX3_bge_minmax.mx
--- a/MonetDB4/src/modules/plain/aggrX3_bge_minmax.mx   Mon Aug 23 16:53:50 
2010 +0200
+++ b/MonetDB4/src/modules/plain/aggrX3_bge_minmax.mx   Mon Aug 23 22:21:43 
2010 +0200
@@ -127,7 +127,7 @@
oid *h = (oid*)b...@4(bni,r);
ptr val = extrem...@8];
(void) h;   /* silence compiler about unused variable */
-   ATOMput(bn-ttype, bn-T-vheap, BUNtloc(bni,r), val?val:nil);
+   Tputvalue(bn, BUNtloc(bni,r), val?val:nil, 0);
}
 @c
 /* aggrX3_minmax3_oid
@@ -224,7 +224,7 @@
oid *h = (oid*)b...@4(bni,r);
oid val = h...@8] ? extrem...@8] : *(oid*)nil;
(void) h;   /* silence compiler about unused variable */
-   ATOMput(bn-ttype, bn-T-vheap, BUNtloc(bni,r), val);
+   Tputvalue(bn, BUNtloc(bni,r), val, 0);
}
 @c
 
diff -r 394707c186c7 -r 63636aa65bcb 
MonetDB5/src/modules/kernel/aggr_be_minmax.mx
--- a/MonetDB5/src/modules/kernel/aggr_be_minmax.mx Mon Aug 23 16:53:50 
2010 +0200
+++ b/MonetDB5/src/modules/kernel/aggr_be_minmax.mx Mon Aug 23 22:21:43 
2010 +0200
@@ -118,7 +118,7 @@
ptr val = extrem...@8];
(void) h;   /* silence compiler about unused variable */
/* trick: using a void head-type, only the tail are 
(over)written */
-   ATOMput(bn-ttype, bn-T-vheap, BUNtloc(bni,r), val?val:nil);
+   Tputvalue(bn, BUNtloc(bni,r), val?val:nil, 0);
}
BATaccessEnd(bn,USE_HEAD|USE_TAIL,MMAP_SEQUENTIAL);
 @c
@@ -209,7 +209,7 @@
oid val = h...@8] ? extrem...@8] : *(oid*)nil;
(void) h;   /* silence compiler about unused variable */
/* trick: using a void head-type, only the tail are 
(over)written */
-   ATOMput(bn-ttype, bn-T-vheap, BUNtloc(bni,r), val);
+   Tputvalue(bn, BUNtloc(bni,r), val, 0);
}
BATaccessEnd(bn,USE_HEAD|USE_TAIL,MMAP_SEQUENTIAL);
 @c
diff -r 394707c186c7 -r 63636aa65bcb 
MonetDB5/src/modules/kernel/aggr_bge_minmax.mx
--- a/MonetDB5/src/modules/kernel/aggr_bge_minmax.mxMon Aug 23 16:53:50 
2010 +0200
+++ b/MonetDB5/src/modules/kernel/aggr_bge_minmax.mxMon Aug 23 22:21:43 
2010 +0200
@@ -98,7 +98,7 @@
oid *h = (oid*)b...@4(bni,r);
ptr val = extrem...@8];
(void) h;   /* silence compiler about unused variable */
-   ATOMput(bn-ttype, bn-T-vheap, BUNtloc(bni,r), val?val:nil);
+   Tputvalue(bn, BUNtloc(bni,r), val?val:nil, 0);
}
BATaccessEnd(bn,USE_HEAD|USE_TAIL,MMAP_SEQUENTIAL);
 @c
@@ -264,7 +264,7 @@
oid *h = (oid*)b...@4(bni,r);
oid val = h...@8] ? extrem...@8] : *(oid*)nil;
(void) h;   /* silence compiler about unused variable */
-   ATOMput(bn-ttype, bn-T-vheap, BUNtloc(bni,r), val);
+   Tputvalue(bn, BUNtloc(bni,r), val, 0);
}
 @c
 
diff -r 394707c186c7 -r 63636aa65bcb MonetDB5/src/modules/kernel/batcast.mx
--- a/MonetDB5/src/modules/kernel/batcast.mxMon Aug 23 16:53:50 2010 +0200
+++ b/MonetDB5/src/modules/kernel/batcast.mxMon Aug 23 22:21:43 2010 +0200
@@ -235,7 +235,7 @@
@1 *v = (@1*)BUNtail(bi,p);
 
@1ToStr(dst,len, (ptr) v);
-   ATOMput(ty...@1, bn-T-vheap, Tloc(bn,r), dst);
+   Tputvalue(bn, Tloc(bn,r), dst, 1);
if (dst) 
GDKfree(dst);
}
@@ -260,7 +260,7 @@
BATaccessBegin(b, USE_TAIL, MMAP_SEQUENTIAL);
BATloop(b, p, q)