@@ -90,7 +90,7 @@ void FFrExtractor::releaseMemoryBlocks(bool readOps)
9090*/
9191
9292bool FFrExtractor ::addFiles (const std ::set < std ::string > & fileNames ,
93- bool showProgress )
93+ bool showProgress , bool doMemPoll )
9494{
9595 if (fileNames .empty ()) return true;
9696
@@ -99,7 +99,7 @@ bool FFrExtractor::addFiles(const std::set<std::string>& fileNames,
9999 for (const std ::string & fileName : fileNames )
100100 fileVec .push_back (fileName );
101101
102- return this -> addFiles (fileVec ,showProgress );
102+ return this -> addFiles (fileVec ,showProgress ,false, doMemPoll );
103103}
104104
105105
@@ -109,7 +109,7 @@ bool FFrExtractor::addFiles(const std::set<std::string>& fileNames,
109109*/
110110
111111bool FFrExtractor ::addFiles (const std ::vector < std ::string > & fileNames ,
112- bool showProgress , bool mustExist )
112+ bool showProgress , bool mustExist , bool doMemPoll )
113113{
114114#if FFR_DEBUG > 1
115115 std ::cout <<"FFrExtractor ::addFiles ()"<< std::endl;
@@ -128,7 +128,7 @@ bool FFrExtractor::addFiles(const std::vector<std::string>& fileNames,
128128 FFaMsg ::setSubTask (FFaFilePath ::getFileName (fileName ));
129129 FFaMsg ::setSubStep (++ subStep );
130130 }
131- if (!this -> addFile (fileName ,mustExist ))
131+ if (!this -> addFile (fileName ,mustExist , doMemPoll ))
132132 retval = false;
133133 }
134134
@@ -166,7 +166,8 @@ FFrResultContainer* FFrExtractor::getResultContainer(const std::string& fileName
166166}
167167
168168
169- bool FFrExtractor ::addFile (const std ::string & fileName , bool mustExist )
169+ bool FFrExtractor ::addFile (const std ::string & fileName ,
170+ bool mustExist , bool doMemPoll )
170171{
171172#if FFR_DEBUG > 1
172173 std ::cout <<"FFrExtractor::addFile()\n\tfilename: " << fileName << std ::endl ;
@@ -177,9 +178,9 @@ bool FFrExtractor::addFile(const std::string& fileName, bool mustExist)
177178 if (container ) return true;
178179
179180 // Create a new result container for the given results file.
180- // The header section of if is then parsed if the file is a valid.
181+ // The header section of it is then parsed if the file is a valid.
181182 container = new FFrResultContainer (this ,fileName );
182- switch (this -> doSingleResultFileUpdate (container )) {
183+ switch (this -> doResultFileUpdate (container , doMemPoll )) {
183184 case FFrResultContainer ::FFR_CONTAINER_INVALID :
184185 FFaMsg ::list (" * Note: Ignoring invalid results database file:\n" );
185186 break ;
@@ -201,7 +202,11 @@ bool FFrExtractor::addFile(const std::string& fileName, bool mustExist)
201202}
202203
203204
204- bool FFrExtractor ::updateExtractorHeader (FFrResultContainer * container )
205+ bool FFrExtractor ::updateExtractorHeader (FFrResultContainer * container , bool
206+ #ifdef FT_USE_PROFILER
207+ doMemPoll
208+ #endif
209+ )
205210{
206211#if FFR_DEBUG > 1
207212 std ::cout <<"FFrExtractor::updateExtractorHeader()\n\tfilename: "
@@ -210,9 +215,10 @@ bool FFrExtractor::updateExtractorHeader(FFrResultContainer* container)
210215 if (!container -> isHeaderComplete ()) return false;
211216
212217#ifdef FT_USE_PROFILER
213- FFaProfiler timer ("ExtractorTimer" );
218+ FFaProfiler timer ("ExtractorTimer: " + container -> getFileName () );
214219 timer .startTimer ("updateExtractorHeader" );
215- FFaMemoryProfiler ::reportMemoryUsage ("> updateExtractorHeader" );
220+ if (doMemPoll )
221+ FFaMemoryProfiler ::reportMemoryUsage ("> updateExtractorHeader" );
216222#endif
217223
218224 for (FFrEntryBase * entry : container -> topLevel ())
@@ -283,7 +289,8 @@ bool FFrExtractor::updateExtractorHeader(FFrResultContainer* container)
283289#endif
284290
285291#ifdef FT_USE_PROFILER
286- FFaMemoryProfiler ::reportMemoryUsage (" updateExtractorHeader > ");
292+ if (doMemPoll )
293+ FFaMemoryProfiler ::reportMemoryUsage (" updateExtractorHeader > ");
287294 timer .stopTimer ("updateExtractorHeader" );
288295 timer .report ();
289296#endif
@@ -523,27 +530,28 @@ FFrEntryBase* FFrExtractor::findVar(const std::string& oType, int baseId,
523530}
524531
525532
526- void FFrExtractor ::doResultFilesUpdate ()
533+ void FFrExtractor ::doResultFilesUpdate (bool doMemPoll )
527534{
528535 for (const ContainerMap ::value_type & c : myContainers )
529- this -> doSingleResultFileUpdate (c .second );
536+ this -> doResultFileUpdate (c .second , doMemPoll );
530537}
531538
532539
533- int FFrExtractor ::doSingleResultFileUpdate (FFrResultContainer * container )
540+ int FFrExtractor ::doResultFileUpdate (FFrResultContainer * container ,
541+ bool doMemPoll )
534542{
535543#if FFR_DEBUG > 2
536- std ::cout <<"FFrExtractor::doSingleResultFileUpdate ()\n\tfilename: "
544+ std ::cout <<"FFrExtractor::doResultFileUpdate ()\n\tfilename: "
537545 << container -> getFileName () << std ::endl ;
538546#endif
539547
540548 if (container -> getContainerStatus () == FFrResultContainer ::FFR_DATA_CLOSED )
541549 return FFrResultContainer ::FFR_DATA_CLOSED ;
542550
543551 bool wasComplete = container -> isHeaderComplete ();
544- int status = container -> updateContainerStatus ( );
552+ int status = container -> updateStatus ( doMemPoll );
545553 if (!wasComplete && container -> isHeaderComplete ())
546- this -> updateExtractorHeader (container );
554+ this -> updateExtractorHeader (container , doMemPoll );
547555
548556 return status ;
549557}
0 commit comments