Changeset: 4b5756959cd6 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/4b5756959cd6
Modified Files:
        gdk/gdk_aggr.c
Branch: qcancel
Log Message:

timeout correlation, covariance, stdev


diffs (73 lines):

diff --git a/gdk/gdk_aggr.c b/gdk/gdk_aggr.c
--- a/gdk/gdk_aggr.c
+++ b/gdk/gdk_aggr.c
@@ -4487,6 +4487,8 @@ BATcalccorrelation(BAT *b1, BAT *b2)
        do {                                                            \
                const TYPE *restrict vals = (const TYPE *) Tloc(b, 0);  \
                while (ncand > 0) {                                     \
+                       GDK_CHECK_TIMEOUT(timeoffset, counter,\
+                                       
GOTO_LABEL_TIMEOUT_HANDLER(alloc_fail));\
                        ncand--;                                        \
                        i = canditer_next(&ci) - b->hseqbase;           \
                        if (gids == NULL ||                             \
@@ -4549,6 +4551,13 @@ dogroupstdev(BAT **avgb, BAT *b, BAT *g,
        const char *err;
        lng t0 = 0;
 
+       size_t counter = 0;
+       lng timeoffset = 0;
+       QryCtx *qry_ctx = MT_thread_get_qry_ctx();
+       if (qry_ctx != NULL) {
+               timeoffset = (qry_ctx->starttime && qry_ctx->querytimeout) ? 
(qry_ctx->starttime + qry_ctx->querytimeout) : 0;
+       }
+
        TRC_DEBUG_IF(ALGO) t0 = GDKusec();
 
        assert(tp == TYPE_dbl);
@@ -4741,6 +4750,8 @@ BATgroupvariance_population(BAT *b, BAT 
                const TYPE *vals1 = (const TYPE *) Tloc(b1, 0);         \
                const TYPE *vals2 = (const TYPE *) Tloc(b2, 0);         \
                while (ncand > 0) {                                     \
+                       GDK_CHECK_TIMEOUT(timeoffset, counter,\
+                                       
GOTO_LABEL_TIMEOUT_HANDLER(alloc_fail));\
                        ncand--;                                        \
                        i = canditer_next(&ci) - b1->hseqbase;          \
                        if (gids == NULL ||                             \
@@ -4791,6 +4802,14 @@ dogroupcovariance(BAT *b1, BAT *b2, BAT 
        const char *err;
        lng t0 = 0;
 
+       size_t counter = 0;
+       lng timeoffset = 0;
+       QryCtx *qry_ctx = MT_thread_get_qry_ctx();
+       if (qry_ctx != NULL) {
+               timeoffset = (qry_ctx->starttime && qry_ctx->querytimeout) ? 
(qry_ctx->starttime + qry_ctx->querytimeout) : 0;
+       }
+
+
        TRC_DEBUG_IF(ALGO) t0 = GDKusec();
 
        assert(tp == TYPE_dbl && BATcount(b1) == BATcount(b2) && b1->ttype == 
b2->ttype && BATtdense(b1) == BATtdense(b2));
@@ -4943,6 +4962,8 @@ BATgroupcovariance_population(BAT *b1, B
                const TYPE *vals1 = (const TYPE *) Tloc(b1, 0);         \
                const TYPE *vals2 = (const TYPE *) Tloc(b2, 0);         \
                while (ncand > 0) {                                     \
+                       GDK_CHECK_TIMEOUT(timeoffset, counter,\
+                                       
GOTO_LABEL_TIMEOUT_HANDLER(alloc_fail));\
                        ncand--;                                        \
                        i = canditer_next(&ci) - b1->hseqbase;          \
                        if (gids == NULL ||                             \
@@ -4993,6 +5014,13 @@ BATgroupcorrelation(BAT *b1, BAT *b2, BA
        const char *err;
        lng t0 = 0;
 
+       size_t counter = 0;
+       lng timeoffset = 0;
+       QryCtx *qry_ctx = MT_thread_get_qry_ctx();
+       if (qry_ctx != NULL) {
+               timeoffset = (qry_ctx->starttime && qry_ctx->querytimeout) ? 
(qry_ctx->starttime + qry_ctx->querytimeout) : 0;
+       }
+
        TRC_DEBUG_IF(ALGO) t0 = GDKusec();
 
        assert(tp == TYPE_dbl && BATcount(b1) == BATcount(b2) && b1->ttype == 
b2->ttype && BATtdense(b1) == BATtdense(b2));
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to