Commit f89a98ea authored by Ondrej Vysocky's avatar Ondrej Vysocky
Browse files

ENH removed parameters of void TIMEPROF_evaluate() function to be compatible...

ENH removed parameters of void TIMEPROF_evaluate() function to be compatible with shared API #56 #37
parent 02104004
......@@ -2,19 +2,19 @@
#include "../../include/timeprof.h"
#include "timeprof.h"
void TIMEPROF_regionStart (const char * regionName)
void TIMEPROF_regionStart (const char * regionName)
{
timeprof::regionStart(regionName);
}
double TIMEPROF_regionStop (const char * regionName)
double TIMEPROF_regionStop (const char * regionName)
{
return timeprof::regionStop(regionName);
}
void TIMEPROF_evaluate (unsigned int timeThreshold, const char * fileName)
void TIMEPROF_evaluate()
{
timeprof::evaluate(timeThreshold, fileName);
timeprof::evaluate();
}
double TIMEPROF_getLastRegionDuration()
......
#include "timeprof.h"
#include <cstdlib>
#include "../basis/utils.h"
#include <iostream>
#include <fstream>
#include <string>
#include <map>
#include <time.h>
#ifdef HAVE_OMP_H
#include <omp.h>
#endif
......@@ -139,9 +138,12 @@ double regionStop(const char * regionName)
* to the file 'fileName' stores a list of regions with a runtime longer than the trashold [ms]
* if fileName not specified the output will go to the std::cerr
**/
//void TIMEPROF_evaluate(unsigned int timeThreshold, const char * fileName)
void evaluate(unsigned int timeThreshold, const char * fileName)
//void TIMEPROF_evaluate()
void evaluate()
{
unsigned int timeThreshold = meric::mutils::getenv<unsigned int>("TIMEPROF_TIME", 0);
std::string fileName = meric::mutils::getenv("TIMEPROF_OUTPUT", std::string("TIMEPROF.log"));
printout << "E1 "<< TIMEPROF_rank << std::endl;
if (TIMEPROF_rank == MASTER)
{
......@@ -149,7 +151,7 @@ void evaluate(unsigned int timeThreshold, const char * fileName)
{
double timeLimit = timeThreshold/1000.0;
std::ofstream of;
if (fileName != NULL && fileName[0] != '\0')
if (fileName != "")
{
of.open(fileName);
}
......@@ -157,7 +159,6 @@ void evaluate(unsigned int timeThreshold, const char * fileName)
if (!of.is_open())
raii.~outputStream();
for (auto& funcRecord : funcPROBEDList)
{
if (funcRecord.second.minDuration > timeLimit)
......
......@@ -4,7 +4,7 @@
namespace timeprof{
void regionStart(const char * regionName);
double regionStop(const char * regionName);
void evaluate(unsigned int timeThreshold, const char * fileName);
void evaluate();
double getLastRegionDuration();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment