From 66c5568b5678db9d9e0e9bb9eaba4cc66205e9e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20P=C3=B6schel?= Date: Fri, 14 Jul 2023 14:55:10 +0200 Subject: [PATCH] Use discard strategy as second run, only consider my own hostname --- src/binding/python/openpmd_api/pipe/__main__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/binding/python/openpmd_api/pipe/__main__.py b/src/binding/python/openpmd_api/pipe/__main__.py index 1dd77aa0f8..1840f53dcc 100644 --- a/src/binding/python/openpmd_api/pipe/__main__.py +++ b/src/binding/python/openpmd_api/pipe/__main__.py @@ -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) @@ -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)}