Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Volume Rendering Multiple Fields with MPI #4871

Closed
biboyd opened this issue Apr 5, 2024 · 1 comment · Fixed by #4877
Closed

Volume Rendering Multiple Fields with MPI #4871

biboyd opened this issue Apr 5, 2024 · 1 comment · Fixed by #4877
Milestone

Comments

@biboyd
Copy link
Contributor

biboyd commented Apr 5, 2024

Bug report

Bug summary

When creating a volume render with multiple fields, MPI parallelism only plots part of the second field. In this case we are plotting temperature (red) and density (blue). With 2 MPI procs, the render only saves half the density.

Code for reproduction

import yt
from yt.visualization.volume_rendering.transfer_function_helper import TransferFunctionHelper
from yt.visualization.volume_rendering.api import Scene, create_volume_source

yt.enable_parallelism()

ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")

# create scene and sources
sc = Scene()

source_temperature = create_volume_source(ds.all_data(), 'temperature')
source_density = create_volume_source(ds.all_data(), 'density')

#create transfer functions
tfh1 = TransferFunctionHelper(ds)
tfh1.set_field('temperature')
tfh1.set_bounds((1e3, 1e7))
tfh1.build_transfer_function()
tfh1.tf.add_layers(6, colormap="Reds")
source_temperature.transfer_function = tfh1.tf

tfh2 = TransferFunctionHelper(ds)
tfh2.set_field('density')
tfh2.set_bounds((1e-30, 1e-26))
tfh2.build_transfer_function()
tfh2.tf.add_layers(6, colormap="Blues")
source_density.transfer_function = tfh2.tf

# add sources to scene
sc.add_source(source_temperature)
sc.add_source(source_density)

# add camera
sc.add_camera(ds)
sc.camera.width = (400, "kpc")

#render/save
sc.save("render.png", sigma_clip=4)

Actual outcome
When run with 2 procs

$ mpirun -np 2 python test.py

image

Expected outcome
When run without MPI

$ python test.py

image

Version Information

  • Operating System: Ubuntu 22.04.4 LTS
  • Python Version: 3.11.2
  • yt version: 4.3
  • Other Libraries (if applicable): Open MPI 4.1.2, mpi4py 3.1.5

yt installed via pip

@chrishavlin
Copy link
Contributor

chrishavlin commented Apr 9, 2024

Thanks for the report!

Might be a duplicate of #2622 though it's interesting in your case that it happens only when rendering multiple fields.

EDIT: not a duplicate.

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

Successfully merging a pull request may close this issue.

3 participants