diff --git a/runtime/domain/ParticleDataHandling.hpp b/runtime/domain/ParticleDataHandling.hpp index 490b0b39b897491e3b71cb5f31e471b9be52ea9b..7636fdf514926a37220fedc051e03a2145bffc81 100644 --- a/runtime/domain/ParticleDataHandling.hpp +++ b/runtime/domain/ParticleDataHandling.hpp @@ -175,14 +175,16 @@ public: void deserializeImpl(IBlock *const, const BlockDataID&, mpi::RecvBuffer& buffer) { int nlocal = ps->getTrackedVariableAsInteger("nlocal"); + int particle_capacity = ps->getTrackedVariableAsInteger("particle_capacity"); real_t real_tmp; int int_tmp; uint_t nrecv; buffer >> nrecv; - // TODO: Check if there is enough particle capacity for the new particles - // md_resize_recv_buffer_capacity((int) nparticles); + // TODO: Check if there is enough particle capacity for the new particles, when there is not, + // all properties and arrays which have particle_capacity as one of their dimensions must be reallocated + PAIRS_ASSERT(nlocal + nrecv < particle_capacity); for(int i = 0; i < nrecv; ++i) { for(auto &prop: ps->getProperties()) {