Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/amrex/ParticleContainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def pc_to_df(self, local=True, comm=None, root_rank=0):
self : amrex.ParticleContainer_*
A ParticleContainer class in pyAMReX
local : bool
MPI-local particles
MPI rank-local particles only
comm : MPI Communicator
if local is False, this defaults to mpi4py.MPI.COMM_WORLD
root_rank : MPI root rank to gather to
Expand All @@ -31,6 +31,14 @@ def pc_to_df(self, local=True, comm=None, root_rank=0):
"""
import pandas as pd

# silently ignore local=False for non-MPI runs
if local is False:
from inspect import getmodule

amr = getmodule(self)
if not amr.Config.have_mpi:
local = True

# create a DataFrame per particle box and append it to the list of
# local DataFrame(s)
dfs_local = []
Expand Down