diff --git a/bfps/cpp/particles/abstract_particles_output.hpp b/bfps/cpp/particles/abstract_particles_output.hpp index 98ad52e9bcf25388d75d4abde14a9c5cd7d757c9..5285c90fe156ac92335141f3c75f02a057e9bbea 100644 --- a/bfps/cpp/particles/abstract_particles_output.hpp +++ b/bfps/cpp/particles/abstract_particles_output.hpp @@ -133,20 +133,14 @@ public: } void releaseMemory(){ - delete[] buffer_indexes_send.get(); buffer_indexes_send.release(); - delete[] buffer_particles_positions_send.get(); buffer_particles_positions_send.release(); size_buffers_send = -1; - delete[] buffer_indexes_recv.get(); buffer_indexes_recv.release(); - delete[] buffer_particles_positions_recv.get(); buffer_particles_positions_recv.release(); size_buffers_recv = -1; for(int idx_rhs = 0 ; idx_rhs < nb_rhs ; ++idx_rhs){ - delete[] buffer_particles_rhs_send.get(); buffer_particles_rhs_send[idx_rhs].release(); - delete[] buffer_particles_rhs_recv.get(); buffer_particles_rhs_recv[idx_rhs].release(); } } diff --git a/bfps/cpp/particles/particles_distr_mpi.hpp b/bfps/cpp/particles/particles_distr_mpi.hpp index 917e540b26ada7e64f321e8da61e7e3e85e17daa..e6babb794f0fe21194424b89b6900a50f289b13e 100644 --- a/bfps/cpp/particles/particles_distr_mpi.hpp +++ b/bfps/cpp/particles/particles_distr_mpi.hpp @@ -282,7 +282,7 @@ public: if(descriptor.nbParticlesToSend){ whatNext.emplace_back(std::pair<Action,int>{NOTHING_TODO, -1}); - mpiRequests.emplace_back(); + mpiRequests.emplace_back(); assert(descriptor.nbParticlesToSend*size_particle_positions < std::numeric_limits<int>::max()); AssertMpi(MPI_Isend(const_cast<real_number*>(&particles_positions[(current_offset_particles_for_partition[current_partition_size-descriptor.nbPartitionsToSend])*size_particle_positions]), int(descriptor.nbParticlesToSend*size_particle_positions), particles_utils::GetMpiType(real_number()), @@ -406,7 +406,7 @@ public: const int destProc = descriptor.destProc; whatNext.emplace_back(std::pair<Action,int>{RELEASE_BUFFER_PARTICLES, releasedAction.second}); mpiRequests.emplace_back(); - const int tag = descriptor.isLower? TAG_LOW_UP_RESULTS : TAG_UP_LOW_RESULTS; + const int tag = descriptor.isLower? TAG_LOW_UP_RESULTS : TAG_UP_LOW_RESULTS; assert(NbParticlesToReceive*size_particle_rhs < std::numeric_limits<int>::max()); AssertMpi(MPI_Isend(descriptor.results.get(), int(NbParticlesToReceive*size_particle_rhs), particles_utils::GetMpiType(real_number()), destProc, tag, current_com, &mpiRequests.back())); @@ -430,7 +430,6 @@ public: TIMEZONE("reduce"); assert(descriptor.toRecvAndMerge != nullptr); in_computer.template reduce_particles_rhs<size_particle_rhs>(&particles_current_rhs[0], descriptor.toRecvAndMerge.get(), descriptor.nbParticlesToSend); - delete[] descriptor.toRecvAndMerge.get(); descriptor.toRecvAndMerge.release(); } else { @@ -438,7 +437,6 @@ public: assert(descriptor.toRecvAndMerge != nullptr); in_computer.template reduce_particles_rhs<size_particle_rhs>(&particles_current_rhs[(current_offset_particles_for_partition[current_partition_size]-descriptor.nbParticlesToSend)*size_particle_rhs], descriptor.toRecvAndMerge.get(), descriptor.nbParticlesToSend); - delete[] descriptor.toRecvAndMerge.get(); descriptor.toRecvAndMerge.release(); } } @@ -606,7 +604,7 @@ public: if(nbOutLower){ whatNext.emplace_back(std::pair<Action,int>{NOTHING_TODO, -1}); - mpiRequests.emplace_back(); + mpiRequests.emplace_back(); assert(nbOutLower*size_particle_positions < std::numeric_limits<int>::max()); AssertMpi(MPI_Isend(&(*inout_positions_particles)[0], int(nbOutLower*size_particle_positions), particles_utils::GetMpiType(real_number()), (my_rank-1+nb_processes_involved)%nb_processes_involved, TAG_LOW_UP_MOVED_PARTICLES, MPI_COMM_WORLD, &mpiRequests.back())); @@ -796,11 +794,6 @@ public: } myTotalNbParticles = myTotalNewNbParticles; - // clean up - for(int idx_rhs = 0 ; idx_rhs < in_nb_rhs ; ++idx_rhs){ - delete[] newArrayRhs[idx_rhs].get(); - newArrayRhs[idx_rhs].release(); - } } // Partitions all particles diff --git a/bfps/cpp/particles/particles_input_hdf5.hpp b/bfps/cpp/particles/particles_input_hdf5.hpp index 9e65e1aeb7567bd80e7694087b3961d1c978c9e3..32cfec05ad854cd7f3ffd88d771418d0552237d8 100644 --- a/bfps/cpp/particles/particles_input_hdf5.hpp +++ b/bfps/cpp/particles/particles_input_hdf5.hpp @@ -256,12 +256,10 @@ public: my_particles_positions.reset(new real_number[exchanger.getTotalToRecv()*size_particle_positions]); exchanger.alltoallv<real_number>(split_particles_positions.get(), my_particles_positions.get(), size_particle_positions); - delete[] split_particles_positions.get(); split_particles_positions.release(); my_particles_indexes.reset(new partsize_t[exchanger.getTotalToRecv()]); exchanger.alltoallv<partsize_t>(split_particles_indexes.get(), my_particles_indexes.get()); - delete[] split_particles_indexes.get(); split_particles_indexes.release(); my_particles_rhs.resize(nb_rhs); diff --git a/bfps/cpp/particles/particles_system.hpp b/bfps/cpp/particles/particles_system.hpp index 2a9b506529453ff68ee555916559ad0858c4ffb5..081f4b4b7315c309638890d51d82e47d3c1033bd 100644 --- a/bfps/cpp/particles/particles_system.hpp +++ b/bfps/cpp/particles/particles_system.hpp @@ -76,10 +76,6 @@ public: } ~particles_system(){ - delete[] current_my_nb_particles_per_partition.get(); - current_my_nb_particles_per_partition.release(); - delete[] current_offset_particles_for_partition.get(); - current_offset_particles_for_partition.release(); } void init(abstract_particles_input<partsize_t, real_number>& particles_input) {