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
franzpoeschel committed Dec 12, 2023
1 parent 7dae35e commit 66c5568
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 @@ -242,6 +244,8 @@ def __init__(self, infile, outfile, inconfig, outconfig, comm):
if io.HostInfo.POSIX_HOSTNAME.available()\
else io.HostInfo.MPI_PROCESSOR_NAME
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 66c5568

Please sign in to comment.