diff --git a/src/amrex/space1d/__init__.py b/src/amrex/space1d/__init__.py index 6fac7643..0185e14f 100644 --- a/src/amrex/space1d/__init__.py +++ b/src/amrex/space1d/__init__.py @@ -32,3 +32,9 @@ # def d_decl(x, y, z): return (x,) + + +def Print(*args, **kwargs): + """Wrap amrex::Print() - only the IO processor writes""" + if ParallelDescriptor.IOProcessor(): + print(*args, **kwargs) diff --git a/src/amrex/space2d/__init__.py b/src/amrex/space2d/__init__.py index c30ed8c5..f21e915b 100644 --- a/src/amrex/space2d/__init__.py +++ b/src/amrex/space2d/__init__.py @@ -32,3 +32,9 @@ # def d_decl(x, y, z): return (x, y) + + +def Print(*args, **kwargs): + """Wrap amrex::Print() - only the IO processor writes""" + if ParallelDescriptor.IOProcessor(): + print(*args, **kwargs) diff --git a/src/amrex/space3d/__init__.py b/src/amrex/space3d/__init__.py index d8163ea8..eabf0fff 100644 --- a/src/amrex/space3d/__init__.py +++ b/src/amrex/space3d/__init__.py @@ -32,3 +32,9 @@ # def d_decl(x, y, z): return (x, y, z) + + +def Print(*args, **kwargs): + """Wrap amrex::Print() - only the IO processor writes""" + if ParallelDescriptor.IOProcessor(): + print(*args, **kwargs)