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

Old MF Wrapper: Warn of no CuPy #5585

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

ax3l
Copy link
Member

@ax3l ax3l commented Jan 22, 2025

There is an old code path that does not warn when it implicitly hopes that managed memory is enabled. This adds a warning.

In general, we should use the new pyAMReX-ported MultiFabWrapper, which is safer to use.

There is an old code path that does not warn when it
implicitly hopes that managed memory is enabled. This
adds a warning.

In general, we should use the new pyAMReX-ported MultiFabWrapper,
which is safer to use.
@ax3l ax3l added backend: cuda Specific to CUDA execution (GPUs) component: Python Python layer labels Jan 22, 2025
@ax3l ax3l requested review from dpgrote and RemiLehe January 22, 2025 00:28
Copy link
Member

@roelof-groenewald roelof-groenewald left a comment

Choose a reason for hiding this comment

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

To avoid the (albeit very small) overhead of executing load_cupy each time _get_field is called, self.cupy_status could instead be set during the _MultiFABWrapper initialization, and in the block that relies on managed memory we can then simply add

libwarpx.amr.Print(self.cupy_status)

What do you think?

@dpgrote
Copy link
Member

dpgrote commented Jan 24, 2025

Note that this code is deleted in PR #5407. If that PR is merged, then this PR is not needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend: cuda Specific to CUDA execution (GPUs) component: Python Python layer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants