ProgressHandler needs fixing, error checking, consistency and COMMENTS.
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
The progress handler needs to have it's throttle fixe. File vtkPVProgressHandler.cxx, member function vtkPVProgressHandler::ReportProgress(). Progress should NEVER be outside of the range of 0 to 1, so don't send MPI calls for out of range progress. Also, make sure to throttle progress for 0.0, since many functions in the code incorrectly send this billions of times.
I changed
if (progress <= 0.0 || progress >= 1.0 ||
this->Internals->ProgressTimer->GetElapsedTime() > this->ProgressFrequency)
to
if (progress >= 0.0 && progress <= 1.0 &&
this->Internals->ProgressTimer->GetElapsedTime() > this->ProgressFrequency)
The Progress Report code needs a way to find error cases with progress. I suggest adding the following at the top of the vtkPVProgressHandler::ReportProgress() function, which I assume only is printed for debug builds:
if (progress < 0.0 || progress > 1.0 )
vtkWarningMacro(<< "vtkPVProgressHandler::ReportProgress - "<<
" progress out of range [0.0-1.0] " << progress);
The Progress Handler code needs to have progress be consistent throughout. In most functions, progress goes from 0.0 to 1.0. In the call to SetLocalProgress(), progress becomes a range of 0 to 100, and inside this code makes a call that requires it to be divided by 100! Keep 0.0 to 1.0 throughout. Be sure to change LastProgress = progress*100.0 (assuming it even gets used, which I couldn't find).
Last, please document the range for progress and change the variable for progress if it has a different range. It was confusing what it should be. (progress100?)