Skip to content

Commit

Permalink
Use discard strategy as second run, only consider my own hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
Franz Poeschel committed Jul 14, 2023
1 parent bfedd9c commit f63e639
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/binding/python/openpmd_api/pipe/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ def distribution_strategy(dataset_extent,
mpi_rank, mpi_size)
elif strategy_identifier == 'fail':
return io.FailingStrategy()
elif strategy_identifier == 'discard':
return io.DiscardingStrategy()
else:
raise RuntimeError("Unknown distribution strategy: " +
strategy_identifier)
Expand All @@ -240,6 +242,8 @@ def __init__(self, infile, outfile, inconfig, outconfig, comm):
if HAVE_MPI:
hostinfo = io.HostInfo.HOSTNAME
self.outranks = hostinfo.get_collective(self.comm)
my_hostname = self.outranks[self.comm.rank]
self.outranks = {i: rank for i, rank in self.outranks.items() if rank == my_hostname}
else:
self.outranks = {i: str(i) for i in range(self.comm.size)}

Expand Down

0 comments on commit f63e639

Please sign in to comment.