yt icon indicating copy to clipboard operation
yt copied to clipboard

BUG: MPI Volume Rendering Example

Open cbyrohl opened this issue 4 years ago • 1 comments

Bug report

Apologies, not sure whether this is a bug or it's just a minimal example for MPI volume rendering lacking. Trying to parallelize rendering in yt with MPI leaves me with only one of the spatial MPI domains being plotted, see below.

The documentation on volume rendering (https://yt-project.org/doc/visualizing/volume_rendering.html#volume-rendering) refers to another page for parallelization (https://yt-project.org/doc/analyzing/parallel_computation.html). Using the recipe for parallel projection plots given there, would make me guess just to add a "yt.enable_parallelism()" to the code.

An MPI volume rendering example in the documentation would be great. This would probably also fix my issue #2620.

Code for reproduction

# example_MPI.py
import yt
yt.enable_parallelism()
ds = yt.load("Sedov_3d/sedov_hdf5_chk_0001")
im, sc = yt.volume_render(ds, field=('gas', 'density'))
$ export OMP_NUM_THREADS=1
$ mpirun -n 8 python example_MPI.py

Actual outcome

Log
yt : [INFO     ] 2020-06-09 10:56:08,454 Global parallel computation enabled: 1 / 8
yt : [INFO     ] 2020-06-09 10:56:08,453 Global parallel computation enabled: 2 / 8
yt : [INFO     ] 2020-06-09 10:56:08,453 Global parallel computation enabled: 5 / 8
yt : [INFO     ] 2020-06-09 10:56:08,455 Global parallel computation enabled: 0 / 8
yt : [INFO     ] 2020-06-09 10:56:08,454 Global parallel computation enabled: 7 / 8
yt : [INFO     ] 2020-06-09 10:56:08,456 Global parallel computation enabled: 3 / 8
yt : [INFO     ] 2020-06-09 10:56:08,456 Global parallel computation enabled: 4 / 8
yt : [INFO     ] 2020-06-09 10:56:08,456 Global parallel computation enabled: 6 / 8
P002 yt : [INFO     ] 2020-06-09 10:56:08,463 Particle file found: sedov_hdf5_chk_0001
P005 yt : [INFO     ] 2020-06-09 10:56:08,463 Particle file found: sedov_hdf5_chk_0001
P007 yt : [INFO     ] 2020-06-09 10:56:08,464 Particle file found: sedov_hdf5_chk_0001
P001 yt : [INFO     ] 2020-06-09 10:56:08,465 Particle file found: sedov_hdf5_chk_0001
P004 yt : [INFO     ] 2020-06-09 10:56:08,468 Particle file found: sedov_hdf5_chk_0001
P006 yt : [INFO     ] 2020-06-09 10:56:08,468 Particle file found: sedov_hdf5_chk_0001
P003 yt : [INFO     ] 2020-06-09 10:56:08,469 Particle file found: sedov_hdf5_chk_0001
P000 yt : [INFO     ] 2020-06-09 10:56:08,470 Particle file found: sedov_hdf5_chk_0001
P000 yt : [INFO     ] 2020-06-09 10:56:08,496 Parameters: current_time              = 0.010079017707954174
P000 yt : [INFO     ] 2020-06-09 10:56:08,496 Parameters: domain_dimensions         = [8 8 8]
P000 yt : [INFO     ] 2020-06-09 10:56:08,496 Parameters: domain_left_edge          = [0. 0. 0.]
P000 yt : [INFO     ] 2020-06-09 10:56:08,496 Parameters: domain_right_edge         = [1. 1. 1.]
P000 yt : [INFO     ] 2020-06-09 10:56:08,496 Parameters: cosmological_simulation   = 0.0
P003 yt : [INFO     ] 2020-06-09 10:56:09,203 Rendering scene (Can take a while).
P000 yt : [INFO     ] 2020-06-09 10:56:09,205 Rendering scene (Can take a while).
P004 yt : [INFO     ] 2020-06-09 10:56:09,205 Rendering scene (Can take a while).
P007 yt : [INFO     ] 2020-06-09 10:56:09,209 Rendering scene (Can take a while).
P003 yt : [INFO     ] 2020-06-09 10:56:09,218 Creating volume
P000 yt : [INFO     ] 2020-06-09 10:56:09,220 Creating volume
P004 yt : [INFO     ] 2020-06-09 10:56:09,220 Creating volume
P001 yt : [INFO     ] 2020-06-09 10:56:09,221 Rendering scene (Can take a while).
P006 yt : [INFO     ] 2020-06-09 10:56:09,222 Rendering scene (Can take a while).
P007 yt : [INFO     ] 2020-06-09 10:56:09,224 Creating volume
P001 yt : [INFO     ] 2020-06-09 10:56:09,235 Creating volume
P006 yt : [INFO     ] 2020-06-09 10:56:09,236 Creating volume
P005 yt : [INFO     ] 2020-06-09 10:56:09,242 Rendering scene (Can take a while).
P002 yt : [INFO     ] 2020-06-09 10:56:09,252 Rendering scene (Can take a while).
P005 yt : [INFO     ] 2020-06-09 10:56:09,255 Creating volume
P002 yt : [INFO     ] 2020-06-09 10:56:09,265 Creating volume
P004 yt : [INFO     ] 2020-06-09 10:56:09,583 Creating transfer function
P004 yt : [INFO     ] 2020-06-09 10:56:09,584 Calculating data bounds. This may take a while.  Set the TransferFunctionHelper.bounds to avoid this.
P000 yt : [INFO     ] 2020-06-09 10:56:09,594 Creating transfer function
P000 yt : [INFO     ] 2020-06-09 10:56:09,594 Calculating data bounds. This may take a while.  Set the TransferFunctionHelper.bounds to avoid this.
P007 yt : [INFO     ] 2020-06-09 10:56:09,596 Creating transfer function
P007 yt : [INFO     ] 2020-06-09 10:56:09,596 Calculating data bounds. This may take a while.  Set the TransferFunctionHelper.bounds to avoid this.
P003 yt : [INFO     ] 2020-06-09 10:56:09,596 Creating transfer function
P003 yt : [INFO     ] 2020-06-09 10:56:09,596 Calculating data bounds. This may take a while.  Set the TransferFunctionHelper.bounds to avoid this.
P006 yt : [INFO     ] 2020-06-09 10:56:09,610 Creating transfer function
P006 yt : [INFO     ] 2020-06-09 10:56:09,611 Calculating data bounds. This may take a while.  Set the TransferFunctionHelper.bounds to avoid this.
P001 yt : [INFO     ] 2020-06-09 10:56:09,616 Creating transfer function
P001 yt : [INFO     ] 2020-06-09 10:56:09,616 Calculating data bounds. This may take a while.  Set the TransferFunctionHelper.bounds to avoid this.
P005 yt : [INFO     ] 2020-06-09 10:56:09,646 Creating transfer function
P005 yt : [INFO     ] 2020-06-09 10:56:09,647 Calculating data bounds. This may take a while.  Set the TransferFunctionHelper.bounds to avoid this.
P002 yt : [INFO     ] 2020-06-09 10:56:09,658 Creating transfer function
P002 yt : [INFO     ] 2020-06-09 10:56:09,659 Calculating data bounds. This may take a while.  Set the TransferFunctionHelper.bounds to avoid this.
P000 yt : [INFO     ] 2020-06-09 10:56:10,723 Rendering scene (Can take a while).
P001 yt : [INFO     ] 2020-06-09 10:56:10,723 Rendering scene (Can take a while).
P007 yt : [INFO     ] 2020-06-09 10:56:10,723 Rendering scene (Can take a while).
P003 yt : [INFO     ] 2020-06-09 10:56:10,724 Rendering scene (Can take a while).
P002 yt : [INFO     ] 2020-06-09 10:56:10,724 Rendering scene (Can take a while).
P005 yt : [INFO     ] 2020-06-09 10:56:10,724 Rendering scene (Can take a while).
P004 yt : [INFO     ] 2020-06-09 10:56:10,724 Rendering scene (Can take a while).
P006 yt : [INFO     ] 2020-06-09 10:56:10,724 Rendering scene (Can take a while).
P001 yt : [INFO     ] 2020-06-09 10:56:11,743 Saving render sedov_hdf5_chk_0001_Render_density.png
P000 yt : [INFO     ] 2020-06-09 10:56:11,744 Saving render sedov_hdf5_chk_0001_Render_density.png
P003 yt : [INFO     ] 2020-06-09 10:56:11,744 Saving render sedov_hdf5_chk_0001_Render_density.png
P002 yt : [INFO     ] 2020-06-09 10:56:11,744 Saving render sedov_hdf5_chk_0001_Render_density.png
P007 yt : [INFO     ] 2020-06-09 10:56:11,744 Saving render sedov_hdf5_chk_0001_Render_density.png
P004 yt : [INFO     ] 2020-06-09 10:56:11,744 Saving render sedov_hdf5_chk_0001_Render_density.png
P005 yt : [INFO     ] 2020-06-09 10:56:11,744 Saving render sedov_hdf5_chk_0001_Render_density.png
P006 yt : [INFO     ] 2020-06-09 10:56:11,744 Saving render sedov_hdf5_chk_0001_Render_density.png

8proc

Expected outcome

(obtained with a single MPI process)

$ OMP_NUM_THREADS=1
$ mpirun -n 1 python example_MPI.py

1proc

Version Information

  • Operating System: SUSE Linux Enterprise Server 15 SP1
  • Python Version: 3.7
  • yt version: github dev

cbyrohl avatar Jun 09 '20 09:06 cbyrohl