Changeset: 4331678b956e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/4331678b956e
Modified Files:
        gdk/gdk_calc.c
Branch: qcancel
Log Message:

timeout gdk calc multiplication


diffs (153 lines):

diff --git a/gdk/gdk_calc.c b/gdk/gdk_calc.c
--- a/gdk/gdk_calc.c
+++ b/gdk/gdk_calc.c
@@ -6342,9 +6342,16 @@ mul_##TYPE1##_##TYPE2##_##TYPE3(const TY
 {                                                                      \
        BUN nils = 0;                                                   \
        BUN i = 0, j = 0, ncand = ci1->ncand;                           \
+       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; \
+       }                                                               \
                                                                        \
        if (ci1->tpe == cand_dense && ci2->tpe == cand_dense) {         \
                for (BUN k = 0; k < ncand; k++) {                       \
+                       GDK_CHECK_TIMEOUT(timeoffset, counter, 
TIMEOUT_HANDLER(BUN_NONE)); \
                        if (incr1)                                      \
                                i = canditer_next_dense(ci1) - candoff1; \
                        if (incr2)                                      \
@@ -6362,6 +6369,7 @@ mul_##TYPE1##_##TYPE2##_##TYPE3(const TY
                }                                                       \
        } else {                                                        \
                for (BUN k = 0; k < ncand; k++) {                       \
+                       GDK_CHECK_TIMEOUT(timeoffset, counter, 
TIMEOUT_HANDLER(BUN_NONE)); \
                        if (incr1)                                      \
                                i = canditer_next(ci1) - candoff1;      \
                        if (incr2)                                      \
@@ -6394,9 +6402,16 @@ mul_##TYPE1##_##TYPE2##_##TYPE3(const TY
        BUN nils = 0;                                                   \
        BUN i = 0, j = 0, ncand = ci1->ncand;                           \
        const bool couldoverflow = (max < (TYPE3) GDK_##TYPE1##_max * (TYPE3) 
GDK_##TYPE2##_max); \
+       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; \
+       }                                                               \
                                                                        \
        if (ci1->tpe == cand_dense && ci2->tpe == cand_dense) {         \
                for (BUN k = 0; k < ncand; k++) {                       \
+                       GDK_CHECK_TIMEOUT(timeoffset, counter, 
TIMEOUT_HANDLER(BUN_NONE)); \
                        if (incr1)                                      \
                                i = canditer_next_dense(ci1) - candoff1; \
                        if (incr2)                                      \
@@ -6416,6 +6431,7 @@ mul_##TYPE1##_##TYPE2##_##TYPE3(const TY
                }                                                       \
        } else {                                                        \
                for (BUN k = 0; k < ncand; k++) {                       \
+                       GDK_CHECK_TIMEOUT(timeoffset, counter, 
TIMEOUT_HANDLER(BUN_NONE)); \
                        if (incr1)                                      \
                                i = canditer_next(ci1) - candoff1;      \
                        if (incr2)                                      \
@@ -6453,9 +6469,16 @@ mul_##TYPE1##_##TYPE2##_hge(const TYPE1 
 {                                                                      \
        BUN nils = 0;                                                   \
        BUN i = 0, j = 0, ncand = ci1->ncand;                           \
+       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; \
+       }                                                               \
                                                                        \
        if (ci1->tpe == cand_dense && ci2->tpe == cand_dense) {         \
                for (BUN k = 0; k < ncand; k++) {                       \
+                       GDK_CHECK_TIMEOUT(timeoffset, counter, 
TIMEOUT_HANDLER(BUN_NONE)); \
                        if (incr1)                                      \
                                i = canditer_next_dense(ci1) - candoff1; \
                        if (incr2)                                      \
@@ -6472,6 +6495,7 @@ mul_##TYPE1##_##TYPE2##_hge(const TYPE1 
                }                                                       \
        } else {                                                        \
                for (BUN k = 0; k < ncand; k++) {                       \
+                       GDK_CHECK_TIMEOUT(timeoffset, counter, 
TIMEOUT_HANDLER(BUN_NONE)); \
                        if (incr1)                                      \
                                i = canditer_next(ci1) - candoff1;      \
                        if (incr2)                                      \
@@ -6504,9 +6528,16 @@ mul_##TYPE1##_##TYPE2##_lng(const TYPE1 
 {                                                                      \
        BUN nils = 0;                                                   \
        BUN i = 0, j = 0, ncand = ci1->ncand;                           \
+       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; \
+       }                                                               \
                                                                        \
        if (ci1->tpe == cand_dense && ci2->tpe == cand_dense) {         \
                for (BUN k = 0; k < ncand; k++) {                       \
+                       GDK_CHECK_TIMEOUT(timeoffset, counter, 
TIMEOUT_HANDLER(BUN_NONE)); \
                        if (incr1)                                      \
                                i = canditer_next_dense(ci1) - candoff1; \
                        if (incr2)                                      \
@@ -6523,6 +6554,7 @@ mul_##TYPE1##_##TYPE2##_lng(const TYPE1 
                }                                                       \
        } else {                                                        \
                for (BUN k = 0; k < ncand; k++) {                       \
+                       GDK_CHECK_TIMEOUT(timeoffset, counter, 
TIMEOUT_HANDLER(BUN_NONE)); \
                        if (incr1)                                      \
                                i = canditer_next(ci1) - candoff1;      \
                        if (incr2)                                      \
@@ -6555,9 +6587,16 @@ mul_##TYPE1##_##TYPE2##_##TYPE3(const TY
 {                                                                      \
        BUN nils = 0;                                                   \
        BUN i = 0, j = 0, ncand = ci1->ncand;                           \
+       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; \
+       }                                                               \
                                                                        \
        if (ci1->tpe == cand_dense && ci2->tpe == cand_dense) {         \
                for (BUN k = 0; k < ncand; k++) {                       \
+                       GDK_CHECK_TIMEOUT(timeoffset, counter, 
TIMEOUT_HANDLER(BUN_NONE)); \
                        if (incr1)                                      \
                                i = canditer_next_dense(ci1) - candoff1; \
                        if (incr2)                                      \
@@ -6578,6 +6617,7 @@ mul_##TYPE1##_##TYPE2##_##TYPE3(const TY
                }                                                       \
        } else {                                                        \
                for (BUN k = 0; k < ncand; k++) {                       \
+                       GDK_CHECK_TIMEOUT(timeoffset, counter, 
TIMEOUT_HANDLER(BUN_NONE)); \
                        if (incr1)                                      \
                                i = canditer_next(ci1) - candoff1;      \
                        if (incr2)                                      \
@@ -6624,9 +6664,16 @@ mul_##TYPE1##_##TYPE2##_##TYPE3(                         
        \
 {                                                                      \
        BUN nils = 0;                                                   \
        BUN i = 0, j = 0, ncand = ci1->ncand;                           \
+       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; \
+       }                                                               \
                                                                        \
        if (ci1->tpe == cand_dense && ci2->tpe == cand_dense) {         \
                for (BUN k = 0; k < ncand; k++) {                       \
+                       GDK_CHECK_TIMEOUT(timeoffset, counter, 
TIMEOUT_HANDLER(BUN_NONE)); \
                        if (incr1)                                      \
                                i = canditer_next_dense(ci1) - candoff1; \
                        if (incr2)                                      \
@@ -6648,6 +6695,7 @@ mul_##TYPE1##_##TYPE2##_##TYPE3(                          
        \
                }                                                       \
        } else {                                                        \
                for (BUN k = 0; k < ncand; k++) {                       \
+                       GDK_CHECK_TIMEOUT(timeoffset, counter, 
TIMEOUT_HANDLER(BUN_NONE)); \
                        if (incr1)                                      \
                                i = canditer_next(ci1) - candoff1;      \
                        if (incr2)                                      \
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to