Changeset: 1cd848c01f20 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1cd848c01f20
Modified Files:
        testing/Mtest.py.in
        tools/mserver/monet_version.c.in
        tools/mserver/mserver5.c
Branch: int128
Log Message:

report (and use) whether we have support or 128-bit integers:

In the mserver5 welcome message and in its --version information
report wether the server has been built with 128-bit integer support
(just as we report 32/64-bit architecture and 32/64-bit OIDs),
and make Mtest.py exploit that information to prepare for
128-bit integer ("int128") specific output.


diffs (202 lines):

diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -1556,10 +1556,11 @@ def GetBitsAndOIDsAndModsAndStaticAndThr
     env['TST_MODS'] = []
     env['TST_BITS'] = ""
     env['TST_OIDS'] = ""
+    env['TST_INT128'] = ""
     env['TST_STATIC'] = ""
     env['TST_SINGLE'] = ""
     if qOut:
-        tbos = re.compile("^# Compiled for .*/([63][42]bit) with ([63][42])bit 
OIDs;? (.*) linked", re.MULTILINE)
+        tbos = re.compile("^# Compiled for .*/([63][42]bit) with ([63][42])bit 
OIDs;?(| and 128bit integers) ([^ ]*) linked", re.MULTILINE)
         tt = re.compile("^# Serving database .*, using ([0-9]+) threads?", 
re.MULTILINE)
         tm = re.compile("^Modules: (.+)$", re.MULTILINE)
         #ts = re.compile("^!ERROR: DL_open: library not found \(STATIC\).$", 
re.MULTILINE)
@@ -1570,7 +1571,10 @@ def GetBitsAndOIDsAndModsAndStaticAndThr
                 os.environ['TST_BITS'] = env['TST_BITS']
                 env['TST_OIDS'] = "oid" + obs.group(2)
                 os.environ['TST_OIDS'] = env['TST_OIDS']
-                if obs.group(3) == "statically":
+                if obs.group(3) == " and 128bit integers":
+                    env['TST_INT128'] = "int128"
+                    os.environ['TST_INT128'] = env['TST_INT128']
+                if obs.group(4) == "statically":
                     env['TST_STATIC'] = "STATIC"
                     os.environ['TST_STATIC'] = env['TST_STATIC']
             t = tt.match(l)
@@ -1646,6 +1650,9 @@ def CheckTests(env, TST, oktests):
 def StableOutErr(env,par,TST,SYST,RELEASE,DIST,VERSION) :
     BITS = env['TST_BITS']
     OIDS = env['TST_OIDS']
+    INT128 = env['TST_INT128']
+    if INT128:
+        INT128 = r"(\.int128)?"
     SINGLE = env['TST_SINGLE']
     if SINGLE:
         SINGLE = r"(\.single)?"
@@ -1653,7 +1660,7 @@ def StableOutErr(env,par,TST,SYST,RELEAS
     if STATIC:
         STATIC = r"(\.STATIC)?"
     dir,file = os.path.split(TST)
-    outre = 
re.compile(r'^%s\.stable\.(?P<tp>out|err)(\.(%s(%s)?|%s(%s)?))?(\.%s)?(\.%s)?%s%s$'
 % (re.escape(file), re.escape(SYST), re.escape(RELEASE), re.escape(DIST), 
re.escape(VERSION), BITS, OIDS, SINGLE, STATIC))
+    outre = 
re.compile(r'^%s\.stable\.(?P<tp>out|err)(\.(%s(%s)?|%s(%s)?))?(\.%s)?(\.%s)?%s%s%s$'
 % (re.escape(file), re.escape(SYST), re.escape(RELEASE), re.escape(DIST), 
re.escape(VERSION), BITS, OIDS, INT128, SINGLE, STATIC))
     bestout = besterr = ''
     for f in os.listdir(dir or os.curdir):
         res = outre.match(f)
@@ -3132,10 +3139,11 @@ def ReadMapproveRc(f) :
     v['VERSION'] = VERSION
     v['BITS'] = ''
     v['OIDS'] = ''
+    v['INT128'] = ''
     v['SINGLE'] = ''
     v['STATIC'] = ''
     if os.path.isfile(f):
-        r = re.compile('^([A-Z]+) = "(.*)".*$')
+        r = re.compile('^([A-Z][A-Z0-9_]*) = "(.*)".*$')
         for l in open(f):
             m = r.match(l)
             if m:
@@ -3433,7 +3441,7 @@ def main(argv) :
     elif THISFILE == 'Mapprove.py':
         f = _configure(os.path.join('@QXprefix@',dftTSTPREF,'.Mapprove.rc'))
         v = ReadMapproveRc(f)
-        for i in 'BITS', 'OIDS', 'SINGLE', 'STATIC':
+        for i in 'BITS', 'OIDS', 'INT128', 'SINGLE', 'STATIC':
             if v[i]:
                 v[i] = '[.%s]' % v[i]
         options = cmd_options + [
@@ -3442,9 +3450,9 @@ def main(argv) :
              "(default: <ext> = 'out' & 'err')"),
             (None, 'S', 'sys', '<sys>',
              "approve specific output *.<ext><sys>\n"
-             "(<sys> = 
'[.(<SYST>[<RELEASE>]|<DIST>[<VERSION>])][.(32|64)bit][.oid(32|64)][.single][.STATIC]',\n"
-             "(default: longest match for <sys> = 
'[.(%s[%s]|%s[%s])]%s%s%s%s')"
-              % (v['SYST'], v['RELEASE'], v['DIST'], v['VERSION'], v['BITS'], 
v['OIDS'], v['SINGLE'], v['STATIC'])),
+             "(<sys> = 
'[.(<SYST>[<RELEASE>]|<DIST>[<VERSION>])][.(32|64)bit][.oid(32|64)][.int128][.single][.STATIC]',\n"
+             "(default: longest match for <sys> = 
'[.(%s[%s]|%s[%s])]%s%s%s%s%s')"
+              % (v['SYST'], v['RELEASE'], v['DIST'], v['VERSION'], v['BITS'], 
v['OIDS'], v['INT128'], v['SINGLE'], v['STATIC'])),
             (None, 'f', 'force', None,
              "force approval of error messages (i.e., lines starting with 
'!')"),
             ]
@@ -3646,17 +3654,17 @@ def main(argv) :
         os.environ['DISTVER'] = DISTVER
         os.environ['VERSION'] = VERSION
         w = {}
-        for i in 'SYST', 'RELEASE', 'DIST', 'VERSION', 'BITS', 'OIDS', 
'SINGLE', 'STATIC':
+        for i in 'SYST', 'RELEASE', 'DIST', 'VERSION', 'BITS', 'OIDS', 
'INT128', 'SINGLE', 'STATIC':
             w[i] = re.escape(v[i])
-        for i in 'BITS', 'OIDS', 'SINGLE', 'STATIC':
+        for i in 'BITS', 'OIDS', 'INT128', 'SINGLE', 'STATIC':
             j = 'TST_'+i
             env[j] = v[i]
             os.environ[j] = v[i]
             if v[i]:
                 v[i] = '(.%s)?' % v[i]
                 w[i] = '(\.%s)?' % w[i]
-        sv = '^(.(%s(%s)?|%s(%s)?))?%s%s%s%s$' % (v['SYST'], v['RELEASE'], 
v['DIST'], v['VERSION'], v['BITS'], v['OIDS'], v['SINGLE'], v['STATIC'])
-        sw = '^(\.(%s(%s)?|%s(%s)?))?%s%s%s%s$' % (w['SYST'], w['RELEASE'], 
w['DIST'], w['VERSION'], w['BITS'], w['OIDS'], w['SINGLE'], w['STATIC'])
+        sv = '^(.(%s(%s)?|%s(%s)?))?%s%s%s%s%s$' % (v['SYST'], v['RELEASE'], 
v['DIST'], v['VERSION'], v['BITS'], v['OIDS'], v['INT128'], v['SINGLE'], 
v['STATIC'])
+        sw = '^(\.(%s(%s)?|%s(%s)?))?%s%s%s%s%s$' % (w['SYST'], w['RELEASE'], 
w['DIST'], w['VERSION'], w['BITS'], w['OIDS'], w['INT128'], w['SINGLE'], 
w['STATIC'])
         r = re.compile(sw)
         if not r.match(par['SYSTEM']):
             ErrXit("System (-S) must match '"+sv+"' !")
@@ -3916,6 +3924,7 @@ def main(argv) :
         env['TST_MODS'] = []
         env['TST_BITS'] = ""
         env['TST_OIDS'] = ""
+        env['TST_INT128'] = ""
         env['TST_SINGLE'] = ""
         env['TST_STATIC'] = ""
         if Check(splitcommand(env['exe']['Mserver'][1]) + ['--dbpath=%s' % 
os.path.join(env['GDK_DBFARM'], TSTPREF)], 'clients.quit();\n'):
@@ -3926,6 +3935,8 @@ def main(argv) :
         if not quiet:
             print "Bits: ", env['TST_BITS']
             print "OIDs: ", env['TST_OIDS']
+            if env['TST_INT128']:
+                print "Integers: 128bit"
             print "Modules: ", env['TST_MODS']
         STDOUT.flush()
 
@@ -3944,7 +3955,7 @@ def main(argv) :
         env['VERSION'] = os.environ['VERSION']
         n = os.path.join(TSTTRGBASE, TSTPREF, '.Mapprove.rc')
         f = open(n, 'w')
-        for v in 'SYST', 'RELEASE', 'DIST', 'VERSION', 'TST_BITS', 'TST_OIDS', 
'TST_SINGLE', 'TST_STATIC':
+        for v in 'SYST', 'RELEASE', 'DIST', 'VERSION', 'TST_BITS', 'TST_OIDS', 
'TST_INT128', 'TST_SINGLE', 'TST_STATIC':
             w = v.replace('TST_','')
             f.write('%s = "%s"\n' % (w, env[v]))
         f.close()
@@ -4026,6 +4037,11 @@ def main(argv) :
         except ImportError:
             now = 'now()'
 
+        if env['TST_INT128'] != '':
+            isInt128 = 'true'
+        else:
+            isInt128 = 'false'
+
         if env['TST_SINGLE'] != '':
             isSingle = 'true'
         else:
@@ -4063,15 +4079,15 @@ def main(argv) :
                 # target is a platform and compilation options etc
                 fl.write("""
 INSERT INTO mtest (\"date\", \"machine\", \"os\", \"release\",
-    \"compiler\", \"compiler_opts\", \"bits\", \"oid\", \"single\", \"static\",
+    \"compiler\", \"compiler_opts\", \"bits\", \"oid\", \"int128\", 
\"single\", \"static\",
     \"product\", \"dir\", \"test\",
     \"time\", \"stdout\", \"stderr\")
 VALUES (%s, '%s', '%s', '%s',
-    '%s', '%s', %s, %s, %s, %s,
+    '%s', '%s', %s, %s, %s, %s, %s,
     '%s', '%s', '%s',
     %s, '%s', '%s');
 """ % (now, host, env['SYST'], env['RELEASE'],
-       ccname, ccopts, bits, oids, isSingle, isStatic,
+       ccname, ccopts, bits, oids, isInt128, isSingle, isStatic,
        product, TSTDIR, TST,
        tms, FAILURES[FtOut][1], FAILURES[FtErr][1]))
         fl.close()
diff --git a/tools/mserver/monet_version.c.in b/tools/mserver/monet_version.c.in
--- a/tools/mserver/monet_version.c.in
+++ b/tools/mserver/monet_version.c.in
@@ -40,9 +40,15 @@ monet_version(void)
        printf("MonetDB 5 server v" VERSION " ");
        if (strcmp(MONETDB_RELEASE, "unreleased") != 0)
                printf("\"%s\" ", MONETDB_RELEASE);
-       printf("(" SZFMT "-bit, " SZFMT "-bit oids)\n",
+       printf("(" SZFMT "-bit, " SZFMT "-bit oids%s)\n",
                        (size_t) (sizeof(ptr) * 8),
-                       (size_t) (sizeof(oid) * 8));
+                       (size_t) (sizeof(oid) * 8),
+#ifdef HAVE_HGE
+                       ", 128-bit integers"
+#else
+                       ""
+#endif
+       );
        if (strcmp(MONETDB_RELEASE, "unreleased") == 0)
                printf("This is an unreleased version\n");
        printf("Copyright (c) 1993-July 2008 CWI\n"
diff --git a/tools/mserver/mserver5.c b/tools/mserver/mserver5.c
--- a/tools/mserver/mserver5.c
+++ b/tools/mserver/mserver5.c
@@ -140,8 +140,14 @@ monet_hello(void)
        printf("\n# Serving database '%s', using %d thread%s\n",
                        GDKgetenv("gdk_dbname"),
                        GDKnr_threads, (GDKnr_threads != 1) ? "s" : "");
-       printf("# Compiled for %s/" SZFMT "bit with " SZFMT "bit OIDs %s 
linked\n",
-                       HOST, sizeof(ptr) * 8, sizeof(oid) * 8, linkinfo);
+       printf("# Compiled for %s/" SZFMT "bit with " SZFMT "bit OIDs %s%s 
linked\n",
+                       HOST, sizeof(ptr) * 8, sizeof(oid) * 8,
+#ifdef HAVE_HGE
+                       "and 128bit integers ",
+#else
+                       "",
+#endif
+                       linkinfo);
        printf("# Found %.3f %ciB available main-memory.\n",
                        sz_mem_h, qc[qi]);
 #ifdef MONET_GLOBAL_DEBUG
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to