#include <perfmon.h>
PerfMon (std::string id, const unsigned int v=1, const unsigned int pid=0)
~PerfMon ()
void reset ()
double print (std::string msg='NULL')
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
Definition at line 42 of file perfmon.h.
Definition at line 135 of file perfmon.h.
References reset().
:
id_string(id),
verbose(v),
proc_id(pid)
{
reset ();
}
Definition at line 148 of file perfmon.h.
References print().
{
print ();
}
Definition at line 86 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')
std::cout << ' ' << id_string
<< ': elapsed time: '
<< elapsed_time << ' (sec)'
<< std::endl;
else
std::cout << ' ' << msg
<< ': elapsed time: '
<< elapsed_time << ' (sec)'
<< std::endl;
#ifdef HAVE_PAPI_H
if (msg == 'NULL')
std::cout << ' ' << id_string
<< ': mflops: '
<< mflops
<< std::endl;
else
std::cout << ' ' << msg
<< ': mflops: '
<< mflops
<< std::endl;
#endif
}
}
return elapsed_time;
}
Definition at line 73 of file perfmon.h.
References flpins, mflops, ptime, rtime, and the_time_start.
Referenced by PerfMon().
{
gettimeofday (&the_time_start, NULL);
#ifdef HAVE_PAPI_H
Papi::PAPI_flops (&rtime, &ptime, &flpins, &mflops);
#endif
}
Definition at line 65 of file perfmon.h.
Referenced by print(), and reset().
Definition at line 55 of file perfmon.h.
Definition at line 64 of file perfmon.h.
Referenced by print(), and reset().
Definition at line 61 of file perfmon.h.
Definition at line 64 of file perfmon.h.
Referenced by print(), and reset().
Definition at line 64 of file perfmon.h.
Referenced by print(), and reset().
Definition at line 57 of file perfmon.h.
Referenced by print(), and reset().
Definition at line 58 of file perfmon.h.
Definition at line 60 of file perfmon.h.
Referenced by print().
Generated automatically by Doxygen for libMesh from the source code.