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

timeout rest of stdev funcs


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
@@ -4257,6 +4257,8 @@ BATgroupquantile_avg(BAT *b, BAT *g, BAT
        do {                                            \
                TYPE x;                                 \
                for (i = 0; i < cnt; i++) {             \
+                       GDK_CHECK_TIMEOUT(timeoffset, counter,\
+                                       TIMEOUT_HANDLER(dbl_nil));\
                        x = ((const TYPE *) values)[i]; \
                        if (is_##TYPE##_nil(x))         \
                                continue;               \
@@ -4277,6 +4279,13 @@ calcvariance(dbl *restrict avgp, const v
        dbl m2 = 0;
        dbl delta;
 
+       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;
+       }
+
        switch (tp) {
        case TYPE_bte:
                AGGR_STDEV_SINGLE(bte);
@@ -4374,6 +4383,8 @@ BATcalcvariance_sample(dbl *avgp, BAT *b
        do {                                                            \
                TYPE x, y;                                              \
                for (i = 0; i < cnt; i++) {                             \
+                       GDK_CHECK_TIMEOUT(timeoffset, counter,\
+                                       TIMEOUT_HANDLER(dbl_nil));\
                        x = ((const TYPE *) v1)[i];                     \
                        y = ((const TYPE *) v2)[i];                     \
                        if (is_##TYPE##_nil(x) || is_##TYPE##_nil(y))   \
@@ -4395,6 +4406,14 @@ calccovariance(const void *v1, const voi
        BUN n = 0, i;
        dbl mean1 = 0, mean2 = 0, m2 = 0, delta1, delta2;
 
+       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;
+       }
+
+
        switch (tp) {
        case TYPE_bte:
                AGGR_COVARIANCE_SINGLE(bte);
@@ -4461,6 +4480,8 @@ BATcalccovariance_sample(BAT *b1, BAT *b
        do {                                                            \
                TYPE x, y;                                              \
                for (i = 0; i < cnt; i++) {                             \
+                       GDK_CHECK_TIMEOUT(timeoffset, counter,\
+                                       TIMEOUT_HANDLER(dbl_nil));\
                        x = ((const TYPE *) v1)[i];                     \
                        y = ((const TYPE *) v2)[i];                     \
                        if (is_##TYPE##_nil(x) || is_##TYPE##_nil(y))   \
@@ -4488,6 +4509,13 @@ BATcalccorrelation(BAT *b1, BAT *b2)
        int tp = b1->ttype;
        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();
 
        switch (tp) {
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to