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

ENH MERIC now starts a first region automatically directly after MERIC_Init...

ENH MERIC now starts a first region automatically directly after MERIC_Init and ends the region together with MERIC_Close - this region is required because the application code can be written in main() and SBI may insert only some regions inside, so there would not be any region providing static tuning of the application #55
parent 3cb1e6f1
...@@ -255,6 +255,16 @@ DistributedMeric::DistributedMeric() ...@@ -255,6 +255,16 @@ DistributedMeric::DistributedMeric()
RAPL::detailed(); RAPL::detailed();
RAPL::init(); RAPL::init();
} }
std::string applicationMainRegion = std::string(program_invocation_name);
size_t n = applicationMainRegion.find_last_of("/");
if (n != std::string::npos)
applicationMainRegion = applicationMainRegion.substr(n+1);
n = applicationMainRegion.find_first_of(".");
if (n != std::string::npos)
applicationMainRegion = applicationMainRegion.substr(0,n);
applicationMainRegion +="_static";
start(applicationMainRegion.c_str());
} }
DistributedMeric::~DistributedMeric() DistributedMeric::~DistributedMeric()
......
...@@ -145,6 +145,8 @@ public: ...@@ -145,6 +145,8 @@ public:
void save() void save()
{ {
stop(); //applicationMainRegion
if (MPIbarriers) if (MPIbarriers)
MPI_Barrier(_currentNode); MPI_Barrier(_currentNode);
......
...@@ -102,6 +102,16 @@ SharedMeric::SharedMeric() ...@@ -102,6 +102,16 @@ SharedMeric::SharedMeric()
DAVIDE::init(); DAVIDE::init();
DAVIDE::start(_startTime); DAVIDE::start(_startTime);
} }
std::string applicationMainRegion = std::string(program_invocation_name);
size_t n = applicationMainRegion.find_last_of("/");
if (n != std::string::npos)
applicationMainRegion = applicationMainRegion.substr(n+1);
n = applicationMainRegion.find_first_of(".");
if (n != std::string::npos)
applicationMainRegion = applicationMainRegion.substr(0,n);
applicationMainRegion +="_static";
start(applicationMainRegion.c_str());
} }
SharedMeric::~SharedMeric() SharedMeric::~SharedMeric()
......
...@@ -137,6 +137,8 @@ public: ...@@ -137,6 +137,8 @@ public:
void save() void save()
{ {
stop(); //applicationMainRegion
if (MODE == MODE_HDEEM || MODE == MODE_BOTH) if (MODE == MODE_HDEEM || MODE == MODE_BOTH)
{ {
HDEEM::stop(_stopTime); HDEEM::stop(_stopTime);
......
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