Skip to content
Snippets Groups Projects
Commit e39e62a1 authored by Jan David Mol's avatar Jan David Mol
Browse files

Task #9344: Backported nicer AOFlaggerStep fix to 2.16

parent aa212237
No related branches found
No related tags found
No related merge requests found
......@@ -119,6 +119,9 @@ namespace LOFAR {
const aoflagger::FlagMask& rfiMask, const aoflagger::FlagMask& origMask,
int bl);
// Format a number as kB, MB, etc.
static void formatBytes(std::ostream&, double);
// Fill the rfi strategy.
void fillStrategy();
......
......@@ -93,7 +93,28 @@ namespace LOFAR {
os << " keepstatistics: " << itsDoRfiStats << std::endl;
os << " autocorr: " << itsDoAutoCorr << std::endl;
os << " nthreads (omp) " << OpenMP::maxThreads() << std::endl;
os << " max memory used " << itsMemoryNeeded << std::endl;
os << " max memory used ";
formatBytes(os, itsMemoryNeeded);
os << std::endl;
}
void AOFlaggerStep::formatBytes(std::ostream& os, double bytes) {
int exp=0;
while (bytes >= 1024 && exp<5) {
bytes/=1024;
exp++;
}
uint origPrec=os.precision();
os.precision(1);
if (exp==0) {
os<<fixed<<bytes<<" "<<"B";
} else {
os<<fixed<<bytes<<" "<<"KMGTPE"[exp-1]<<"B";
}
os.precision(origPrec);
}
void AOFlaggerStep::updateInfo (const DPInfo& infoIn)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment