From 6bfb411bf7507c7c06e58e02341441504b962249 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Widera?= Date: Wed, 7 Jan 2015 10:35:15 +0100 Subject: [PATCH] workaround of read hangs during restart - This is a workaround to avoid the bug that processes hangs if some call `DataCollector::read()` where elements to read is zero and the destination pointer for the read data is set to `NULL`. splash bug issu: https://github.com/ComputationalRadiationPhysics/libSplash/issues/148 --- .../hdf5/restart/LoadParticleAttributesFromHDF5.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/picongpu/include/plugins/hdf5/restart/LoadParticleAttributesFromHDF5.hpp b/src/picongpu/include/plugins/hdf5/restart/LoadParticleAttributesFromHDF5.hpp index 013db1a147..9bf01948b5 100644 --- a/src/picongpu/include/plugins/hdf5/restart/LoadParticleAttributesFromHDF5.hpp +++ b/src/picongpu/include/plugins/hdf5/restart/LoadParticleAttributesFromHDF5.hpp @@ -79,6 +79,17 @@ struct LoadParticleAttributesFromHDF5 ComponentType* tmpArray = NULL; if( elements > 0 ) tmpArray = new ComponentType[elements]; + else + { + /** This is a workaround to avoid the bug that processes hangs + * if some call `DataCollector::read()` where elements to read is + * zero and the destination pointer for the read data is set to `NULL`. + * see: - `PIconGPU` issu: https://github.com/ComputationalRadiationPhysics/picongpu/pull/611 + * - `libSplash` issu: https://github.com/ComputationalRadiationPhysics/libSplash/issues/148 + * \todo: please remove this workaround after the libsplash bug is fixed + */ + tmpArray = new ComponentType[1]; + } ParallelDomainCollector* dataCollector = params->dataCollector; for (uint32_t d = 0; d < components; d++)