libMesh::PerfMon Class Reference
#include <perfmon.h>
List of all members.
Detailed Description
Definition at line 43 of file perfmon.h.
Constructor & Destructor Documentation
| libMesh::PerfMon::PerfMon |
( |
std::string |
id, |
|
|
const unsigned int |
v = 1, |
|
|
const unsigned int |
pid = 0 | |
|
) |
| | [inline] |
| libMesh::PerfMon::~PerfMon |
( |
|
) |
[inline] |
Member Function Documentation
| double libMesh::PerfMon::print |
( |
std::string |
msg = "NULL", |
|
|
std::ostream & |
out = libMesh::out | |
|
) |
| | [inline] |
Definition at line 87 of file perfmon.h.
References flpins, id_string, mflops, proc_id, ptime, rtime, the_time_start, the_time_stop, and verbose.
Referenced by ~PerfMon().
00088 {
00089 gettimeofday (&the_time_stop, NULL);
00090
00091 #ifdef HAVE_PAPI_H
00092 Papi::PAPI_flops (&rtime, &ptime, &flpins, &mflops);
00093 #endif
00094
00095 const double elapsed_time = ((double) (the_time_stop.tv_sec - the_time_start.tv_sec)) +
00096 ((double) (the_time_stop.tv_usec - the_time_start.tv_usec))/1000000.;
00097
00098 if (verbose)
00099 {
00100
00101 if (proc_id == 0)
00102 {
00103 if (msg == "NULL")
00104 my_out << " " << id_string
00105 << ": elapsed time: "
00106 << elapsed_time << " (sec)"
00107 << std::endl;
00108 else
00109 my_out << " " << msg
00110 << ": elapsed time: "
00111 << elapsed_time << " (sec)"
00112 << std::endl;
00113
00114 #ifdef HAVE_PAPI_H
00115 if (msg == "NULL")
00116 my_out << " " << id_string
00117 << ": mflops: "
00118 << mflops
00119 << std::endl;
00120 else
00121 my_out << " " << msg
00122 << ": mflops: "
00123 << mflops
00124 << std::endl;
00125 #endif
00126
00127 }
00128 }
00129
00130 return elapsed_time;
00131 }
| void libMesh::PerfMon::reset |
( |
|
) |
[inline] |
Member Data Documentation
The documentation for this class was generated from the following file: