Skip to content

Commit

Permalink
Remove special treatment of particle patches in pipe
Browse files Browse the repository at this point in the history
  • Loading branch information
franzpoeschel committed Jun 6, 2024
1 parent 8797975 commit eaae4b1
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions src/binding/python/openpmd_api/pipe/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,28 +166,6 @@ def __init__(self, source, dynamicView, offset, extent):
self.extent = extent


class particle_patch_load:
"""
A deferred load/store operation for a particle patch.
Our particle-patch API requires that users pass a concrete value for
storing, even if the actual write operation occurs much later at
series.flush().
So, unlike other record components, we cannot call .store_chunk() with
a buffer that has not yet been filled, but must wait until the point where
we actual have the data at hand already.
In short: calling .store() must be deferred, until the data has been fully
read from the sink.
This class stores the needed parameters to .store().
"""
def __init__(self, data, dest):
self.data = data
self.dest = dest

def run(self):
for index, item in enumerate(self.data):
self.dest.store(index, item)


class pipe:
"""
Represents the configuration of one "pipe" pass.
Expand Down Expand Up @@ -292,7 +270,6 @@ def __copy(self, src, dest, current_path="/data/"):
print("\t {0}".format(r))
out_iteration = write_iterations[in_iteration.iteration_index]
sys.stdout.flush()
self.__particle_patches = []
self.__copy(
in_iteration, out_iteration,
current_path + str(in_iteration.iteration_index) + "/")
Expand All @@ -301,10 +278,6 @@ def __copy(self, src, dest, current_path="/data/"):
deferred.dynamicView.current_buffer(), deferred.offset,
deferred.extent)
in_iteration.close()
for patch_load in self.__particle_patches:
patch_load.run()
out_iteration.close()
self.__particle_patches.clear()
self.loads.clear()
sys.stdout.flush()
elif isinstance(src, io.Record_Component) and (not is_container
Expand Down Expand Up @@ -333,12 +306,6 @@ def __copy(self, src, dest, current_path="/data/"):
self.loads.append(
deferred_load(src, span, local_chunk.offset,
local_chunk.extent))
elif isinstance(src, io.Patch_Record_Component) and (not is_container
or src.scalar):
dest.reset_dataset(io.Dataset(src.dtype, src.shape))
if self.comm.rank == 0:
self.__particle_patches.append(
particle_patch_load(src.load(), dest))
elif isinstance(src, io.Iteration):
self.__copy(src.meshes, dest.meshes, current_path + "meshes/")
self.__copy(src.particles, dest.particles,
Expand Down

0 comments on commit eaae4b1

Please sign in to comment.