On Tue, Apr 13, 2010 at 12:43:06PM +0000, Sjoerd Mullender wrote:
Update of /cvsroot/monetdb/clients/src/mapiclient In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv15694
Modified Files: MapiClient.mx Log Message: Once again print timer information to stderr. If you want to combine timer information with the regular output, you can do mclient -t ... 2>&1 This works since the standard output is flushed before the timer information is printed. And if you only want timer information, you can do mclient -t ... >/dev/null
I briefly tried to do the same for break-down timings given by pathfinder
(MonetDB/XQuery), but the changes (see diff below) don't help, mainly since
the break-down timings are printed in MIL, and even fprintf(stderr(), ...)
in MIL goes to stdout due to
MonetDB/src/gdk/gdk.mx:2737:#define GDKerr GDKout
which is probably required because MAPI only used one stream.
I'm not sure whether it's worth to persue this fruther, e.g., by making
mclient aware of the pathfinder/XQuery break-down timings and have re-direct
them to (its) stderr ...
Stefan
========
Index: pathfinder/compiler/include/mil.h
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/include/mil.h,v
retrieving revision 1.89
diff -u -r1.89 mil.h
--- pathfinder/compiler/include/mil.h 7 Jan 2010 15:24:27 -0000 1.89
+++ pathfinder/compiler/include/mil.h 14 Apr 2010 10:33:26 -0000
@@ -385,6 +385,7 @@
, m_print /**< MIL print() function */
, m_printf /**< MIL printf() function */
+ , m_printerr /**< MIL fprintf(stderr(),...) function */
, m_col_name /**< assign BAT column name (for debugging only) */
@@ -1014,6 +1015,7 @@
PFmil_t * PFmil_print (const PFmil_t *);
PFmil_t * PFmil_printf (const PFmil_t *);
+PFmil_t * PFmil_printerr (const PFmil_t *);
PFmil_t * PFmil_col_name (const PFmil_t *, const PFmil_t *);
PFmil_t * PFmil_comment (const char *, ...)
__attribute__ ((format (printf, 1, 2)));
Index: pathfinder/compiler/compile.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/compile.c,v
retrieving revision 1.186
diff -u -r1.186 compile.c
--- pathfinder/compiler/compile.c 7 Jan 2010 15:24:27 -0000 1.186
+++ pathfinder/compiler/compile.c 14 Apr 2010 10:33:26 -0000
@@ -801,7 +801,7 @@
/* make runtime timing available */
if (status->timing) {
mroot = PFmil_seq (mroot,
- PFmil_printf (
+ PFmil_printerr (
PFmil_arg (PFmil_lit_str ("\nShred % 10.3f msec"
"\nQuery % 10.3f msec"
"\nPrint % 10.3f msec\n"),
@@ -1082,7 +1082,7 @@
if (!strncmp ("timing", genType, 6))
/* add timing information */
mroot = PFmil_seq (mroot,
- PFmil_printf (
+ PFmil_printerr (
PFmil_arg (PFmil_lit_str ("\nTrans % 10.3f msec"
"\nShred % 10.3f msec"
"\nQuery % 10.3f msec"
Index: pathfinder/compiler/mil/mil.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/mil/mil.c,v
retrieving revision 1.86
diff -u -r1.86 mil.c
--- pathfinder/compiler/mil/mil.c 7 Jan 2010 15:24:28 -0000 1.86
+++ pathfinder/compiler/mil/mil.c 14 Apr 2010 10:33:26 -0000
@@ -1896,6 +1896,12 @@
}
PFmil_t *
+PFmil_printerr (const PFmil_t *args)
+{
+ return wire1 (m_printerr, args);
+}
+
+PFmil_t *
PFmil_col_name (const PFmil_t *bat, const PFmil_t *name)
{
return wire2 (m_col_name, bat, name);
Index: pathfinder/compiler/mil/mil_dce.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/mil/mil_dce.c,v
retrieving revision 1.34
diff -u -r1.34 mil_dce.c
--- pathfinder/compiler/mil/mil_dce.c 7 Jan 2010 15:24:28 -0000 1.34
+++ pathfinder/compiler/mil/mil_dce.c 14 Apr 2010 10:33:27 -0000
@@ -474,6 +474,7 @@
case m_error:
case m_print:
case m_printf:
+ case m_printerr:
case m_break:
case m_use:
case m_update_tape:
Index: pathfinder/compiler/mil/milprint.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/mil/milprint.c,v
retrieving revision 1.101
diff -u -r1.101 milprint.c
--- pathfinder/compiler/mil/milprint.c 7 Jan 2010 15:24:28 -0000 1.101
+++ pathfinder/compiler/mil/milprint.c 14 Apr 2010 10:33:27 -0000
@@ -28,6 +28,7 @@
| 'ERROR (' expression ')'
Index: MapiClient.mx =================================================================== RCS file: /cvsroot/monetdb/clients/src/mapiclient/MapiClient.mx,v retrieving revision 1.201 retrieving revision 1.202 diff -u -d -r1.201 -r1.202 --- MapiClient.mx 29 Mar 2010 18:45:15 -0000 1.201 +++ MapiClient.mx 13 Apr 2010 12:43:04 -0000 1.202 @@ -332,10 +332,11 @@ static void timerEnd(void) { + stream_flush(toConsole); t1 = gettime(); if (mark && specials == NOmodifier) { - stream_printf(toConsole, "%s %7ld.%03ld msec %s\n", mark, (long) ((t1 - t0) / 1000), (long) ((t1 - t0) % 1000), mark2 ? mark2 : ""); - stream_flush(toConsole); + fprintf(stderr, "%s %7ld.%03ld msec %s\n", mark, (long) ((t1 - t0) / 1000), (long) ((t1 - t0) % 1000), mark2 ? mark2 : ""); + fflush(stderr); } }
------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Monetdb-checkins mailing list Monetdb-checkins@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-checkins
-- | Dr. Stefan Manegold | mailto:Stefan.Manegold@cwi.nl | | CWI, P.O.Box 94079 | http://www.cwi.nl/~manegold/ | | 1090 GB Amsterdam | Tel.: +31 (20) 592-4212 | | The Netherlands | Fax : +31 (20) 592-4199 |