Changeset: fcf6d16a13b1 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fcf6d16a13b1
Modified Files:
        clients/mapiclient/tomograph.c
Branch: default
Log Message:

Correct re-initialization for proper statistics gathering


diffs (83 lines):

diff --git a/clients/mapiclient/tomograph.c b/clients/mapiclient/tomograph.c
--- a/clients/mapiclient/tomograph.c
+++ b/clients/mapiclient/tomograph.c
@@ -314,39 +314,12 @@ int topbox = 0;
 lng totalclkticks = 0; /* number of clock ticks reported */
 lng totalexecticks = 0; /* number of ticks reported for processing */
 lng lastclktick = 0;
-lng totalticks; 
+lng totalticks = 0; 
 lng starttime = 0;
 int figures = 0;
 char *currentfunction= 0;
 int object = 1;
 
-static void resetTomograph(void){
-       static char buf[128];
-       int i;
-       if(atlas) {
-               snprintf(buf,128,"%s_%02d",basefilename, ++atlaspage);
-               filename = buf;
-       } 
-       if (debug)
-               fprintf(stderr, "RESET tomograph %d\n", atlaspage);
-       for(i=0; i< MAXTHREADS; i++)
-               lastclk[i]=0;
-       topbox =0;
-       for (i = 0; i < MAXTHREADS; i++)
-               threads[i] = topbox++;
-
-       startrange = 0, endrange = 0;
-       maxio = 0;
-       cpus = 0;
-       batch = batchsize;
-       totalclkticks = 0; 
-       totalexecticks = 0;
-       lastclktick = 0;
-       figures = 0;
-       currentfunction = 0;
-       object = 1;
-}
-
 static void dumpbox(int i)
 {
        printf("[%d] row %d color %d ", i, box[i].row, box[i].color);
@@ -1423,6 +1396,38 @@ static void gnuplotheader(char *filename
        fprintf(gnudata, "set multiplot\n");
 }
 
+static void resetTomograph(void){
+       static char buf[128];
+       int i;
+       if(atlas) {
+               snprintf(buf,128,"%s_%02d",basefilename, ++atlaspage);
+               filename = buf;
+       } 
+       if (debug)
+               fprintf(stderr, "RESET tomograph %d\n", atlaspage);
+       for(i=0; i< NUM_COLORS;i++){
+               colors[i].freq=0;
+               colors[i].timeused = 0;
+       }
+       for(i=0; i< MAXTHREADS; i++)
+               lastclk[i]=0;
+       topbox =0;
+       for (i = 0; i < MAXTHREADS; i++)
+               threads[i] = topbox++;
+
+       startrange = 0, endrange = 0;
+       maxio = 0;
+       cpus = 0;
+       batch = batchsize;
+       totalclkticks = 0; 
+       totalticks = 0; 
+       totalexecticks = 0;
+       lastclktick = 0;
+       figures = 0;
+       currentfunction = 0;
+       object = 1;
+}
+
 static void createTomogram(void)
 {
        char buf[BUFSIZ];
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to