EVSL  1.1.0
EigenValues Slicing Library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
stats.c
Go to the documentation of this file.
1 #include <stdlib.h>
2 #include <stdio.h>
3 #include <string.h>
4 #include "def.h"
5 #include "struct.h"
6 #include "internal_proto.h"
7 
14 void StatsPrint(FILE *fstats) {
15  evslStat *stats = &evslstat;
16  double t_iter = stats->t_iter;
17  double t_setBsv = stats->t_setBsv;
18  double t_setASigBsv = stats->t_setASigBsv;
19  double t_mvA = stats->t_mvA;
20  double t_mvB = stats->t_mvB;
21  double t_svB = stats->t_svB;
22  double t_svASigB = stats->t_svASigB;
23  double t_reorth = stats->t_reorth;
24  double t_eig = stats->t_eig;
25  double t_blas = stats->t_blas;
26  double t_ritz = stats->t_ritz;
27  double t_polAv = stats->t_polAv;
28  double t_ratAv = stats->t_ratAv;
29  double t_sth = stats->t_sth;
30  size_t n_mvA = stats->n_mvA;
31  size_t n_mvB = stats->n_mvB;
32  size_t n_svB = stats->n_svB;
33  size_t n_svASigB = stats->n_svASigB;
34  size_t n_polAv = stats->n_polAv;
35  size_t n_ratAv = stats->n_ratAv;
36  /* memory */
37  //size_t alloced = stats->alloced;
38  //size_t alloced_total = stats->alloced_total;
39  //size_t alloced_max = stats->alloced_max;
40  /* time */
41  fprintf(fstats, " Timing (sec):\n");
42  if (t_setBsv) { fprintf(fstats, " Setup Solver for B : %f\n", t_setBsv); }
43  if (t_setASigBsv) { fprintf(fstats, " Setup Solver for A-SIG*B : %f\n", t_setASigBsv); }
44  if (t_iter) { fprintf(fstats, " Iteration time (tot) : %f\n", t_iter); }
45 
46  fprintf(fstats, " - - - - - - - - - - - - - - - - -\n");
47 
48  if (n_polAv) { fprintf(fstats, " Pol(A)*v : %f (%8ld, avg %f)\n", t_polAv, n_polAv, t_polAv / n_polAv); }
49  if (n_ratAv) { fprintf(fstats, " Rat(A)*v : %f (%8ld, avg %f)\n", t_ratAv, n_ratAv, t_ratAv / n_ratAv); }
50  if (n_mvA) { fprintf(fstats, " Matvec matrix A : %f (%8ld, avg %f)\n", t_mvA, n_mvA, t_mvA / n_mvA); }
51  if (n_mvB) { fprintf(fstats, " Matvec matrix B : %f (%8ld, avg %f)\n", t_mvB, n_mvB, t_mvB / n_mvB); }
52  if (n_svB) { fprintf(fstats, " Solve with B : %f (%8ld, avg %f)\n", t_svB, n_svB, t_svB / n_svB); }
53  if (n_svASigB) { fprintf(fstats, " Solve with A-SIGMA*B : %f (%8ld, avg %f)\n", t_svASigB, n_svASigB, t_svASigB / n_svASigB); }
54  if (t_reorth) { fprintf(fstats, " Reorthogonalization : %f\n", t_reorth); }
55  if (t_eig) { fprintf(fstats, " LAPACK eig : %f\n", t_eig); }
56  if (t_blas) { fprintf(fstats, " Other BLAS : %f\n", t_blas); }
57  if (t_ritz) { fprintf(fstats, " Compute Ritz vectors : %f\n", t_ritz); }
58  /* if (t_sth) { fprintf(fstats, " Some other thing timed : %f\n", t_sth); } */
59  if (t_sth) { fprintf(fstats, " Other : %f\n", t_sth); }
60  /* memory */
61  /*
62  if (alloced_total > 1e9) {
63  fprintf(fstats, " Memory (GB):\n");
64  fprintf(fstats, " Total %.2f, Peak %.2f \n", alloced_total/1e9, alloced_max/1e9);
65  } else if (alloced_total > 1e6) {
66  fprintf(fstats, " Memory (MB):\n");
67  fprintf(fstats, " Total %.2f, Peak %.2f \n", alloced_total/1e6, alloced_max/1e6);
68  } else {
69  fprintf(fstats, " Memory (KB):\n");
70  fprintf(fstats, " Total %.2f, Peak %.2f \n", alloced_total/1e3, alloced_max/1e3);
71  }
72  if (alloced) {
73  fprintf(fstats, "warning: unfreed memory %ld\n", alloced);
74  }
75  */
76  fflush(fstats);
77 }
78 
79 void StatsReset() {
80  memset(&evslstat, 0, sizeof(evslStat));
81 }
double t_ratAv
Definition: struct.h:212
size_t n_svASigB
Definition: struct.h:218
defs in EVSL
void StatsPrint(FILE *fstats)
Definition: stats.c:14
double t_mvB
Definition: struct.h:203
double t_blas
Definition: struct.h:209
double t_polAv
Definition: struct.h:211
double t_reorth
Definition: struct.h:207
This file contains function prototypes and constant definitions internally used in EVSL...
size_t n_polAv
Definition: struct.h:219
double t_sth
Definition: struct.h:213
double t_mvA
Definition: struct.h:202
evslStat evslstat
global statistics of EVSL
Definition: evsl.c:21
double t_ritz
Definition: struct.h:210
structs used in evsl
size_t n_ratAv
Definition: struct.h:220
double t_svASigB
Definition: struct.h:206
double t_setBsv
Definition: struct.h:198
size_t n_mvB
Definition: struct.h:215
double t_eig
Definition: struct.h:208
void StatsReset()
Definition: stats.c:79
double t_setASigBsv
Definition: struct.h:199
timing and memory statistics of EVSL
Definition: struct.h:196
size_t n_mvA
Definition: struct.h:214
double t_svB
Definition: struct.h:204
double t_iter
Definition: struct.h:200
size_t n_svB
Definition: struct.h:216