Closed mdoube closed 3 years ago
Wow, nice! Thanks. :beers:
I'm wondering why these ops use their own ExecutorService
s rather than the one already baked into the ThreadService
. But since they do, doing the cleanup as well is definitely a step forward. The new incarnation of ImageJ Ops will use ImgLib2's unified multithreading support.
I tried to cut a new release, but am seeing some test failures on my local system (but not on CI):
[INFO] [ERROR] Failures:
[INFO] [ERROR] OutlineTest.testEdgeSquare:177 Wrong number of foreground elements in interval expected:<7> but was:<5>
[INFO] [ERROR] OutlineTest.testEdgeSquareExcludeEdgesFalse:206 Wrong number of foreground elements in interval expected:<8> but was:<6>
[INFO] [ERROR] OutlineTest.testOutlineSquare:148 Wrong number of foreground elements in interval expected:<8> but was:<5>
I'll investigate when I can.
test failures on my local system (but not on CI)
This smells like something we've seen for a while. Test failures on some machines (usually bigger ones, e.g. workstations) but passing on CI and smaller machines (e.g. laptops).
https://github.com/bonej-org/BoneJ2/issues/196#issuecomment-627364697 https://github.com/bonej-org/BoneJ2/issues/229
I wonder if there is a problem with the parallelisation model that leads to overwriting of pixel values depending on number of threads in use.
I tried to cut a new release, but am seeing some test failures on my local system (but not on CI):
[INFO] [ERROR] Failures: [INFO] [ERROR] OutlineTest.testEdgeSquare:177 Wrong number of foreground elements in interval expected:<7> but was:<5> [INFO] [ERROR] OutlineTest.testEdgeSquareExcludeEdgesFalse:206 Wrong number of foreground elements in interval expected:<8> but was:<6> [INFO] [ERROR] OutlineTest.testOutlineSquare:148 Wrong number of foreground elements in interval expected:<8> but was:<5>
I'll investigate when I can.
This PR fixes it at the cost of running in a single thread, which is OK for now. https://github.com/imagej/imagej-ops/pull/639
why these ops use their own
ExecutorService
s rather than the one already baked into theThreadService
There is another PR from last year that does exactly that, ~~and which should be used instead of my hacks on Outline
.
https://github.com/imagej/imagej-ops/pull/624~~
but unfortunately that one is buggy and we should use #639 until we figure out a better multithreading strategy. Test and builds now pass and user operation works on my 40-core workstation.
I chose to use my own ExecutorService instead of ThreadService because at the time using a FixedThreadPool ran faster with a certain N than what ThreadService used
Fixes #637
ExecutorService
thread pools were being created but not cleanlyshutdown()
. Now they are properly terminated. Happy Friday 13th!