Changeset: 288954341164 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=288954341164
Modified Files:
        sql/backends/monet5/datacell/Makefile.ag
        sql/backends/monet5/datacell/actuator.mx
        sql/backends/monet5/datacell/basket.mx
        sql/backends/monet5/datacell/opt_datacell.mx
        sql/backends/monet5/datacell/receptor.mx
        sql/backends/monet5/datacell/sensor.mx
Branch: default
Log Message:

Merge from head


diffs (truncated from 5661 to 300 lines):

diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -166,6 +166,13 @@
        enable_rdf=$enableval,
        enable_rdf=$dft_rdf)
 
+dft_datacell=no
+AC_ARG_ENABLE(datacell,
+       AS_HELP_STRING([--enable-datacell],
+               [enable datacell stream components (default=no)]),
+       enable_datacell=$enableval,
+       enable_datacell=$dft_datacell)
+
 dft_fits=auto
 AC_ARG_ENABLE(fits,
        AS_HELP_STRING([--enable-fits],
@@ -2220,6 +2227,8 @@
 fi
 AM_CONDITIONAL(HAVE_RAPTOR, test x"$have_raptor" != xno)
 
+AM_CONDITIONAL(ENABLE_DATACELL, test x"$enable_datacell" != xno)
+
 PKG_CHECK_MODULES([curl], [libcurl], [have_curl="yes"], [have_curl="no"])
 if test x"$have_curl" = x"yes" ; then
        AC_DEFINE(HAVE_CURL, 1, [Define if you have the cURL library])
@@ -3223,6 +3232,7 @@
        geom \
        fits \
        rdf \
+       datacell \
        odbc \
        jdbc \
        control \
diff --git a/sql/backends/monet5/Makefile.ag b/sql/backends/monet5/Makefile.ag
--- a/sql/backends/monet5/Makefile.ag
+++ b/sql/backends/monet5/Makefile.ag
@@ -15,7 +15,7 @@
 # Copyright August 2008-2011 MonetDB B.V.
 # All Rights Reserved.
 
-SUBDIRS = NOT_WIN32?vaults UDF NOT_WIN32?LSST NOT_WIN32?datacell
+SUBDIRS = NOT_WIN32?vaults UDF NOT_WIN32?LSST ENABLE_DATACELL?datacell
 
 # force sql.o to not depend on .../rdf/rdf.h since it only optionally created
 RDF_INC = -I../../../monetdb5/extras/rdf
diff --git a/sql/backends/monet5/datacell/Makefile.ag 
b/sql/backends/monet5/datacell/Makefile.ag
--- a/sql/backends/monet5/datacell/Makefile.ag
+++ b/sql/backends/monet5/datacell/Makefile.ag
@@ -42,26 +42,27 @@
                  dcoperator.mx \
                  emitter.mx 
 
-    LIBS = ../../../../monetdb5/tools/libmonetdb5 \
+       LIBS = ../../../../monetdb5/tools/libmonetdb5 \
                ../../../../gdk/libbat 
 }
 
-lib__actuator = {
-       MODULE
-       DIR = libdir/monetdb5
-       SEP = _
-       SOURCES = actuator.mx 
-    LIBS = ../../../../monetdb5/tools/libmonetdb5 \
-               ../../../../gdk/libbat 
+bin_actuator = {
+       # FIXME: usec comes from basket.mx, use GDKusec instead?
+       #        socket_* comes from dcsocket.mx
+       SOURCES = actuator.mx dcsocket.mx
+       LIBS = ../../../../common/stream/libstream \
+                  ../../../../common/options/libmoptions \
+                  ../../../../gdk/libbat 
+               
 }
 
-lib__sensor = {
-       MODULE
-       DIR = libdir/monetdb5
-       SEP = _
-       SOURCES = sensor.mx
-    LIBS = ../../../../monetdb5/tools/libmonetdb5 \
-               ../../../../gdk/libbat 
+bin_sensor = {
+       # FIXME: usec comes from basket.mx, use GDKusec instead?
+       SOURCES = sensor.mx dcsocket.mx
+       LIBS = ../../../../common/stream/libstream \
+                  ../../../../common/options/libmoptions \
+                  ../../../../gdk/libbat \
+                  ../../../../monetdb5/tools/libmonetdb5
 }
 
 scripts_mal = {
diff --git a/sql/backends/monet5/datacell/actuator.mx 
b/sql/backends/monet5/datacell/actuator.mx
--- a/sql/backends/monet5/datacell/actuator.mx
+++ b/sql/backends/monet5/datacell/actuator.mx
@@ -33,8 +33,6 @@
 #define ACTUATOR
 #include "monetdb_config.h"
 #include "gdk.h"
-#include "dcsocket.h" 
-#include "basket.h"
 #ifndef atoll
 #define atoll atol
 #endif
@@ -54,33 +52,43 @@
 #endif
 
 
+#include "dcsocket.h"
+
+#define MYBUFSIZ 64*1024
+#ifndef SHUT_RD
+#define SHUT_RD                0
+#define SHUT_WR                1
+#define SHUT_RDWR      2
+#endif
+
 
 /*#define _DEBUG_ACTUATOR_ */
 #define ACout GDKout
 
 FILE *fd;
-typedef struct ACTUATORCLI{
+typedef struct ACTUATORCLI {
        str name;
        stream *fromServer;
        SOCKET newsockfd;
-       struct ACTUATORCLI *nxt, *prev; 
-}ACrecord, *Actuator;
+       struct ACTUATORCLI *nxt, *prev;
+} ACrecord, *Actuator;
 
-static Actuator acAnchor=NULL; 
+static Actuator acAnchor = NULL;
 
 static Actuator
-ACnew(str nme){
+ACnew(str nme)
+{
        Actuator ac;
-       ac= (Actuator) GDKzalloc(sizeof(ACrecord));
-       ac->name= GDKstrdup(nme);
-       ac->nxt= acAnchor;
-       acAnchor= ac;
+       ac = (Actuator)GDKzalloc(sizeof(ACrecord));
+       ac->name = GDKstrdup(nme);
+       ac->nxt = acAnchor;
+       acAnchor = ac;
        return ac;
 }
 
 #define TCP 1
 #define UDP 2
-static int protocol= TCP;
+static int protocol = TCP;
 
 void
 usage()
@@ -100,62 +108,64 @@
 
 static char *host = "localhost";
 static int port = 50000;
-static char *actuator="X";
-static int server=0;
-static int trace=0;
-static int stamp=1;    /* first column is a timestamp*/
+static char *actuator = "X";
+static int server = 0;
+static int trace = 0;
+static int stamp = 1; /* first column is a timestamp*/
 
-static int statistics=1;
-/*if(statistics!=0) 
-       print statistics; 
-else don't
-collect statistics based on assumption that first
-column denotes time of actuator emission */
+static int statistics = 1;
+/*if(statistics!=0)
+    print statistics;
+   else don't
+   collect statistics based on assumption that first
+   column denotes time of actuator emission */
 
-static int received=0;
-static lng totallatency=0;
-static lng sendFirst=0;
-static lng receivedLast=0;
-static lng receivedFirst=0;
-static int characters=0;
+static int received = 0;
+static lng totallatency = 0;
+static lng sendFirst = 0;
+static lng receivedLast = 0;
+static lng receivedFirst = 0;
+static int characters = 0;
 
 /* control the display and auto terminate the actuator */
 static int batchsize = 1;
 static int sequence = -1;
-static int tuples=0;
+static int tuples = 0;
 
 @-
 The statistics are shown after a fixed number of tuples
-have been received. Align this number with the batches
+have been received.Align this number with the batches
 generated by the sensor and you get a good impression
 of batch effect.
 @c
-void showStatistics(){
+void showStatistics()
+{
        double elaps;
-       int tuplesIntheBuffer=2222;
-       if( received ==0) return;
+       int tuplesIntheBuffer = 2222;
+       if (received == 0) return;
 
 
 
-       mnstr_printf(ACout, "MYBUFSIZ :%d\n", MYBUFSIZ );       
-       mnstr_printf(ACout, "Tuples in the buffer :%d\n", tuplesIntheBuffer );  
-       
-       mnstr_printf(ACout, "\nEvents %d\n",received);
-       mnstr_printf(ACout, "Latency per tuple %6.2f 
microsec\n",(((double)totallatency)/received)/tuplesIntheBuffer);
-       elaps=(double)((receivedLast-sendFirst)*tuplesIntheBuffer/(received));
+       mnstr_printf(ACout, "MYBUFSIZ :%d\n", MYBUFSIZ);
+       mnstr_printf(ACout, "Tuples in the buffer :%d\n", tuplesIntheBuffer);
+
+       mnstr_printf(ACout, "\nEvents %d\n", received);
+       mnstr_printf(ACout, "Latency per tuple %6.2f microsec\n", 
(((double)totallatency) / received) / tuplesIntheBuffer);
+       elaps = (double)((receivedLast - sendFirst) * tuplesIntheBuffer / 
(received));
        /*mnstr_printf(ACout, "receivedLast-sendFirst %d microsec\n", 
receivedLast-sendFirst);*/
        mnstr_printf(ACout, "Elapsed per batch %5.2f microsec\n", elaps);
        mnstr_printf(ACout, "Throughput %8.2f tpl/sec\n", 1000000.0 / elaps * 
tuplesIntheBuffer);
-       mnstr_printf(ACout, "Bandwidth %zu bytes\n", characters*sizeof(char));
+       mnstr_printf(ACout, "Bandwidth %zu bytes\n", characters * sizeof(char));
 
-       
-        /* sent a short tuple to stderr for gnuplot datafile*/
-       if( trace)
-       fprintf(stderr,"events %d throughput %6.2f\n",
-               received,1000000.0 /elaps * tuplesIntheBuffer);
+
+       /* sent a short tuple to stderr for gnuplot datafile*/
+       if (trace)
+               fprintf(stderr, "events %d throughput %6.2f\n",
+                       received, 1000000.0 / elaps * tuplesIntheBuffer);
 }
 
-void terminate(Actuator ac){
+void terminate(Actuator ac)
+{
 #ifdef _DEBUG_ACTUATOR_
        mnstr_printf(ACout, "about to shutdown the actuator\n");
 #endif
@@ -163,12 +173,13 @@
        exit(0);
 }
 
-void stopListening(int i){
-    (void) i;
-    signal(i, SIG_IGN);
-    if (statistics)
-       showStatistics();
-    exit(0);
+void stopListening(int i)
+{
+       (void)i;
+       signal(i, SIG_IGN);
+       if (statistics)
+               showStatistics();
+       exit(0);
 }
 
 extern int consumeStream(Actuator ac);
@@ -178,78 +189,78 @@
 {
        int i, j = 0;
        char *err = NULL;
-       char name[MYBUFSIZ+1];
+       char name[MYBUFSIZ + 1];
        static SOCKET sockfd;
        Actuator ac = NULL;
-       int option_index=0;
+       int option_index = 0;
 
-       static struct option long_options[11] = {
-               {"port", 1, 0, 'p'},
-               {"actuator", 1, 0, 'a'},
-               {"server", 1, 0, 's'},
-               {"statistics", 1, 0, 'S'},
-               {"sequence", 1, 0, 's'},
-               {"batch", 1, 0, 'b'},
-               {"host", 1, 0, 'h'},
-               {"help", 1, 0, '?'},
-               {"trace", 1, 0, 't'},
-               {"timestamp", 1, 0, 't'},
-               {0, 0, 0, 0}
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to