$extrastylesheet
#include <perfmon.h>
Public Member Functions | |
| PerfMon (std::string id, const unsigned int v=1, const unsigned int pid=0) | |
| ~PerfMon () | |
| void | reset () |
| double | print (std::string msg="NULL", std::ostream &out=libMesh::out) |
Private Attributes | |
| const std::string | id_string |
| struct timeval | the_time_start |
| struct timeval | the_time_stop |
| const unsigned int | verbose |
| const unsigned int | proc_id |
| float | rtime |
| float | ptime |
| float | mflops |
| long long int | flpins |
| libMesh::PerfMon::PerfMon | ( | std::string | id, |
| const unsigned int | v = 1, |
||
| const unsigned int | pid = 0 |
||
| ) | [inline] |
| libMesh::PerfMon::~PerfMon | ( | ) | [inline] |
| 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().
{
gettimeofday (&the_time_stop, NULL);
#ifdef HAVE_PAPI_H
Papi::PAPI_flops (&rtime, &ptime, &flpins, &mflops);
#endif
const double elapsed_time = ((double) (the_time_stop.tv_sec - the_time_start.tv_sec)) +
((double) (the_time_stop.tv_usec - the_time_start.tv_usec))/1000000.;
if (verbose)
{
if (proc_id == 0)
{
if (msg == "NULL")
my_out << " " << id_string
<< ": elapsed time: "
<< elapsed_time << " (sec)"
<< std::endl;
else
my_out << " " << msg
<< ": elapsed time: "
<< elapsed_time << " (sec)"
<< std::endl;
#ifdef HAVE_PAPI_H
if (msg == "NULL")
my_out << " " << id_string
<< ": mflops: "
<< mflops
<< std::endl;
else
my_out << " " << msg
<< ": mflops: "
<< mflops
<< std::endl;
#endif
}
}
return elapsed_time;
}
| void libMesh::PerfMon::reset | ( | ) | [inline] |
long long int libMesh::PerfMon::flpins [private] |
const std::string libMesh::PerfMon::id_string [private] |
float libMesh::PerfMon::mflops [private] |
const unsigned int libMesh::PerfMon::proc_id [private] |
float libMesh::PerfMon::ptime [private] |
float libMesh::PerfMon::rtime [private] |
struct timeval libMesh::PerfMon::the_time_start [private] |
struct timeval libMesh::PerfMon::the_time_stop [private] |
const unsigned int libMesh::PerfMon::verbose [private] |