[prev in list] [next in list] [prev in thread] [next in thread] 

List:       monetdb-checkins
Subject:    MonetDB: default - Report underlying implementation for selected...
From:       Sjoerd_Mullender <commits+sjoerd=acm.org () monetdb ! org>
Date:       2020-07-31 14:18:28
Message-ID: hg.eacc7398a94d.1596205108.13913863289317197 () monetdb-vm0 ! spin-off ! cwi ! nl
[Download RAW message or body]

Changeset: eacc7398a94d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=eacc7398a94d
Modified Files:
	gdk/gdk_aggr.c
	gdk/gdk_firstn.c
	gdk/gdk_group.c
	gdk/gdk_hash.c
	gdk/gdk_imprints.c
	gdk/gdk_join.c
	gdk/gdk_orderidx.c
	gdk/gdk_project.c
	gdk/gdk_select.c
	gdk/gdk_system.c
	gdk/gdk_system.h
	gdk/gdk_unique.c
	monetdb5/mal/mal_interpreter.c
	monetdb5/mal/mal_listing.c
Branch: default
Log Message:

Report underlying implementation for selected operations in TRACE output.


diffs (truncated from 753 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_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));
 	assert(r->tsorted || r->trevsorted);
 
+	MT_thread_setalgorithm(__func__);
 	lstart = rstart = 0;
 	lend = BATcount(l);
 	lcnt = lend - lstart;
@@ -1075,6 +1079,7 @@ mergejoin_lng(BAT **r1p, BAT **r2p, BAT 
 	assert(ATOMtype(l->ttype) == ATOMtype(r->ttype));
 	assert(r->tsorted || r->trevsorted);
 
+	MT_thread_setalgorithm(__func__);
 	lstart = rstart = 0;
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic