Changeset: 6bd20d4a4e86 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6bd20d4a4e86
Modified Files:
        sql/common/sql_types.c
Branch: default
Log Message:

merged


diffs (truncated from 1153 to 300 lines):

diff --git a/gdk/gdk_aggr.c b/gdk/gdk_aggr.c
--- a/gdk/gdk_aggr.c
+++ b/gdk/gdk_aggr.c
@@ -446,7 +446,7 @@ dofsum(const void *restrict values, oid 
                if (ngrp == 1 && ci->tpe == cand_dense) {               \
                        /* single group, no candidate list */           \
                        TYPE2 sum;                                      \
-                       *algo = "no candidates, no groups";             \
+                       *algo = "sum: no candidates, no groups";        \
                        sum = 0;                                        \
                        if (nonil) {                                    \
                                *seen = ncand > 0;                      \
@@ -482,7 +482,7 @@ dofsum(const void *restrict values, oid 
                        /* single group, with candidate list */         \
                        TYPE2 sum;                                      \
                        bool seenval = false;                           \
-                       *algo = "with candidates, no groups";           \
+                       *algo = "sum: with candidates, no groups";      \
                        sum = 0;                                        \
                        for (i = 0; i < ncand && nils == 0; i++) {      \
                                x = vals[canditer_next(ci) - seqb];     \
@@ -503,7 +503,7 @@ dofsum(const void *restrict values, oid 
                                *sums = sum;                            \
                } else if (ci->tpe == cand_dense) {                     \
                        /* multiple groups, no candidate list */        \
-                       *algo = "no candidates, with groups";           \
+                       *algo = "sum: no candidates, with groups";      \
                        for (i = 0; i < ncand; i++) {                   \
                                if (gids == NULL ||                     \
                                    (gids[i] >= min && gids[i] <= max)) { \
@@ -534,7 +534,7 @@ dofsum(const void *restrict values, oid 
                        }                                               \
                } else {                                                \
                        /* multiple groups, with candidate list */      \
-                       *algo = "with candidates, with groups";         \
+                       *algo = "sum: with candidates, with groups";    \
                        while (ncand > 0) {                             \
                                ncand--;                                \
                                i = canditer_next(ci) - seqb;           \
@@ -577,14 +577,14 @@ dofsum(const void *restrict values, oid 
                        TYPE2 sum;                                      \
                        sum = 0;                                        \
                        if (nonil) {                                    \
-                               *algo = "no candidates, no groups, no nils, no 
overflow"; \
+                               *algo = "sum: no candidates, no groups, no 
nils, no overflow"; \
                                *seen = ncand > 0;                      \
                                for (i = 0; i < ncand && nils == 0; i++) { \
                                        sum += vals[ci->seq + i - seqb]; \
                                }                                       \
                        } else {                                        \
                                bool seenval = false;                   \
-                               *algo = "no candidates, no groups, no 
overflow"; \
+                               *algo = "sum: no candidates, no groups, no 
overflow"; \
                                for (i = 0; i < ncand && nils == 0; i++) { \
                                        x = vals[ci->seq + i - seqb];   \
                                        if (is_##TYPE1##_nil(x)) {      \
@@ -605,7 +605,7 @@ dofsum(const void *restrict values, oid 
                        /* single group, with candidate list */         \
                        TYPE2 sum;                                      \
                        bool seenval = false;                           \
-                       *algo = "with candidates, no groups, no overflow"; \
+                       *algo = "sum: with candidates, no groups, no overflow"; 
\
                        sum = 0;                                        \
                        for (i = 0; i < ncand && nils == 0; i++) {      \
                                x = vals[canditer_next(ci) - seqb];     \
@@ -624,7 +624,7 @@ dofsum(const void *restrict values, oid 
                } else if (ci->tpe == cand_dense) {                     \
                        /* multiple groups, no candidate list */        \
                        if (nonil) {                                    \
-                               *algo = "no candidates, with groups, no nils, 
no overflow"; \
+                               *algo = "sum: no candidates, with groups, no 
nils, no overflow"; \
                                for (i = 0; i < ncand; i++) {           \
                                        if (gids == NULL ||             \
                                            (gids[i] >= min && gids[i] <= max)) 
{ \
@@ -639,7 +639,7 @@ dofsum(const void *restrict values, oid 
                                        }                               \
                                }                                       \
                        } else {                                        \
-                               *algo = "no candidates, with groups, no 
overflow"; \
+                               *algo = "sum: no candidates, with groups, no 
overflow"; \
                                for (i = 0; i < ncand; i++) {           \
                                        if (gids == NULL ||             \
                                            (gids[i] >= min && gids[i] <= max)) 
{ \
@@ -665,7 +665,7 @@ dofsum(const void *restrict values, oid 
                        }                                               \
                } else {                                                \
                        /* multiple groups, with candidate list */      \
-                       *algo = "with candidates, with groups, no overflow"; \
+                       *algo = "sum: with candidates, with groups, no 
overflow"; \
                        while (ncand > 0) {                             \
                                ncand--;                                \
                                i = canditer_next(ci) - seqb;           \
@@ -714,7 +714,7 @@ dosum(const void *restrict values, bool 
        case TYPE_dbl:
                if (tp1 != TYPE_flt && tp1 != TYPE_dbl)
                        goto unsupported;
-               *algo = "floating sum";
+               *algo = "sum: floating point";
                return dofsum(values, seqb, ci, ncand, results, ngrp, tp1, tp2,
                              gids, min, max, skip_nils, abort_on_error,
                              nil_if_empty);
@@ -944,6 +944,8 @@ BATgroupsum(BAT *b, BAT *g, BAT *e, BAT 
                bn = NULL;
        }
 
+       if (algo)
+               MT_thread_setalgorithm(algo);
        TRC_DEBUG(ALGO, "b=" ALGOBATFMT ",g=" ALGOOPTBATFMT ","
                  "e=" ALGOOPTBATFMT ",s=" ALGOOPTBATFMT " -> " ALGOOPTBATFMT
                  "; start " OIDFMT ", count " BUNFMT " (%s -- " LLFMT " 
usec)\n",
@@ -1067,6 +1069,8 @@ BATsum(void *res, int tp, BAT *b, BAT *s
        nils = dosum(Tloc(b, 0), b->tnonil, b->hseqbase, &ci, ncand,
                     res, true, b->ttype, tp, &min, min, max,
                     skip_nils, abort_on_error, nil_if_empty, __func__, &algo);
+       if (algo)
+               MT_thread_setalgorithm(algo);
        TRC_DEBUG(ALGO, "b=" ALGOBATFMT ",s=" ALGOOPTBATFMT "; "
                  "start " OIDFMT ", count " BUNFMT " (%s -- " LLFMT " usec)\n",
                  ALGOBATPAR(b), ALGOOPTBATPAR(s),
diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c
--- a/gdk/gdk_bat.c
+++ b/gdk/gdk_bat.c
@@ -750,7 +750,7 @@ COLcopy(BAT *b, int tt, bool writable, r
 
                        /* make sure we use the correct capacity */
                        bn->batCapacity = (BUN) (bn->ttype ? bn->theap.size >> 
bn->tshift : 0);
-               } else if (BATatoms[tt].atomFix || tt != TYPE_void || 
ATOMextern(tt)) {
+               } else if (BATatoms[tt].atomFix || ATOMextern(tt)) {
                        /* case (4): one-by-one BUN insert (really slow) */
                        BUN p, q, r = 0;
                        BATiter bi = bat_iterator(b);
diff --git a/gdk/gdk_firstn.c b/gdk/gdk_firstn.c
--- a/gdk/gdk_firstn.c
+++ b/gdk/gdk_firstn.c
@@ -219,6 +219,7 @@ BATfirstn_unique(BAT *b, BAT *s, BUN n, 
        oid item;
        BUN pos, childpos;
 
+       MT_thread_setalgorithm(__func__);
        cnt = canditer_init(&ci, b, s);
 
        if (n >= cnt) {
@@ -721,6 +722,7 @@ BATfirstn_unique_with_groups(BAT *b, BAT
        oid item;
        BUN pos, childpos;
 
+       MT_thread_setalgorithm(__func__);
        cnt = canditer_init(&ci, b, s);
 
        if (n > cnt)
@@ -1016,6 +1018,7 @@ BATfirstn_grouped(BAT **topn, BAT **gids
        oid last;
        gdk_return rc;
 
+       MT_thread_setalgorithm(__func__);
        if (distinct && !b->tkey) {
                su = s;
                s = BATunique(b, s);
@@ -1115,6 +1118,7 @@ BATfirstn_grouped_with_groups(BAT **topn
        oid last, lastg;
        gdk_return rc;
 
+       MT_thread_setalgorithm(__func__);
        if (distinct) {
                BAT *bn1, *bn2, *bn3, *bn4, *bn5, *bn6, *bn7, *bn8;
                if (BATgroup(&bn1, &bn2, NULL, b, s, g, NULL, NULL) != 
GDK_SUCCEED)
diff --git a/gdk/gdk_group.c b/gdk/gdk_group.c
--- a/gdk/gdk_group.c
+++ b/gdk/gdk_group.c
@@ -100,6 +100,7 @@
                INIT_0;                                                 \
                if (ci.tpe == cand_dense) {                             \
                        if (grps) {                                     \
+                               
MT_thread_setalgorithm("GRP_compare_consecutive_values, dense, groups"); \
                                for (r = 0; r < cnt; r++) {             \
                                        p = canditer_next_dense(&ci) - hseqb; \
                                        INIT_1;                         \
@@ -114,6 +115,7 @@
                                        prev = grps[r];                 \
                                }                                       \
                        } else {                                        \
+                               
MT_thread_setalgorithm("GRP_compare_consecutive_values, dense, !groups"); \
                                for (r = 0; r < cnt; r++) {             \
                                        p = canditer_next_dense(&ci) - hseqb; \
                                        INIT_1;                         \
@@ -129,6 +131,7 @@
                        }                                               \
                } else {                                                \
                        if (grps) {                                     \
+                               
MT_thread_setalgorithm("GRP_compare_consecutive_values, !dense, groups"); \
                                for (r = 0; r < cnt; r++) {             \
                                        p = canditer_next(&ci) - hseqb; \
                                        INIT_1;                         \
@@ -143,6 +146,7 @@
                                        prev = grps[r];                 \
                                }                                       \
                        } else {                                        \
+                               
MT_thread_setalgorithm("GRP_compare_consecutive_values, !dense, !groups"); \
                                for (r = 0; r < cnt; r++) {             \
                                        p = canditer_next(&ci) - hseqb; \
                                        INIT_1;                         \
@@ -191,6 +195,7 @@
                pgrp[grps[0]] = 0;                                      \
                j = 0;                                                  \
                if (ci.tpe == cand_dense) {                             \
+                       MT_thread_setalgorithm("GRP_subscan_old_groups, 
dense"); \
                        for (r = 0; r < cnt; r++) {                     \
                                p = canditer_next_dense(&ci) - hseqb;   \
                                INIT_1;                                 \
@@ -230,6 +235,7 @@
                                GRPnotfound();                          \
                        }                                               \
                } else {                                                \
+                       MT_thread_setalgorithm("GRP_subscan_old_groups, 
!dense"); \
                        for (r = 0; r < cnt; r++) {                     \
                                p = canditer_next(&ci) - hseqb;         \
                                INIT_1;                                 \
@@ -316,6 +322,7 @@
                INIT_0;                                                 \
                assert(grps == NULL);                                   \
                if (ci.tpe == cand_dense) {                             \
+                       MT_thread_setalgorithm("GRP_use_existing_hash_table, 
dense"); \
                        for (r = 0; r < cnt; r++) {                     \
                                oid o = canditer_next_dense(&ci);       \
                                p = o - hseqb + lo;                     \
@@ -349,6 +356,7 @@
                                }                                       \
                        }                                               \
                } else {                                                \
+                       MT_thread_setalgorithm("GRP_use_existing_hash_table, 
!dense"); \
                        for (r = 0; r < cnt; r++) {                     \
                                oid o = canditer_next(&ci);             \
                                p = o - hseqb + lo;                     \
@@ -460,6 +468,7 @@ pop(oid x)
 #define GRP_create_partial_hash_table_core(INIT_1,HASH,EQUAL,ASSERT,GRPTST) \
        do {                                                            \
                if (ci.tpe == cand_dense) {                             \
+                       MT_thread_setalgorithm("GRP_create_partial_hash_table, 
dense"); \
                        for (r = 0; r < cnt; r++) {                     \
                                p = canditer_next_dense(&ci) - hseqb;   \
                                INIT_1;                                 \
@@ -491,6 +500,7 @@ pop(oid x)
                                }                                       \
                        }                                               \
                } else {                                                \
+                       MT_thread_setalgorithm("GRP_create_partial_hash_table, 
!dense"); \
                        for (r = 0; r < cnt; r++) {                     \
                                p = canditer_next(&ci) - hseqb;         \
                                INIT_1;                                 \
diff --git a/gdk/gdk_hash.c b/gdk/gdk_hash.c
--- a/gdk/gdk_hash.c
+++ b/gdk/gdk_hash.c
@@ -723,6 +723,7 @@ BAThash_impl(BAT *restrict b, struct can
 
        assert(strcmp(ext, "thash") != 0 || !hascand);
 
+       MT_thread_setalgorithm(hascand ? "create hash with candidates" : 
"create hash");
        TRC_DEBUG_IF(ACCELERATOR) t0 = GDKusec();
        TRC_DEBUG(ACCELERATOR,
                  ALGOBATFMT ": create hash;\n", ALGOBATPAR(b));
diff --git a/gdk/gdk_imprints.c b/gdk/gdk_imprints.c
--- a/gdk/gdk_imprints.c
+++ b/gdk/gdk_imprints.c
@@ -381,6 +381,7 @@ BATimprints(BAT *b)
                size_t pages;
 
                MT_lock_unset(&b->batIdxLock);
+               MT_thread_setalgorithm("create imprints");
 
                if (s2)
                        TRC_DEBUG(ACCELERATOR, "BATimprints(b=" ALGOBATFMT
diff --git a/gdk/gdk_join.c b/gdk/gdk_join.c
--- a/gdk/gdk_join.c
+++ b/gdk/gdk_join.c
@@ -258,6 +258,7 @@ nomatch(BAT **r1p, BAT **r2p, BAT *l, BA
 {
        BAT *r1, *r2 = NULL;
 
+       MT_thread_setalgorithm(__func__);
        if (lci->ncand == 0 || !(nil_on_miss | only_misses)) {
                /* return empty BATs */
                if ((r1 = BATdense(0, 0, 0)) == NULL)
@@ -307,6 +308,7 @@ selectjoin(BAT **r1p, BAT **r2p, BAT *l,
        assert(lci->ncand > 0);
        assert(lci->ncand == 1 || (l->tsorted && l->trevsorted));
 
+       MT_thread_setalgorithm(__func__);
        oid o = canditer_next(lci);
        v = BUNtail(li, o - l->hseqbase);
 
@@ -446,6 +448,7 @@ mergejoin_void(BAT **r1p, BAT **r2p, BAT
        assert(rci->tpe == cand_dense);
        assert(BATcount(r) > 0);
 
+       MT_thread_setalgorithm(__func__);
        /* figure out range [lo..hi) of values in r that we need to match */
        lo = r->tseqbase;
        hi = lo + BATcount(r);
@@ -777,6 +780,7 @@ mergejoin_int(BAT **r1p, BAT **r2p, BAT 
        assert(ATOMtype(l->ttype) == ATOMtype(r->ttype));
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to