Changeset: 446c38816298 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/446c38816298
Modified Files:
        gdk/gdk_batop.c
        gdk/gdk_heap.c
Branch: default
Log Message:

Record insert_string_bat choices.


diffs (79 lines):

diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -27,6 +27,7 @@ unshare_varsized_heap(BAT *b)
                Heap *h = GDKzalloc(sizeof(Heap));
                if (h == NULL)
                        return GDK_FAIL;
+               MT_thread_setalgorithm("unshare vheap");
                h->parentid = b->batCacheid;
                h->farmid = BBPselectfarm(b->batRole, TYPE_str, varheap);
                strconcat_len(h->filename, sizeof(h->filename),
@@ -111,6 +112,7 @@ insert_string_bat(BAT *b, BAT *n, struct
                                /* make sure locking happens in a
                                 * predictable order: lowest id
                                 * first */
+                               MT_thread_setalgorithm("share vheap, copy 
heap");
                                if (b->batCacheid < n->batCacheid) {
                                        MT_lock_set(&b->theaplock);
                                        MT_lock_set(&n->theaplock);
@@ -136,6 +138,7 @@ insert_string_bat(BAT *b, BAT *n, struct
                                        (var_t) 1 << 17;
                        } else if (b->tvheap->parentid == n->tvheap->parentid &&
                                   ci->tpe == cand_dense) {
+                               MT_thread_setalgorithm("copy heap");
                                toff = 0;
                        } else if (b->tvheap->parentid != bid &&
                                   unshare_varsized_heap(b) != GDK_SUCCEED) {
@@ -148,6 +151,7 @@ insert_string_bat(BAT *b, BAT *n, struct
                                n->twidth != 4 ? (var_t) 1 << 33 :
 #endif
                                (var_t) 1 << 17;
+                       MT_thread_setalgorithm("copy vheap, copy heap");
                        if (b->tvheap->size < n->tvheap->free) {
                                Heap *h = HEAPgrow(b->tvheap, n->tvheap->free);
                                if (h == NULL)
@@ -207,6 +211,7 @@ insert_string_bat(BAT *b, BAT *n, struct
                                HEAPdecref(b->tvheap, false);
                                b->tvheap = h;
                                MT_lock_unset(&b->theaplock);
+                               MT_thread_setalgorithm("append vheap");
                                memcpy(b->tvheap->base + toff, n->tvheap->base, 
n->tvheap->free);
                                b->tvheap->free = toff + n->tvheap->free;
                                if (toff > 0) {
@@ -276,6 +281,7 @@ insert_string_bat(BAT *b, BAT *n, struct
                        assert(0);
                }
                b->tvarsized = false;
+               MT_thread_setalgorithm("copy offset values");
                while (cnt > 0) {
                        cnt--;
                        p = canditer_next(ci) - n->hseqbase;
@@ -333,6 +339,7 @@ insert_string_bat(BAT *b, BAT *n, struct
                 * to use the double elimination mechanism */
                r = BUNlast(b);
                oid hseq = n->hseqbase;
+               MT_thread_setalgorithm("insert string values");
                while (cnt > 0) {
                        cnt--;
                        p = canditer_next(ci) - hseq;
@@ -349,6 +356,7 @@ insert_string_bat(BAT *b, BAT *n, struct
                 * n's).  If this is the case, we just copy the
                 * offset, otherwise we insert normally.  */
                r = BUNlast(b);
+               MT_thread_setalgorithm("insert string values with check");
                while (cnt > 0) {
                        cnt--;
                        p = canditer_next(ci) - n->hseqbase;
diff --git a/gdk/gdk_heap.c b/gdk/gdk_heap.c
--- a/gdk/gdk_heap.c
+++ b/gdk/gdk_heap.c
@@ -436,6 +436,8 @@ GDKupgradevarheap(BAT *b, var_t v, BUN c
                /* nothing to do */
                return GDK_SUCCEED;
        }
+       if (width > b->twidth)
+               MT_thread_setalgorithm("widen offset heap");
 
        /* if copyall is set, we need to convert the whole heap, since
         * we may be in the middle of an insert loop that adjusts the
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to