Skip to content

Progress reporting improvements#3014

Merged
dzenanz merged 8 commits intoInsightSoftwareConsortium:masterfrom
dzenanz:progress4filters
Jan 6, 2022
Merged

Progress reporting improvements#3014
dzenanz merged 8 commits intoInsightSoftwareConsortium:masterfrom
dzenanz:progress4filters

Conversation

@dzenanz
Copy link
Copy Markdown
Member

@dzenanz dzenanz commented Dec 29, 2021

Related to #2875.

@github-actions github-actions Bot added area:Filtering Issues affecting the Filtering module type:Bug Inconsistencies or issues which will cause an incorrect result under some or all circumstances labels Dec 29, 2021
Copy link
Copy Markdown
Member

@jhlegarreta jhlegarreta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have not tried, but wondering whether

Now the progress fills up twice faster so it reaches 100% when only 50% of work is done.

is the expected behavior, or an expected limitation (e.g. if it cannot be set to 50% when half of the job has been done, and to be 100% only when the job has been completed), whether the wording is accurate or else whether it is a misunderstanding of mine.

@dzenanz
Copy link
Copy Markdown
Member Author

dzenanz commented Dec 30, 2021

Before 840bae7 progress would go from 0% to 100% twice, overflowing from 100% to 0% about halfway. After 840bae7, the progress fills up to 100% during first half of the work, and stays there the second half of the work. Now, the progress fills up to 50% during first half of the work, and fills up to 100% during second half of the work.

In all instances, the progress was usually being filled smoothly.

Copy link
Copy Markdown
Member

@blowekamp blowekamp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I just would like to know why it is needed to set is multiple times in a class hierarchy of constructors

Comment thread Modules/Filtering/LabelMap/include/itkLabelMapToLabelImageFilter.hxx Outdated
Comment thread Modules/Filtering/LabelMap/include/itkLabelShapeKeepNObjectsImageFilter.hxx Outdated
@dzenanz
Copy link
Copy Markdown
Member Author

dzenanz commented Dec 30, 2021

@jhlegarreta I updated the commit message.

Copy link
Copy Markdown
Member

@jhlegarreta jhlegarreta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the patch set and the commit message update, now it makes more sense to me.

After Brad's comment, I'm wondering whether setting/updating the threader update progress report flag should be disabled in child classes/whether that makes sense.

@dzenanz
Copy link
Copy Markdown
Member Author

dzenanz commented Dec 30, 2021

I have a more comprehensive solution. I am testing it locally.

@thewtex
Copy link
Copy Markdown
Member

thewtex commented Dec 30, 2021

@dzenanz please start commit messages with capital letters for the ChangeLog.

@github-actions github-actions Bot added area:Core Issues affecting the Core module and removed area:Filtering Issues affecting the Filtering module labels Dec 30, 2021
@github-actions github-actions Bot added the area:Filtering Issues affecting the Filtering module label Dec 31, 2021
@dzenanz dzenanz force-pushed the progress4filters branch 2 times, most recently from 0cf3b4f to 1cd2afe Compare December 31, 2021 21:28
@github-actions github-actions Bot added the type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct label Dec 31, 2021
@dzenanz
Copy link
Copy Markdown
Member Author

dzenanz commented Dec 31, 2021

There is something wrong with progress updates the second time filter is run:

1570: Trying filter->UpdateLargestPossibleRegion()
1570: -------- Start GradientMagnitudeRecursiveGaussianImageFilter "" Progress Quiet
1570: Filter took 0.0594145 seconds.
1570: -------- End GradientMagnitudeRecursiveGaussianImageFilter ""
1570:
1570: itk::ExceptionObject (000000D8CD2FE3C8)
1570: Location: "void __cdecl itk::SimpleFilterWatcher::EndFilter(void)"
1570: File: C:\Dev\ITK-git\Modules\Core\Common\include\itkSimpleFilterWatcher.h
1570: Line: 283
1570: Description: ITK ERROR: GradientMagnitudeRecursiveGaussianImageFilter(000000D8CD2FED70): Filter does not have progress.
1570:
1570:
1570:   In C:\Dev\ITK-git\Modules\Filtering\ImageGradient\test\itkGradientMagnitudeRecursiveGaussianFilterTest.cxx, line 217
1/1 Test #1570: itkGradientMagnitudeRecursiveGaussianFilterTest ...***Failed    0.47 sec

@dzenanz dzenanz changed the title BUG: avoid duplicate progress reporting Progress reporting improvements Dec 31, 2021
@dzenanz
Copy link
Copy Markdown
Member Author

dzenanz commented Jan 3, 2022

something wrong with progress updates the second time filter is run

This is the only problem left. How much of a problem is this? Does someone know how to solve it? I am somewhat tired of this PR. It started as quite a small fix.

@dzenanz
Copy link
Copy Markdown
Member Author

dzenanz commented Jan 3, 2022

I found out the problem. It will take me some time to clean up the code. I will push the update tomorrow.

@github-actions github-actions Bot removed the type:Bug Inconsistencies or issues which will cause an incorrect result under some or all circumstances label Jan 3, 2022
Comment thread Modules/Core/Common/include/itkProgressAccumulator.h Outdated
@blowekamp
Copy link
Copy Markdown
Member

In testing this PR against SimpleITK I got a large number of FFT related test further inailures, and one Progress report test failing. It will need further investigation.

@dzenanz
Copy link
Copy Markdown
Member Author

dzenanz commented Jan 4, 2022

Thanks for testing. Feel free to push to this this branch if you find some easy fixes.

@dzenanz
Copy link
Copy Markdown
Member Author

dzenanz commented Jan 4, 2022

PythonLaplacianImageFilterTest deadlocks on my computer too. At least I can reproduce the failure.

@dzenanz
Copy link
Copy Markdown
Member Author

dzenanz commented Jan 4, 2022

CI Linux Python:

	209 - PythonGradientMagnitudeRecursiveGaussianImageFilterTest (Timeout)
	210 - itkGradientVectorFlowImageFilterPythonTest (Timeout)
	211 - PythonLaplacianImageFilterTest (Timeout)
	215 - PythonGeodesicActiveContourLeftVentricleTest (Timeout)

@dzenanz
Copy link
Copy Markdown
Member Author

dzenanz commented Jan 5, 2022

I have removed the problematic commit from this PR. I will see if I can iron it out in a follow-up PR. I think this can be merged now.

@dzenanz dzenanz requested a review from blowekamp January 5, 2022 21:34
Filter restarts can occur with streaming (processing the image in pieces)
and with internal mini-pipelines which are executed multiple times.
One such example is GradientMagnitudeRecursiveGaussianImageFilter.
If the wait_for completed successfully,
two updates were issues in quick succession.
That no longer happens.
@dzenanz
Copy link
Copy Markdown
Member Author

dzenanz commented Jan 5, 2022

I removed all far-reaching code from this PR, and left all the non-problematic code here. It probably no longer fixes #2875, so I changed the description accordingly. I plan the real fix for a follow-up PR.

Copy link
Copy Markdown
Member

@jhlegarreta jhlegarreta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Thanks @dzenanz. Given that @blowekamp tested a previous version against SimpleITK, may be he would like to take that again, but I'm for merging it as the one-but-last build passed tests, and hope this will as well.

@blowekamp
Copy link
Copy Markdown
Member

Having to reset internal filter's progress when re-running seems like a red flag to me. I'd like to test with just re-running a filter in a standalone test to alleviate my concern. I'm not sure I'd have time tomorrow. There are a lot of changes here.

Copy link
Copy Markdown
Member

@blowekamp blowekamp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested a few cases that were of concerned to me, and they all behaved correctly 🥳

Also SimpleITK tests seemed to be OK too (although there are other FFT issues).

Nice work!

@dzenanz dzenanz merged commit ecd025e into InsightSoftwareConsortium:master Jan 6, 2022
@dzenanz dzenanz deleted the progress4filters branch January 6, 2022 16:15
@dzenanz
Copy link
Copy Markdown
Member Author

dzenanz commented Jan 6, 2022

Are the FFT issues captured in #3048?

@tbirdso
Copy link
Copy Markdown
Contributor

tbirdso commented Jan 6, 2022

Also SimpleITK tests seemed to be OK too (although there are other FFT issues).

@blowekamp Could you please add @dzenanz and myself to FFT discussion if there are other open issues?

@blowekamp
Copy link
Copy Markdown
Member

When I narrow in down in SimpleITK, I'll create an issue if needed. Here is a build with the failure FYI: https://open.cdash.org/viewTest.php?onlyfailed&buildid=7657537

@tbirdso
Copy link
Copy Markdown
Contributor

tbirdso commented Jan 6, 2022

At a glance I'm guessing that the SimpleITK tests will need to add factory registrations for VNL FFT classes as the segfaulting tests all seem to require classes that depend on FFT filter instantiations. Whenever you get around to taking a closer look I'd recommend cross-referencing #3002 to see how this is being done in the ITK TestKernel as well as ITK GTests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Core Issues affecting the Core module area:Filtering Issues affecting the Filtering module type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants