Commit 630e7e8a authored by Berenger Bramas's avatar Berenger Bramas
Browse files

Debug (forgot to allocate the right array for indexes)

parent 922db8ba
......@@ -580,6 +580,7 @@ public:
const partsize_t NbParticlesToReceive = descriptor.nbParticlesToExchange;
assert(NbParticlesToReceive != -1);
assert(descriptor.toCompute == nullptr);
assert(descriptor.indexes == nullptr);
if(NbParticlesToReceive){
descriptor.toCompute.reset(new real_number[NbParticlesToReceive*size_particle_positions]);
......@@ -590,7 +591,7 @@ public:
particles_utils::GetMpiType(real_number()), destProc, TAG_POSITION_PARTICLES,
current_com, &mpiRequests.back()));
descriptor.toCompute.reset(new real_number[NbParticlesToReceive*size_particle_positions]);
descriptor.indexes.reset(new partsize_t[NbParticlesToReceive]);
whatNext.emplace_back(std::pair<Action,int>{COMPUTE_PARTICLES, releasedAction.second});
mpiRequests.emplace_back();
assert(NbParticlesToReceive*size_particle_positions < std::numeric_limits<int>::max());
......@@ -615,6 +616,7 @@ public:
const partsize_t NbParticlesToReceive = descriptor.nbParticlesToExchange;
assert(descriptor.toCompute != nullptr);
assert(descriptor.indexes != nullptr);
descriptor.results.reset(new real_number[NbParticlesToReceive*size_particle_rhs]);
computer_thread.template init_result_array<size_particle_rhs>(descriptor.results.get(), NbParticlesToReceive);
......@@ -685,6 +687,7 @@ public:
particles_utils::GetMpiType(real_number()), destProc, TAG_RESULT_PARTICLES,
current_com, &mpiRequests.back()));
delete[] descriptor.toCompute.release();
delete[] descriptor.indexes.release();
}
}
//////////////////////////////////////////////////////////////////////
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment