Skip to content

Commit

Permalink
amr.Print(): Fallback to All if not Init
Browse files Browse the repository at this point in the history
and warn
  • Loading branch information
ax3l committed Aug 15, 2023
1 parent 103ae7f commit e947318
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/amrex/space1d/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,8 @@ def d_decl(x, y, z):

def Print(*args, **kwargs):
"""Wrap amrex::Print() - only the IO processor writes"""
if ParallelDescriptor.IOProcessor():
if not initialized():
print("warning: Print all - AMReX not initialized")
print(*args, **kwargs)
elif ParallelDescriptor.IOProcessor():
print(*args, **kwargs)
5 changes: 4 additions & 1 deletion src/amrex/space2d/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,8 @@ def d_decl(x, y, z):

def Print(*args, **kwargs):
"""Wrap amrex::Print() - only the IO processor writes"""
if ParallelDescriptor.IOProcessor():
if not initialized():
print("warning: Print all - AMReX not initialized")
print(*args, **kwargs)
elif ParallelDescriptor.IOProcessor():
print(*args, **kwargs)
5 changes: 4 additions & 1 deletion src/amrex/space3d/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,8 @@ def d_decl(x, y, z):

def Print(*args, **kwargs):
"""Wrap amrex::Print() - only the IO processor writes"""
if ParallelDescriptor.IOProcessor():
if not initialized():
print("warning: Print all - AMReX not initialized")
print(*args, **kwargs)
elif ParallelDescriptor.IOProcessor():
print(*args, **kwargs)

0 comments on commit e947318

Please sign in to comment.