Parallel python image tests and PIO test
I was trying to add a new test for the PIO Reader, which would be a python script that generates an image in parallel, and then checks that image against a known standard. When I tried to add it, the test would hang and never complete. I debugged this, and the general flow is:
- Each rank creates an image of the data they have
- The images are composited on rank 0
- Each rank will perform the image test with the image they have
- Rank 0 will pass, and other ranks will fail
- Because of this divergence in execution, the test hangs and never completes
The odd thing is that this is how the current PIO test (<VTK dir>/IO/PIO/Testing/Python/TestPIOReader.py
) operates, and this test will complete and pass. So I looked into that, and when running two processes, the image on rank 1, which should be wrong, instead passes because the calculated image error is 0.
Below, the first image is the image on rank 1, and the next image is the reference image. I've also included a python script that will calculate the image error between the two, using the vtkImageDifference
class, which is what the VTK test framework uses.
If I use the script, the returned image error is 0.
image_diff.py vtkTesting-1.png TestPIOReader.png
Error: 0.0
Questions:
-
Is it possible to use a python script for a parallel image test? The only other tests in VTK that I found which generates an image in parallel are C++ tests.
-
Why do the above images have an image difference of 0?