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

Add amrex::Print() Like Function #174

Merged
merged 3 commits into from
Aug 15, 2023
Merged

Conversation

ax3l
Copy link
Member

@ax3l ax3l commented Aug 11, 2023

Add amr.Print(...) that behaves like Python's print(), but only prints on the AMReX IOProcessor.

  • add a test

Add `amr.Print(...)` that behaves like Python's `print()`,
but only prints on the AMReX IOProcessor.

def Print(*args, **kwargs):
"""Wrap amrex::Print() - only the IO processor writes"""
if ParallelDescriptor.IOProcessor():
Copy link
Member Author

Choose a reason for hiding this comment

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

These bindings to ParallelProcessor segfault if they are called before AMReX initialize.

I wonder if we should either in AMReX or at least in pyAMReX add a test for amrex::initialized and then do something cleaner (throw or all print).

Copy link
Member Author

Choose a reason for hiding this comment

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

pushed an update

@ax3l ax3l merged commit 8afc221 into AMReX-Codes:development Aug 15, 2023
15 checks passed
@ax3l ax3l deleted the amrex-print branch August 15, 2023 22:30
@ax3l ax3l mentioned this pull request Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants