Changeset: 60007735550e for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=60007735550e Modified Files: clients/mapiclient/tomograph.c gdk/gdk_logger.c Branch: resultset Log Message:
Merge with default branch. diffs (296 lines): diff --git a/clients/mapiclient/tomograph.c b/clients/mapiclient/tomograph.c --- a/clients/mapiclient/tomograph.c +++ b/clients/mapiclient/tomograph.c @@ -776,10 +776,11 @@ showmemory(void) static char * getHeatColor(double load) { - if ( load > 0.75 ) return "yellow"; + if ( load > 0.9 ) return "red"; + if ( load > 0.75 ) return "orangered"; if ( load > 0.5 ) return "orange"; - if ( load > 0.25 ) return "red"; - if ( load > 0.02 ) return "blue"; + if ( load > 0.25 ) return "gold"; + if ( load > 0.02 ) return "yellow"; return "white"; } @@ -796,7 +797,7 @@ showcpu(void) fprintf(gnudata, "set lmarg 10\n"); fprintf(gnudata, "set rmarg 10\n"); fprintf(gnudata, "set size 1,0.%02d\n", cpus?cpus:1); - fprintf(gnudata, "set origin 0.0, 0.%d\n", 89 - cpus); + fprintf(gnudata, "set origin 0.0, 0.%d\n", 88 - cpus); fprintf(gnudata, "set ylabel \"CPU\"\n"); fprintf(gnudata, "unset xtics\n"); fprintf(gnudata, "unset ytics\n"); @@ -949,18 +950,23 @@ fprintf_time(FILE *f, lng time) } /* produce a legenda image for the color map */ -#define COLUMNS 5 +#define COLUMNS 3 static void showcolormap(char *filename, int all) { FILE *f = 0; char buf[BUFSIZ]; - int i, k = 0; + int i, k = 0,nl; int w = 380; // 600 for 3 columns - int h = 590; + int h = 590, h1=h; lng totfreq = 0, tottime = 0; Color *clrs = colors, *_clrs_ = NULL; + char *c; + + // count size of query text + for (nl=0, c= currentquery; c && *c; c++) + nl += *c == '\n'; if (all) { snprintf(buf, BUFSIZ, "%s%s_%s_%02d.gpl", cachebuf, basefilename, dbname, atlaspage); @@ -989,7 +995,7 @@ showcolormap(char *filename, int all) fprintf(f, "set lmarg 10\n"); fprintf(f, "set rmarg 10\n"); fprintf(f, "set size 1,0.4\n"); - fprintf(f, "set origin 0.0,%s\n", "-0.05"); + fprintf(f, "set origin 0.0,%s\n", "-0.04"); fprintf(f, "set xrange [0:1800]\n"); fprintf(f, "set yrange [0:600]\n"); fprintf(f, "unset xtics\n"); @@ -1016,17 +1022,15 @@ showcolormap(char *filename, int all) tottime += clrs[i].timeused; totfreq += clrs[i].freq; - if (k % COLUMNS == 0) - h -= 45; + if (k % COLUMNS == 0 && i) + h -= 35; fprintf(f, "set object %d rectangle from %.2f, %.2f to %.2f, %.2f fillcolor rgb \"%s\" fillstyle solid 1.0\n", - object++, (double) (k % COLUMNS) * w, (double) h - 40, (double) ((k % COLUMNS) * w + 0.05 * w), (double) h - 5, clrs[i].col); + object++, (double) (k % COLUMNS) * w, (double) h - 40, (double) ((k % COLUMNS) * w + 0.09 * w), (double) h - 15, clrs[i].col); fprintf(f, "set label %d \"%s.%s \" at %d,%d\n", - object++, (clrs[i].mod?clrs[i].mod:""), clrs[i].fcn, (int) ((k % COLUMNS) * w + 0.07 * w), h - 15); - fprintf(f, "set label %d \"%d call%s: ", - object++, clrs[i].freq, clrs[i].freq>1?"s":""); + object++, (clrs[i].mod?clrs[i].mod:""), clrs[i].fcn, (int) ((k % COLUMNS) * w + 0.1 * w), h - 20); + fprintf(f, "set label %d \"%d call%s: ", object++, clrs[i].freq, clrs[i].freq>1?"s":""); fprintf_time(f, clrs[i].timeused); - fprintf(f, "\" at %f,%f\n", - (double) ((k % COLUMNS) * w + 0.07 * w), (double) h - 35); + fprintf(f, "\" at %f,%f\n", (double) ((k % COLUMNS) * w + 0.1 * w), (double) h - 35); k++; } else { clrs[0].timeused += clrs[i].timeused; @@ -1039,13 +1043,35 @@ showcolormap(char *filename, int all) _clrs_ = NULL; } - h -= 45; - fprintf(f, "set label %d \" "LLFMT" MAL instructions executed; total CPU core time: ", - object++, totfreq); + h -= 30; + fprintf(f, "set label %d \"MAL instructions executed: "LLFMT, object++, totfreq); + fprintf(f, "\" at 0,%d\n", h - 30); + + fprintf(f, "set label %d \"Total CPU core time: ", object++); fprintf_time(f, tottime); - fprintf(f, "; parallelism usage %.1f %%", totalclkticks / (totalticks / 100.0)); - fprintf(f, "\" at %d,%d\n", - (int) (0.2 * w), h - 35); + fprintf(f, "\" at 0,%d\n", h - 50); + + fprintf(f, "set label %d \"Parallelism used: %.1f %%", object++, totalclkticks / (totalticks / 100.0)); + fprintf(f, "\" at 0,%d\n", h - 70); + // show complete query text + if( currentquery ){ + h = h1-30; + //fprintf(gnudata, "set object %d rectangle from %d.0, 250.0 to %d.0,%d.0\n", object++, 3 * w, 5 *w , h -5); + fprintf(f, "set label %d \"", object++); + k=0; + for (c= currentquery; *c; c++){ + if (*c == '"') fprintf(gnudata,"\\"); else + if (*c == '\t') fprintf(gnudata," "); else + if (*c == '\n') { fprintf(gnudata,"\\n"); k=0; continue;} else + if( ++k >60 && (*c == ' ' || *c =='\t')){ + fprintf(gnudata,"\\n"); + k = 1; + } + fputc(*c,gnudata); + } + fprintf(f, "\" at %d,%d\n", (int) ( 3 * w ), h - 17); + h-= 17; + } fprintf(f, "plot 0 notitle with lines linecolor rgb \"white\"\n"); if (all) { fclose(f); @@ -1114,21 +1140,8 @@ gnuplotheader(char *filename) ch= *c; *c =0; fprintf(gnudata, "set title \"%s\t%s%s\"\n", date, title, *c? "...":""); *c =ch; - } else - if( currentquery ){ - fprintf(gnudata, "set title \"%s\t", date); - for (c= currentquery; *c && i <100; c++, i++) - if( *c =='"') - fprintf(gnudata,"\\\""); - else - if( *c != '\n' && *c != '\t') - fputc(*c,gnudata); - if(*c) - fprintf(gnudata, "..."); - fprintf(gnudata, "\"\n"); - } - else - fprintf(gnudata, "set title \"%s\tTomogram\"\n", date); + } else + fprintf(gnudata, "set title \"%s\tMonetDB %s tomogram\"\n", date, dbname); fprintf(gnudata, "set multiplot\n"); } @@ -1167,7 +1180,7 @@ createTomogram(void) fprintf(gnudata, "set lmarg 10\n"); fprintf(gnudata, "set rmarg 10\n"); fprintf(gnudata, "set size 1,0.48\n"); - fprintf(gnudata, "set origin 0.0,%s\n", "0.32"); + fprintf(gnudata, "set origin 0.0,%s\n", "0.33"); fprintf(gnudata, "set xrange ["LLFMT".0:"LLFMT".0]\n", startrange, lastclktick - starttime); /* detect all different threads and assign them a row */ diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c --- a/gdk/gdk_logger.c +++ b/gdk/gdk_logger.c @@ -108,7 +108,7 @@ log_find_int(BAT *b, BAT *d, int val) int *t = (int *) Tloc(b, BUNfirst(b)); for (p = 0, q = BATcount(b); p < q; p++) { - BUN pos = p + BUNfirst(b); + oid pos = p + BUNfirst(b); if (t[p] == val && BUNfnd(d, &pos) == BUN_NONE) return pos; @@ -123,7 +123,7 @@ log_find_bid(BAT *b, BAT *d, log_bid val log_bid *t = (log_bid *) Tloc(b, BUNfirst(b)); for (p = 0, q = BATcount(b); p < q; p++) { - BUN pos = p + BUNfirst(b); + oid pos = p + BUNfirst(b); if (t[p] == val && BUNfnd(d, &pos) == BUN_NONE) return pos; @@ -282,9 +282,14 @@ log_read_seq(logger *lg, logformat *l) return LOG_ERR; } - if ((p = log_find_int(lg->seqs_id, lg->dseqs, seq)) != BUN_NONE) { - BUNinplace(lg->seqs_val, p, &seq, &val, FALSE); + if ((p = log_find_int(lg->seqs_id, lg->dseqs, seq)) != BUN_NONE && + p >= lg->seqs_id->batInserted) { + BUNinplace(lg->seqs_val, p, NULL, &val, FALSE); } else { + if (p != BUN_NONE) { + oid pos = p; + BUNappend(lg->dseqs, &pos, FALSE); + } BUNappend(lg->seqs_id, &seq, FALSE); BUNappend(lg->seqs_val, &val, FALSE); } @@ -648,8 +653,6 @@ la_bat_use(logger *lg, logaction *la) return; } logger_add_bat(lg, b, la->name); - if ((p = log_find_bid(lg->snapshots_bid, lg->dsnapshots, b->batCacheid)) != BUN_NONE) - BUNinplace(lg->snapshots_tid, p, &b->batCacheid, &lg->tid, FALSE); #ifndef NDEBUG assert(b->batRole == PERSISTENT); assert(0 <= b->H->heap.farmid && b->H->heap.farmid < MAXFARMS); @@ -665,8 +668,16 @@ la_bat_use(logger *lg, logaction *la) assert(BBPfarms[b->T->vheap->farmid].roles & (1 << PERSISTENT)); } #endif - /* move to the dirty new part of the snapshots list, new snapshots will get flushed to disk */ - if (p == BUN_NONE) { + if ((p = log_find_bid(lg->snapshots_bid, lg->dsnapshots, b->batCacheid)) != BUN_NONE && + p >= lg->snapshots_bid->batInserted) { + BUNinplace(lg->snapshots_tid, p, NULL, &lg->tid, FALSE); + } else { + if (p != BUN_NONE) { + oid pos = p; + BUNappend(lg->dsnapshots, &pos, FALSE); + } + /* move to the dirty new part of the snapshots list, + * new snapshots will get flushed to disk */ BUNappend(lg->snapshots_bid, &b->batCacheid, FALSE); BUNappend(lg->snapshots_tid, &lg->tid, FALSE); } @@ -1004,7 +1015,14 @@ logger_commit(logger *lg) fprintf(stderr, "#logger_commit\n"); p = log_find_int(lg->seqs_id, lg->dseqs, id); - BUNinplace(lg->seqs_val, p, &id, &lg->id, FALSE); + if (p >= lg->seqs_val->batInserted) { + BUNinplace(lg->seqs_val, p, NULL, &lg->id, FALSE); + } else { + oid pos = p; + BUNappend(lg->dseqs, &pos, FALSE); + BUNappend(lg->seqs_id, &id, FALSE); + BUNappend(lg->seqs_val, &lg->id, FALSE); + } /* cleanup old snapshots */ if (BATcount(lg->snapshots_bid)) { @@ -1757,9 +1775,14 @@ log_bat_persists(logger *lg, BAT *b, con assert(b->T->heap.farmid == 0); assert(b->T->vheap == NULL || BBPfarms[b->T->vheap->farmid].roles & (1 << PERSISTENT)); - if ((p = log_find_bid(lg->snapshots_bid, lg->dsnapshots, b->batCacheid)) != BUN_NONE){ - BUNinplace(lg->snapshots_tid, p, &b->batCacheid, &lg->tid, FALSE); + if ((p = log_find_bid(lg->snapshots_bid, lg->dsnapshots, b->batCacheid)) != BUN_NONE && + p >= lg->snapshots_tid->batInserted) { + BUNinplace(lg->snapshots_tid, p, NULL, &lg->tid, FALSE); } else { + if (p != BUN_NONE) { + oid pos = p; + BUNappend(lg->dsnapshots, &pos, FALSE); + } BUNappend(lg->snapshots_bid, &b->batCacheid, FALSE); BUNappend(lg->snapshots_tid, &lg->tid, FALSE); } @@ -1819,8 +1842,15 @@ log_bat_transient(logger *lg, const char assert(BBPfarms[BBP_desc(bid)->T.vheap->farmid].roles & (1 << PERSISTENT)); } #endif - // if (lg->tid == tid) - BUNinplace(lg->snapshots_tid, p, &bid, &lg->tid, FALSE); + // if (lg->tid == tid) + if (p >= lg->snapshots_tid->batInserted) { + BUNinplace(lg->snapshots_tid, p, NULL, &lg->tid, FALSE); + } else { + oid pos = p; + BUNappend(lg->dsnapshots, &pos, FALSE); + BUNappend(lg->snapshots_tid, &lg->tid, FALSE); + BUNappend(lg->snapshots_bid, &bid, FALSE); + } // else // printf("%d != %d\n", lg->tid, tid); // assert(lg->tid == tid); @@ -2175,9 +2205,14 @@ log_sequence(logger *lg, int seq, lng va if (lg->debug & 1) fprintf(stderr, "#log_sequence (%d," LLFMT ")\n", seq, val); - if ((p = log_find_int(lg->seqs_id, lg->dseqs, seq)) != BUN_NONE) { - BUNinplace(lg->seqs_val, p, &seq, &val, FALSE); + if ((p = log_find_int(lg->seqs_id, lg->dseqs, seq)) != BUN_NONE && + p >= lg->seqs_id->batInserted) { + BUNinplace(lg->seqs_val, p, NULL, &val, FALSE); } else { + if (p != BUN_NONE) { + oid pos = p; + BUNappend(lg->dseqs, &pos, FALSE); + } BUNappend(lg->seqs_id, &seq, FALSE); BUNappend(lg->seqs_val, &val, FALSE); } _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list