Changeset: 41792ef57001 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=41792ef57001
Added Files:
        MonetDB5/NT/M5server.bat
Modified Files:
        MonetDB5/mal/mal.c
        MonetDB5/mal/mal.h
        MonetDB5/optimizer/opt_mitosis.c
        clients/NT/mclient.bat
        clients/NT/msqldump.bat
        clients/NT/stethoscope.bat
        clients/Tests/exports.stable.out
        clients/odbc/driver/README
        gdk/gdk_bbp.c
        gdk/gdk_heap.c
        tools/mserver/mserver5.c
Branch: gdk-tracer
Log Message:

Merge branch 'branches/default' into branches/gdk-tracer


diffs (truncated from 326 to 300 lines):

diff --git a/MonetDB5/NT/M5server.bat b/MonetDB5/NT/M5server.bat
new file mode 100755
--- /dev/null
+++ b/MonetDB5/NT/M5server.bat
@@ -0,0 +1,57 @@
+@REM This Source Code Form is subject to the terms of the Mozilla Public
+@REM License, v. 2.0.  If a copy of the MPL was not distributed with this
+@REM file, You can obtain one at http://mozilla.org/MPL/2.0/.
+@REM
+@REM Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V.
+
+@echo off
+
+setlocal
+
+rem figure out the folder name
+set MONETDB=%~dp0
+
+rem remove the final backslash from the path
+set MONETDB=%MONETDB:~0,-1%
+
+rem extend the search path with our EXE and DLL folders
+set PATH=%MONETDB%\bin;%MONETDB%\lib\monetdb5;%PATH%
+
+rem prepare the arguments to mserver5 to tell it where to put the dbfarm
+
+if "%APPDATA%" == "" goto usevar
+rem if the APPDATA variable does exist, put the database there
+set MONETDBDIR=%APPDATA%\MonetDB5
+set MONETDBFARM="--dbpath=%MONETDBDIR%\dbfarm\demo"
+goto skipusevar
+:usevar
+rem if the APPDATA variable does not exist, put the database in the
+rem installation folder (i.e. default location, so no command line argument)
+set MONETDBDIR=%MONETDB%\var\MonetDB5
+set MONETDBFARM=
+:skipusevar
+
+rem the SQL log directory used to be in %MONETDBDIR%, but we now
+rem prefer it inside the dbfarm, so move it there
+
+if not exist "%MONETDBDIR%\sql_logs" goto skipmove
+for /d %%i in ("%MONETDBDIR%"\sql_logs\*) do move "%%i" 
"%MONETDBDIR%\dbfarm"\%%~ni\sql_logs
+rmdir "%MONETDBDIR%\sql_logs"
+:skipmove
+
+set MONETDBPYTHONUDF=embedded_py=false
+
+if not exist "%MONETDB%\pyapi_locatepython3.bat" goto skippython3
+call "%MONETDB%\pyapi_locatepython3.bat"
+if not "%MONETDBPYTHONUDF%" == "embedded_py=false" goto skippython2
+:skippython3
+if not exist "%MONETDB%\pyapi_locatepython2.bat" goto skippython2
+call "%MONETDB%\pyapi_locatepython2.bat"
+:skippython2
+
+rem start the real server
+"%MONETDB%\bin\mserver5.exe" --set "prefix=%MONETDB%" --set %MONETDBPYTHONUDF% 
--set "exec_prefix=%MONETDB%" %MONETDBFARM% %*
+
+if ERRORLEVEL 1 pause
+
+endlocal
diff --git a/MonetDB5/mal/mal.c b/MonetDB5/mal/mal.c
--- a/MonetDB5/mal/mal.c
+++ b/MonetDB5/mal/mal.c
@@ -12,7 +12,6 @@
 #include "gdk_tracer.h"
 
 char   monet_cwd[FILENAME_MAX] = { 0 };
-size_t         monet_memory = 0;
 char   monet_characteristics[4096];
 stream *maleventstream = 0;
 
@@ -66,7 +65,6 @@ int mal_init(void){
                return -1;
        }
 #endif
-       monet_memory = MT_npages() * MT_pagesize();
        initNamespace();
        initParser();
 #ifndef HAVE_EMBEDDED
@@ -130,7 +128,6 @@ void mserver_reset(void)
 #endif
 
        memset((char*)monet_cwd, 0, sizeof(monet_cwd));
-       monet_memory = 0;
        memset((char*)monet_characteristics,0, sizeof(monet_characteristics));
        mal_namespace_reset();
        /* No need to clean up the namespace, it will simply be extended
diff --git a/MonetDB5/mal/mal.h b/MonetDB5/mal/mal.h
--- a/MonetDB5/mal/mal.h
+++ b/MonetDB5/mal/mal.h
@@ -44,10 +44,9 @@ mal_export lng MALdebug;
  * leaving a small portion for other programs.
  */
 #define GB (((lng)1024)*1024*1024)
-#define MEMORY_THRESHOLD  (0.2 * monet_memory > 8 * GB?  monet_memory - 8 * 
GB: 0.8 * monet_memory)
+#define MEMORY_THRESHOLD  (0.2 * GDK_mem_maxsize > 8 * GB?  GDK_mem_maxsize - 
8 * GB: 0.8 * GDK_mem_maxsize)
 
 mal_export char     monet_cwd[FILENAME_MAX];
-mal_export size_t      monet_memory;
 mal_export char        monet_characteristics[4096];
 mal_export stream      *maleventstream;
 
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
@@ -125,10 +125,10 @@ OPTmitosisImplementation(Client cntxt, M
         * Take into account the number of client connections, 
         * because all user together are responsible for resource contentions
         */
-       m = monet_memory / argsize;
+       m = GDK_mem_maxsize / argsize;
        /* if data exceeds memory size,
-        * i.e., (rowcnt*argsize > monet_memory),
-        * i.e., (rowcnt > monet_memory/argsize = m) */
+        * i.e., (rowcnt*argsize > GDK_mem_maxsize),
+        * i.e., (rowcnt > GDK_mem_maxsize/argsize = m) */
        assert(threads > 0);
        assert(activeClients > 0);
        if (rowcnt > m && m / threads / activeClients > 0) {
diff --git a/clients/NT/mclient.bat b/clients/NT/mclient.bat
--- a/clients/NT/mclient.bat
+++ b/clients/NT/mclient.bat
@@ -12,8 +12,7 @@ rem remove the final backslash from the 
 set MONETDB=%MONETDB:~0,-1%
 
 rem extend the search path with our EXE and DLL folders
-rem we depend on pthreadVCE.dll having been copied to the lib folder
-set PATH=%MONETDB%\bin;%MONETDB%\lib;%MONETDB%\lib\bin;%PATH%
+set PATH=%MONETDB%\bin;%MONETDB%\lib\monetdb5;%PATH%
 
 if not "%1"=="/STARTED-FROM-MENU" goto skip
 shift
diff --git a/clients/NT/msqldump.bat b/clients/NT/msqldump.bat
--- a/clients/NT/msqldump.bat
+++ b/clients/NT/msqldump.bat
@@ -11,8 +11,7 @@
 @set MONETDB=%MONETDB:~0,-1%
 
 @rem extend the search path with our EXE and DLL folders
-@rem we depend on pthreadVCE.dll having been copied to the lib folder
-@set PATH=%MONETDB%\bin;%MONETDB%\lib;%MONETDB%\lib\bin;%PATH%
+@set PATH=%MONETDB%\bin;%MONETDB%\lib\monetdb5;%PATH%
 
 @rem start the real client
 @"%MONETDB%\bin\msqldump.exe" %*
diff --git a/clients/NT/stethoscope.bat b/clients/NT/stethoscope.bat
--- a/clients/NT/stethoscope.bat
+++ b/clients/NT/stethoscope.bat
@@ -12,8 +12,7 @@ rem remove the final backslash from the 
 set MONETDB=%MONETDB:~0,-1%
 
 rem extend the search path with our EXE and DLL folders
-rem we depend on pthreadVCE.dll having been copied to the lib folder
-set PATH=%MONETDB%\bin;%MONETDB%\lib;%MONETDB%\lib\bin;%PATH%
+set PATH=%MONETDB%\bin;%MONETDB%\lib\monetdb5;%PATH%
 
 rem start the real client
 "%MONETDB%\bin\stethoscope.exe" %1 %2 %3 %4 %5 %6 %7 %8
diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -2388,7 +2388,6 @@ int mnstr_write_string(Stream *S, str da
 str mnstr_write_stringwrap(void *ret, Stream *S, str *data);
 char monet_characteristics[4096];
 char monet_cwd[FILENAME_MAX];
-size_t monet_memory;
 void moveInstruction(MalBlkPtr mb, int pc, int target);
 void msab_dbfarminit(const char *dbfarm);
 void msab_dbpathinit(const char *dbpath);
diff --git a/clients/odbc/driver/README b/clients/odbc/driver/README
--- a/clients/odbc/driver/README
+++ b/clients/odbc/driver/README
@@ -25,7 +25,7 @@ ODBC is chosen to be implemented first b
   ourselves to get this functionality now.
 Update 2016: the JDBC-ODBC bridge driver is no longer needed nor supported in 
JRE.
 We provide a 100% pure (type 4) JDBC driver implementation for MonetDB.
-See: https://www.monetdb.org/downloads/Java/Latest/
+See: https://www.monetdb.org/downloads/Java/
 
 Tip:
 =======================================================================
@@ -33,7 +33,6 @@ To do ODBC driver development/maintenanc
  specification to learn what the ODBC API functions and behavior has to be.
 This specification is available as MS Windows help file (ODBC.HLP and 
ODBC.CNT).
 It is part of the MS ODBC SDK which has become part of the MS MDAC SDK.
-For convenience it is also available in /ufs/dinther/ODBC/
 
 For compilation you need the ODBC API include header files:
        sqltypes.h      /* ODBC type defines */
@@ -51,7 +50,7 @@ All ODBC driver implementation files are
 Every ODBC API function which needs to be implemented by the driver
  has its own file with the same name as the function and suffix ".c".
 The ODBC API functions all start with SQL, so its easy to locate them.
-There are 73 SQL*.c files and thus 73 ODBC API functions implemented.
+There are 76 SQL*.c files and thus 76 ODBC API functions implemented.
 
 The ODBC API function prototypes and defines are defined in sqltypes.h,
  sql.h, sqlext.h and sqlucode.h so there are NO SQL*.h files.
@@ -61,7 +60,7 @@ the sql*.h files and other standard exte
 Every SQL*.c must include this ODBCGlobal.h file as first include.
 
 Besides the SQL*.c files there are the ODBC*.[ch] files.
-The files ODBCEnv.[ch] ODBCDbc.[ch], ODBCStmt.[ch], ODBCHostVar.[ch]
+The files ODBCEnv.[ch] ODBCDbc.[ch], ODBCStmt.[ch], ODBCDesc.[ch]
  and ODBCError.[ch] implement the structures needed to represent the
  handles (pointers to an object) and the internal state of the ODBC objects.
 In the implementation section below it is explained why these are necessary.
@@ -100,7 +99,7 @@ In ODBC multiple environments (each appl
  multiple input parameters per statement, multiple output columns per result
  set.
 The management and validity of these handles is all implemented in
-the ODBCEnv.[ch], ODBCDbc.{ch], ODBCStmt.[ch] and ODBCHostVar.[ch] files.
+the ODBCEnv.[ch], ODBCDbc.[ch], ODBCStmt.[ch] and ODBCDesc.[ch] files.
 
 Error handling in ODBC is done in a special way which is explained here.
 Every ODBC API function returns a code (integer) which can be:
@@ -126,7 +125,7 @@ specific handle (e.g. addDbcError()), to
 
 Implementation of the ODBC API functions:
 ------------------------------------------------------------------------
-Although 73 SQL*() functions are implemented, some do not implement the
+Although 76 SQL*() functions are implemented, some do not implement the
  requested behavior or parameter option. They just set an error message code
 and return SQL_ERROR.
 
diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -1744,7 +1744,7 @@ BBPdir_subcommit(int cnt, bat *subcommit
                assert(subcommit[n - 1] < subcommit[n]);
 #endif
 
-       if ((nbbpf = GDKfilelocate(0, "BBP", "wx", "dir")) == NULL)
+       if ((nbbpf = GDKfilelocate(0, "BBP", "w", "dir")) == NULL)
                return GDK_FAIL;
 
        n = (bat) ATOMIC_GET(&BBPsize);
@@ -1856,7 +1856,7 @@ BBPdir(int cnt, bat *subcommit)
                return BBPdir_subcommit(cnt, subcommit);
 
        IODEBUG fprintf(stderr, "#BBPdir: writing BBP.dir (%d bats).\n", (int) 
(bat) ATOMIC_GET(&BBPsize));
-       if ((fp = GDKfilelocate(0, "BBP", "wx", "dir")) == NULL) {
+       if ((fp = GDKfilelocate(0, "BBP", "w", "dir")) == NULL) {
                goto bailout;
        }
 
diff --git a/gdk/gdk_heap.c b/gdk/gdk_heap.c
--- a/gdk/gdk_heap.c
+++ b/gdk/gdk_heap.c
@@ -110,7 +110,6 @@ HEAPalloc(Heap *h, size_t nitems, size_t
                return GDK_FAIL;
        }
        if (GDKinmemory() ||
-           h->size < 4 * GDK_mmap_pagesize ||
            (GDKmem_cursize() + h->size < GDK_mem_maxsize &&
             h->size < (h->farmid == 0 ? GDK_mmap_minsize_persistent : 
GDK_mmap_minsize_transient))) {
                h->storage = STORE_MEM;
@@ -200,7 +199,7 @@ HEAPextend(Heap *h, size_t size, bool ma
                /* extend a malloced heap, possibly switching over to
                 * file-mapped storage */
                Heap bak = *h;
-               bool exceeds_swap = size >= 4 * GDK_mmap_pagesize && size + 
GDKmem_cursize() >= GDK_mem_maxsize;
+               bool exceeds_swap = size + GDKmem_cursize() >= GDK_mem_maxsize;
                bool must_mmap = !GDKinmemory() && (exceeds_swap || 
h->newstorage != STORE_MEM || size >= (h->farmid == 0 ? 
GDK_mmap_minsize_persistent : GDK_mmap_minsize_transient));
 
                h->size = size;
@@ -597,9 +596,6 @@ HEAPfree(Heap *h, bool rmheap)
  * @- HEAPload
  *
  * If we find file X.new, we move it over X (if present) and open it.
- *
- * This routine initializes the h->filename without deallocating its
- * previous contents.
  */
 static gdk_return
 HEAPload_intern(Heap *h, const char *nme, const char *ext, const char *suffix, 
bool trunc)
@@ -609,7 +605,7 @@ HEAPload_intern(Heap *h, const char *nme
        char *srcpath, *dstpath, *tmp;
        int t0;
 
-       h->storage = h->newstorage = h->size < 4 * GDK_mmap_pagesize ? 
STORE_MEM : STORE_MMAP;
+       h->storage = h->newstorage = h->size < GDK_mmap_minsize_persistent ? 
STORE_MEM : STORE_MMAP;
 
        minsize = (h->size + GDK_mmap_pagesize - 1) & ~(GDK_mmap_pagesize - 1);
        if (h->storage != STORE_MEM && minsize != h->size)
diff --git a/tools/mserver/mserver5.c b/tools/mserver/mserver5.c
--- a/tools/mserver/mserver5.c
+++ b/tools/mserver/mserver5.c
@@ -123,13 +123,6 @@ monet_hello(void)
        char  *qc = " kMGTPE";
        int qi = 0;
 
-       monet_memory = MT_npages() * MT_pagesize();
-       sz_mem_h = (dbl) monet_memory;
-       while (sz_mem_h >= 1000.0 && qi < 6) {
-               sz_mem_h /= 1024.0;
-               qi++;
-       }
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to