Changeset: 3f5c7fc2326b for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/3f5c7fc2326b
Removed Files:
        monetdb5/modules/kernel/microbenchmark.mal
        monetdb5/scheduler/run_adder.mal
        monetdb5/scheduler/run_isolate.mal
        monetdb5/scheduler/run_memo.mal
Modified Files:
        MonetDB.spec
        monetdb5/mal/mel.h
        monetdb5/modules/kernel/CMakeLists.txt
        monetdb5/modules/kernel/microbenchmark.c
        monetdb5/optimizer/Tests/SingleServer
        monetdb5/scheduler/CMakeLists.txt
        monetdb5/scheduler/Tests/SingleServer
        monetdb5/scheduler/run_adder.c
        monetdb5/scheduler/run_isolate.c
        monetdb5/scheduler/run_memo.c
Branch: Jan2022
Log Message:

Remove last .mal files, use MEL instead for these modules.
Note, in order to use the modules, you need the --loadmodule
argument.  See the SingleServer files that were changed.


diffs (truncated from 435 to 300 lines):

diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -823,9 +823,7 @@ install -d -m 0775 %{buildroot}%{_rundir
 rm -f %{buildroot}%{_libdir}/*.la
 rm -f %{buildroot}%{_libdir}/monetdb5/*.la
 rm -f %{buildroot}%{_libdir}/monetdb5/lib_opt_sql_append.so
-rm -f %{buildroot}%{_libdir}/monetdb5/run_*.mal
 rm -f %{buildroot}%{_libdir}/monetdb5/lib_run_*.so
-rm -f %{buildroot}%{_libdir}/monetdb5/microbenchmark.mal
 rm -f %{buildroot}%{_libdir}/monetdb5/lib_microbenchmark*.so
 rm -f %{buildroot}%{_libdir}/monetdb5/lib_udf*.so
 rm -f %{buildroot}%{_bindir}/monetdb_mtest.sh
diff --git a/monetdb5/mal/mel.h b/monetdb5/mal/mel.h
--- a/monetdb5/mal/mel.h
+++ b/monetdb5/mal/mel.h
@@ -69,7 +69,7 @@ typedef struct __attribute__((__designat
 } mel_arg;
 
 typedef struct __attribute__((__designated_init__)) mel_func {
-       char mod[14];
+       char mod[16];
        char fcn[30];
        const char *cname;
        uint16_t command:1,
diff --git a/monetdb5/modules/kernel/CMakeLists.txt 
b/monetdb5/modules/kernel/CMakeLists.txt
--- a/monetdb5/modules/kernel/CMakeLists.txt
+++ b/monetdb5/modules/kernel/CMakeLists.txt
@@ -69,7 +69,3 @@ install(TARGETS
   microbenchmark
   DESTINATION ${CMAKE_INSTALL_LIBDIR}/monetdb5
   COMPONENT microbenchmark)
-install(FILES
-  microbenchmark.mal
-  DESTINATION ${CMAKE_INSTALL_LIBDIR}/monetdb5
-  COMPONENT microbenchmark)
diff --git a/monetdb5/modules/kernel/microbenchmark.c 
b/monetdb5/modules/kernel/microbenchmark.c
--- a/monetdb5/modules/kernel/microbenchmark.c
+++ b/monetdb5/modules/kernel/microbenchmark.c
@@ -20,17 +20,6 @@
 #include "mal_exception.h"
 #include "mal.h"
 
-#ifndef WIN32
-#define __declspec(x)
-#endif
-
-extern __declspec(dllexport) str MBMrandom(bat *ret, oid *base, lng *size, int 
*domain);
-extern __declspec(dllexport) str MBMrandom_seed(bat *ret, oid *base, lng 
*size, int *domain, const int *seed);
-extern __declspec(dllexport) str MBMuniform(bat *ret, oid *base, lng *size, 
int *domain);
-extern __declspec(dllexport) str MBMnormal(bat *ret, oid *base, lng *size, int 
*domain, int *stddev, int *mean);
-extern __declspec(dllexport) str MBMmix(bat *ret, bat *batid);
-extern __declspec(dllexport) str MBMskewed(bat *ret, oid *base, lng *size, int 
*domain, int *skew);
-
 static gdk_return
 BATrandom(BAT **bn, oid *base, lng *size, int *domain, int seed)
 {
@@ -325,12 +314,7 @@ BATnormal(BAT **bn, oid *base, lng *size
  * The M5 wrapper code
  */
 
-str
-MBMrandom(bat *ret, oid *base, lng *size, int *domain){
-       return MBMrandom_seed ( ret, base, size, domain, &int_nil );
-}
-
-str
+static str
 MBMrandom_seed(bat *ret, oid *base, lng *size, int *domain, const int *seed){
        BAT *bn = NULL;
 
@@ -341,8 +325,12 @@ MBMrandom_seed(bat *ret, oid *base, lng 
        return MAL_SUCCEED;
 }
 
+static str
+MBMrandom(bat *ret, oid *base, lng *size, int *domain){
+       return MBMrandom_seed ( ret, base, size, domain, &int_nil );
+}
 
-str
+static str
 MBMuniform(bat *ret, oid *base, lng *size, int *domain){
        BAT *bn = NULL;
 
@@ -353,7 +341,7 @@ MBMuniform(bat *ret, oid *base, lng *siz
        return MAL_SUCCEED;
 }
 
-str
+static str
 MBMnormal(bat *ret, oid *base, lng *size, int *domain, int *stddev, int *mean){
        BAT *bn = NULL;
        BATnormal(&bn, base, size, domain, stddev, mean);
@@ -364,7 +352,7 @@ MBMnormal(bat *ret, oid *base, lng *size
 }
 
 
-str
+static str
 MBMmix(bat *bn, bat *batid)
 {
        BUN n, r, i;
@@ -389,7 +377,7 @@ MBMmix(bat *bn, bat *batid)
        return MAL_SUCCEED;
 }
 
-str
+static str
 MBMskewed(bat *ret, oid *base, lng *size, int *domain, int *skew){
        BAT *bn = NULL;
 
@@ -400,8 +388,6 @@ MBMskewed(bat *ret, oid *base, lng *size
        return MAL_SUCCEED;
 }
 
-#if 0
-
 #include "mel.h"
 mel_func microbenchmark_init_funcs[] = {
  command("microbenchmark", "random", MBMrandom, false, "Create a BAT with 
random integer distribution; domain == nil:int ? [0:RAND_MAX] : [0,domain)", 
args(1,4, batarg("",int),arg("base",oid),arg("size",lng),arg("domain",int))),
@@ -419,5 +405,3 @@ mel_func microbenchmark_init_funcs[] = {
 #endif
 LIB_STARTUP_FUNC(init_microbenchmark_mal)
 { mal_module("microbenchmark", NULL, microbenchmark_init_funcs); }
-
-#endif
diff --git a/monetdb5/modules/kernel/microbenchmark.mal 
b/monetdb5/modules/kernel/microbenchmark.mal
deleted file mode 100644
--- a/monetdb5/modules/kernel/microbenchmark.mal
+++ /dev/null
@@ -1,34 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0.  If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# Copyright 1997 - July 2008 CWI, August 2008 - 2021 MonetDB B.V.
-
-module microbenchmark;
-
-command random(base:oid, size:lng, domain:int):bat[:int]
-address MBMrandom
-comment "Create a BAT with random integer distribution; domain == nil:int ? 
[0:RAND_MAX] : [0,domain)";
-
-command random(base:oid, size:lng, domain:int, seed:int):bat[:int]
-address MBMrandom_seed
-comment "Create a BAT with random integer distribution,
-         using given seed (seed == nil:int -> no seed used);
-         domain == nil:int ? [0:RAND_MAX] : [0,domain)";
-
-command uniform(base:oid, size:lng, domain:int):bat[:int]
-address MBMuniform
-comment "Create a BAT with uniform integer distribution";
-
-command normal(base:oid, size:lng, domain:int, stddev:int, mean:int):bat[:int]
-address MBMnormal
-comment "Create a BAT with a normal integer distribution";
-
-command mix(b1:bat[:int]):bat[:int]
-address MBMmix
-comment "Mix the BUNs of this BAT";
-
-command skewed(base:oid, size:lng, domain:int, skew:int):bat[:int]
-address MBMskewed
-comment "Create a BAT with skewed integer distribution";
-
diff --git a/monetdb5/optimizer/Tests/SingleServer 
b/monetdb5/optimizer/Tests/SingleServer
--- a/monetdb5/optimizer/Tests/SingleServer
+++ b/monetdb5/optimizer/Tests/SingleServer
@@ -0,0 +1,1 @@
+--loadmodule microbenchmark
diff --git a/monetdb5/scheduler/CMakeLists.txt 
b/monetdb5/scheduler/CMakeLists.txt
--- a/monetdb5/scheduler/CMakeLists.txt
+++ b/monetdb5/scheduler/CMakeLists.txt
@@ -28,10 +28,6 @@ set_target_properties(run_adder
 install(TARGETS run_adder
   DESTINATION ${CMAKE_INSTALL_LIBDIR}/monetdb5
   COMPONENT run_adder)
-install(FILES
-  run_adder.mal
-  DESTINATION ${CMAKE_INSTALL_LIBDIR}/monetdb5
-  COMPONENT run_adder)
 
 add_library(run_isolate MODULE)
 target_sources(run_isolate
@@ -54,10 +50,6 @@ set_target_properties(run_isolate
 install(TARGETS run_isolate
   DESTINATION ${CMAKE_INSTALL_LIBDIR}/monetdb5
   COMPONENT run_isolate)
-install(FILES
-  run_isolate.mal
-  DESTINATION ${CMAKE_INSTALL_LIBDIR}/monetdb5
-  COMPONENT run_isolate)
 
 add_library(run_memo MODULE)
 target_sources(run_memo
@@ -81,7 +73,3 @@ set_target_properties(run_memo
 install(TARGETS run_memo
   DESTINATION ${CMAKE_INSTALL_LIBDIR}/monetdb5
   COMPONENT run_memo)
-install(FILES
-  run_memo.mal
-  DESTINATION ${CMAKE_INSTALL_LIBDIR}/monetdb5
-  COMPONENT run_memo)
diff --git a/monetdb5/scheduler/Tests/SingleServer 
b/monetdb5/scheduler/Tests/SingleServer
--- a/monetdb5/scheduler/Tests/SingleServer
+++ b/monetdb5/scheduler/Tests/SingleServer
@@ -0,0 +1,2 @@
+--loadmodule run_isolate
+--loadmodule run_memo
diff --git a/monetdb5/scheduler/run_adder.c b/monetdb5/scheduler/run_adder.c
--- a/monetdb5/scheduler/run_adder.c
+++ b/monetdb5/scheduler/run_adder.c
@@ -49,12 +49,6 @@
 #include "mal_linker.h"
 #include "mal_client.h"
 
-#ifndef WIN32
-#define __declspec(x)
-#endif
-
-extern __declspec(dllexport) str RUNadder(Client cntxt, MalBlkPtr mb, 
MalStkPtr stk, InstrPtr p);
-
 /*
  * @-
  * THe choice operator first searches the next one to identify
@@ -62,7 +56,9 @@ extern __declspec(dllexport) str RUNadde
  * without the need to declare them upfront.
  */
 /* helper routine that at runtime propagates values to the stack */
-static void adder_addval(MalBlkPtr mb, MalStkPtr stk, int i) {
+static void
+adder_addval(MalBlkPtr mb, MalStkPtr stk, int i)
+{
        ValPtr rhs, lhs = &stk->stk[i];
        if (isVarConstant(mb,i) > 0 ){
                rhs = &getVarConstant(mb,i);
@@ -74,7 +70,7 @@ static void adder_addval(MalBlkPtr mb, M
        }
 }
 
-str
+static str
 RUNadder(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p)
 {
        int total;
@@ -137,3 +133,16 @@ RUNadder(Client cntxt, MalBlkPtr mb, Mal
        GDKfree(old);
        return msg;
 }
+
+#include "mel.h"
+mel_func run_adder_init_funcs[] = {
+ pattern("run_adder", "generate", RUNadder, false, "Generate some statements 
to add more integers", args(1,3, 
arg("",int),arg("target",int),arg("batch",int))),
+ { .imp=NULL }
+};
+#include "mal_import.h"
+#ifdef _MSC_VER
+#undef read
+#pragma section(".CRT$XCU",read)
+#endif
+LIB_STARTUP_FUNC(init_run_adder_mal)
+{ mal_module("run_adder", NULL, run_adder_init_funcs); }
diff --git a/monetdb5/scheduler/run_adder.mal b/monetdb5/scheduler/run_adder.mal
deleted file mode 100644
--- a/monetdb5/scheduler/run_adder.mal
+++ /dev/null
@@ -1,11 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0.  If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# Copyright 1997 - July 2008 CWI, August 2008 - 2021 MonetDB B.V.
-
-module run_adder;
-pattern run_adder.generate(target:int, batch:int):int
-address RUNadder
-comment "Generate some statements to add more integers";
-
diff --git a/monetdb5/scheduler/run_isolate.c b/monetdb5/scheduler/run_isolate.c
--- a/monetdb5/scheduler/run_isolate.c
+++ b/monetdb5/scheduler/run_isolate.c
@@ -36,13 +36,7 @@
 #include "mal_client.h"
 #include "mal_exception.h"
 
-#ifndef WIN32
-#define __declspec(x)
-#endif
-
-extern __declspec(dllexport) str RUNisolation(Client cntxt, MalBlkPtr mb, 
MalStkPtr stk, InstrPtr p);
-
-str
+static str
 RUNisolation(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p)
 {
        (void) cntxt;
@@ -51,3 +45,16 @@ RUNisolation(Client cntxt, MalBlkPtr mb,
        removeInstruction(mb, p);
        return MAL_SUCCEED;
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to