1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-04-18 09:45:55 +01:00

Hadrons: more scheduler optimizations

This commit is contained in:
Antonin Portelli 2016-05-10 19:19:38 +01:00
parent d604580e5a
commit 29dfe99e7c

View File

@ -316,20 +316,29 @@ unsigned int Environment::executeProgram(const std::vector<unsigned int> &p)
for (unsigned int i = 0; i < p.size(); ++i) for (unsigned int i = 0; i < p.size(); ++i)
{ {
// execute module // execute module
if (!isDryRun())
{
LOG(Message) << SEP << " Measurement step " << i+1 << "/" LOG(Message) << SEP << " Measurement step " << i+1 << "/"
<< p.size() << " (module '" << moduleName_[p[i]] << "') " << p.size() << " (module '" << moduleName_[p[i]]
<< SEP << std::endl; << "') " << SEP << std::endl;
}
(*module_[p[i]])(); (*module_[p[i]])();
sizeBefore = getTotalSize(); sizeBefore = getTotalSize();
// print used memory after execution // print used memory after execution
if (!isDryRun())
{
LOG(Message) << "Allocated objects: " << MEM_MSG(sizeBefore) LOG(Message) << "Allocated objects: " << MEM_MSG(sizeBefore)
<< std::endl; << std::endl;
}
if (sizeBefore > memPeak) if (sizeBefore > memPeak)
{ {
memPeak = sizeBefore; memPeak = sizeBefore;
} }
// garbage collection for step i // garbage collection for step i
if (!isDryRun())
{
LOG(Message) << "Garbage collection..." << std::endl; LOG(Message) << "Garbage collection..." << std::endl;
}
nothingFreed = true; nothingFreed = true;
do do
{ {
@ -360,6 +369,8 @@ unsigned int Environment::executeProgram(const std::vector<unsigned int> &p)
} }
// print used memory after garbage collection if necessary // print used memory after garbage collection if necessary
sizeAfter = getTotalSize(); sizeAfter = getTotalSize();
if (!isDryRun())
{
if (sizeBefore != sizeAfter) if (sizeBefore != sizeAfter)
{ {
LOG(Message) << "Allocated objects: " << MEM_MSG(sizeAfter) LOG(Message) << "Allocated objects: " << MEM_MSG(sizeAfter)
@ -370,6 +381,7 @@ unsigned int Environment::executeProgram(const std::vector<unsigned int> &p)
LOG(Message) << "Nothing to free" << std::endl; LOG(Message) << "Nothing to free" << std::endl;
} }
} }
}
return memPeak; return memPeak;
} }