Change VES version to 7. Added additional UDAFs 57/957/1
authorvlad shkapenyuk <vshkap@research.att.com>
Fri, 13 Sep 2019 14:38:52 +0000 (10:38 -0400)
committervlad shkapenyuk <vshkap@research.att.com>
Fri, 13 Sep 2019 14:38:52 +0000 (10:38 -0400)
Signed-off-by: vlad shkapenyuk <vshkap@research.att.com>
Change-Id: Ib9e6fb0644901db08f9d593f1734507b9ca10c6d

cfg/external_fcns.def
include/hfta/hfta.h
include/hfta/hfta_udaf.h
include/lfta/rts_external.h
src/ftacmp/translate_fta.cc
src/lib/gscphftaaux/hfta_udaf.cc
src/tools/gsprintconsole_ves.c

index 43f3839..015e3f2 100644 (file)
@@ -71,6 +71,12 @@ uint FUN [LFTA_LEGAL, COST EXPENSIVE]
        ullong FUN [LFTA_LEGAL,COST FREE]ULLONG(uint);
        ullong FUN [LFTA_LEGAL,COST FREE]ULLONG(int);
 
+///////////////////////////////////////////////////////////
+//          Numeric functions
+///////////////////////////////////////////////////////////
+
+       float FUN [LFTA_LEGAL, COST LOW] sqrt(float); 
+
 
 ///////////////////////////////////////////////////////////
 //          Convert an IPv4 address 
index 535b375..b95f77d 100644 (file)
@@ -21,6 +21,7 @@ Copyright 2014 AT&T Intellectual Property
 #include "base_operator.h"
 #include <vector>
 #include <map>
+#include<math.h>
 #include "rdtsc.h"
 using namespace std;
 
@@ -34,7 +35,8 @@ using namespace std;
 #define LEQ(x,y) ((x)<=(y))
 //     Cast away temporality
 #define non_temporal(x)(x)
-
+//     Access math libraries
+#define sqrt(x) sqrt(x)
 
 
 extern "C" {
index d97e0dd..67dd794 100644 (file)
@@ -94,6 +94,26 @@ void FIRST_STR_hfta_HFTA_AGGR_OUTPUT_(vstring* res, vstring* scratch);
 void FIRST_STR_hfta_HFTA_AGGR_DESTROY_(vstring* scratch);
 
 //      last aggregate
+//  hfta only
+void LAST_HFTA_AGGR_INIT_(gs_uint32_t* scratch);
+void LAST_HFTA_AGGR_REINIT_(gs_uint32_t* scratch);
+void LAST_HFTA_AGGR_UPDATE_(gs_uint32_t* scratch, gs_uint32_t val);
+void LAST_HFTA_AGGR_OUTPUT_(gs_uint32_t* res, gs_uint32_t* scratch);
+void LAST_HFTA_AGGR_DESTROY_(gs_uint32_t* scratch);
+
+void LAST_ULL_HFTA_AGGR_INIT_(gs_uint64_t* scratch);
+void LAST_ULL_HFTA_AGGR_REINIT_(gs_uint64_t* scratch);
+void LAST_ULL_HFTA_AGGR_UPDATE_(gs_uint64_t* scratch, gs_uint64_t val);
+void LAST_ULL_HFTA_AGGR_OUTPUT_(gs_uint64_t* res, gs_uint64_t* scratch);
+void LAST_ULL_HFTA_AGGR_DESTROY_(gs_uint64_t* scratch);
+
+void LAST_STR_HFTA_AGGR_INIT_(vstring* scratch);
+void LAST_STR_HFTA_AGGR_REINIT_(vstring* scratch);
+void LAST_STR_HFTA_AGGR_UPDATE_(vstring* scratch, vstring* val);
+void LAST_STR_HFTA_AGGR_OUTPUT_(vstring* res, vstring* scratch);
+void LAST_STR_HFTA_AGGR_DESTROY_(vstring* scratch);
+
+// hfta/lfta split
 void LAST_hfta_HFTA_AGGR_INIT_(gs_uint32_t* scratch);
 void LAST_hfta_HFTA_AGGR_REINIT_(gs_uint32_t* scratch);
 void LAST_hfta_HFTA_AGGR_UPDATE_(gs_uint32_t* scratch, gs_uint32_t val);
index 1f16682..5e0f197 100644 (file)
@@ -17,6 +17,8 @@
  ------------------------------------------- */
 
 #include <stdint.h>
+#include<math.h>
+
 
 #include "gsconfig.h"
 #include "gstypes.h"
@@ -91,6 +93,10 @@ gs_retval_t str_constructor(struct gs_string *s, gs_sp_t l);
 //     Cast away temporality
 #define non_temporal(x)(x)
 
+//     Access math libraries
+#define sqrt(x) sqrt(x)
+
+
 
 
 gs_uint32_t str_match_offset( gs_uint32_t offset, struct gs_string * s1, struct gs_string * s2);
index 625cbac..4a1263f 100644 (file)
@@ -2520,11 +2520,17 @@ for(ssi_el=extra_external_libs.begin();ssi_el!=extra_external_libs.end();++ssi_e
                
                        fprintf(stderr,"interface %s, LFTA %d, snap length is %d\n",liface.c_str(),mi,snap_lengths[mi]);
 
-               lfta_val[lmach] += "\tfta_register(\""+query_names[mi]+"\", " + (lfta_reuse_options[mi]?"1":"0") + ", ";
-               if(interface_names[mi]=="")
-                               lfta_val[lmach]+="DEFAULTDEV";
-               else
-                               lfta_val[lmach]+='"'+interface_names[mi]+'"';
+                       string this_iface = "DEFAULTDEV";
+                       if(interface_names[mi]!="")
+                               this_iface = '"'+interface_names[mi]+'"';
+                       lfta_val[lmach] += "\tif(!strcmp(device,"+this_iface+"))\n";
+               lfta_val[lmach] += "\t\tfta_register(\""+query_names[mi]+"\", " + (lfta_reuse_options[mi]?"1":"0") + ", ";
+//             if(interface_names[mi]=="")
+//                             lfta_val[lmach]+="DEFAULTDEV";
+//             else
+//                             lfta_val[lmach]+='"'+interface_names[mi]+'"';
+                       lfta_val[lmach] += this_iface;
+
 
                lfta_val[lmach] += ", "+generate_alloc_name(query_names[mi])
                        +"\n#ifndef LFTA_IN_NIC\n\t,"+generate_schema_string_name(query_names[mi])
index fb0f1d5..ad26871 100644 (file)
@@ -331,6 +331,57 @@ void FIRST_STR_hfta_HFTA_AGGR_DESTROY_(vstring* scratch) { }
 /////////////////////////////////////////////////////////
 //             LAST aggregate
 
+// hfta only
+
+void LAST_HFTA_AGGR_INIT_(gs_uint32_t* scratch) { }
+
+void LAST_HFTA_AGGR_REINIT_(gs_uint32_t* scratch) { }
+
+void LAST_HFTA_AGGR_UPDATE_(gs_uint32_t* scratch, gs_uint32_t val) {
+       *scratch = val;
+}
+
+void LAST_HFTA_AGGR_OUTPUT_(gs_uint32_t* res, gs_uint32_t* scratch) {
+       *res = *scratch;
+}
+
+void LAST_HFTA_AGGR_DESTROY_(gs_uint32_t* scratch) { }
+
+void LAST_ULLHFTA_AGGR_INIT_(gs_uint64_t* scratch) { }
+
+void LAST_ULL_HFTA_AGGR_REINIT_(gs_uint64_t* scratch) { }
+
+void LAST_ULL_HFTA_AGGR_UPDATE_(gs_uint64_t* scratch, gs_uint64_t val) {
+       *scratch = val;
+}
+
+void LAST_ULL_HFTA_AGGR_OUTPUT_(gs_uint64_t* res, gs_uint64_t* scratch) {
+       *res = *scratch;
+}
+
+void LAST_ULL_HFTA_AGGR_DESTROY_(gs_uint64_t* scratch) { }
+
+
+void LAST_STR_HFTA_AGGR_INIT_(vstring* scratch) {
+       scratch->offset= 0;
+}
+
+void LAST_STR_HFTA_AGGR_REINIT_(vstring* scratch) { }
+
+void LAST_STR_HFTA_AGGR_UPDATE_(vstring* scratch, vstring* val) {
+       scratch->length = val->length;
+  scratch->offset = val->offset;
+  scratch->reserved = SHALLOW_COPY;
+}
+
+void LAST_STR_HFTA_AGGR_OUTPUT_(vstring* res, vstring* scratch) {
+       *res = *scratch;
+}
+
+void LAST_STR_HFTA_AGGR_DESTROY_(vstring* scratch) { }
+
+// hfta/lfta split
+
 void LAST_hfta_HFTA_AGGR_INIT_(gs_uint32_t* scratch) { }
 
 void LAST_hfta_HFTA_AGGR_REINIT_(gs_uint32_t* scratch) { }
index 9208316..30ddab8 100644 (file)
@@ -173,7 +173,7 @@ int main(int argc, char* argv[]) {
        gs_sp_t curl_auth = NULL;
        gs_uint32_t http_code;
 
-       gs_uint32_t ves_version=5;
+       gs_uint32_t ves_version=7;
 
 
     gs_uint32_t tlimit = 0;     // time limit in seconds