diff --git a/bfps/cpp/particles/abstract_particles_distr.hpp b/bfps/cpp/particles/abstract_particles_distr.hpp index 7fe0cea317f94c047f5878fb1700792a94f267e1..d6ca43a2fef4db3ed58c1e058d70c8133ca223fa 100644 --- a/bfps/cpp/particles/abstract_particles_distr.hpp +++ b/bfps/cpp/particles/abstract_particles_distr.hpp @@ -122,9 +122,6 @@ public: for(int idx_proc_involved = 0 ; idx_proc_involved < nb_processes_involved ; ++idx_proc_involved){ assert(partition_interval_size_per_proc[idx_proc_involved] != 0); } - - DEBUG_MSG("[%d] %d processes involved over %d total processes\n", - my_rank, nb_processes_involved,nb_processes); } virtual ~abstract_particles_distr(){} @@ -216,16 +213,11 @@ public: const int nbProcToRecvUpper = neigDescriptors.size()-nbProcToRecvLower; const int nbProcToRecv = nbProcToRecvUpper + nbProcToRecvLower; assert(int(neigDescriptors.size()) == nbProcToRecv); - DEBUG_MSG("[%d] nbProcToRecvUpper %d\n", my_rank, nbProcToRecvUpper); - DEBUG_MSG("[%d] nbProcToRecvLower %d\n", my_rank, nbProcToRecvLower); - DEBUG_MSG("[%d] nbProcToRecv %d\n", my_rank, nbProcToRecv); for(int idxDescr = 0 ; idxDescr < int(neigDescriptors.size()) ; ++idxDescr){ NeighborDescriptor& descriptor = neigDescriptors[idxDescr]; if(descriptor.isLower){ - DEBUG_MSG("[%d] Send idxLower %d -- nbPartitionsToSend %d -- nbParticlesToSend %d\n", - my_rank, descriptor.idxLowerUpper, descriptor.nbPartitionsToSend, descriptor.nbParticlesToSend); whatNext.emplace_back(std::pair<Action,int>{NOTHING_TODO, -1}); mpiRequests.emplace_back(); AssertMpi(MPI_Isend(const_cast<int*>(&descriptor.nbParticlesToSend), 1, MPI_INT, descriptor.destProc, TAG_LOW_UP_NB_PARTICLES, @@ -252,8 +244,6 @@ public: current_com, &mpiRequests.back())); } else{ - DEBUG_MSG("[%d] Send idxUpper %d -- nbPartitionsToSend %d -- nbParticlesToSend %d\n", - my_rank, descriptor.idxLowerUpper, descriptor.nbPartitionsToSend, descriptor.nbParticlesToSend); whatNext.emplace_back(std::pair<Action,int>{NOTHING_TODO, -1}); mpiRequests.emplace_back(); AssertMpi(MPI_Isend(const_cast<int*>(&descriptor.nbParticlesToSend), 1, MPI_INT, descriptor.destProc, TAG_UP_LOW_NB_PARTICLES, @@ -299,18 +289,15 @@ public: /// Data to exchange particles ////////////////////////////////////////////////////////////////////// if(releasedAction.first == RECV_PARTICLES){ - DEBUG_MSG("[%d] RECV_PARTICLES\n", my_rank); NeighborDescriptor& descriptor = neigDescriptors[releasedAction.second]; if(descriptor.isLower){ - const int idxLower = descriptor.idxLowerUpper; + //const int idxLower = descriptor.idxLowerUpper; const int destProc = descriptor.destProc; - const int nbPartitionsToRecv = descriptor.nbPartitionsToRecv; + //const int nbPartitionsToRecv = descriptor.nbPartitionsToRecv; const int NbParticlesToReceive = descriptor.nbParticlesToRecv; assert(NbParticlesToReceive != -1); assert(descriptor.toCompute == nullptr); - DEBUG_MSG("[%d] Recv idxLower %d -- nbPartitionsToRecv %d -- NbParticlesToReceive %d\n", - my_rank, idxLower, nbPartitionsToRecv, NbParticlesToReceive); if(NbParticlesToReceive){ descriptor.toCompute.reset(new real_number[NbParticlesToReceive*size_particle_positions]); whatNext.emplace_back(std::pair<Action,int>{COMPUTE_PARTICLES, releasedAction.second}); @@ -320,14 +307,12 @@ public: } } else{ - const int idxUpper = descriptor.idxLowerUpper; + //const int idxUpper = descriptor.idxLowerUpper; const int destProc = descriptor.destProc; - const int nbPartitionsToRecv = descriptor.nbPartitionsToRecv; + //const int nbPartitionsToRecv = descriptor.nbPartitionsToRecv; const int NbParticlesToReceive = descriptor.nbParticlesToRecv; assert(NbParticlesToReceive != -1); assert(descriptor.toCompute == nullptr); - DEBUG_MSG("[%d] Recv idxUpper %d -- nbPartitionsToRecv %d -- NbParticlesToReceive %d\n", - my_rank, idxUpper, nbPartitionsToRecv, NbParticlesToReceive); if(NbParticlesToReceive){ descriptor.toCompute.reset(new real_number[NbParticlesToReceive*size_particle_positions]); whatNext.emplace_back(std::pair<Action,int>{COMPUTE_PARTICLES, releasedAction.second}); @@ -342,7 +327,6 @@ public: /// Computation ////////////////////////////////////////////////////////////////////// if(releasedAction.first == COMPUTE_PARTICLES){ - DEBUG_MSG("[%d] COMPUTE_PARTICLES\n", my_rank); NeighborDescriptor& descriptor = neigDescriptors[releasedAction.second]; const int NbParticlesToReceive = descriptor.nbParticlesToRecv; @@ -362,7 +346,6 @@ public: /// Computation ////////////////////////////////////////////////////////////////////// if(releasedAction.first == RELEASE_BUFFER_PARTICLES){ - DEBUG_MSG("[%d] RELEASE_BUFFER_PARTICLES\n", my_rank); NeighborDescriptor& descriptor = neigDescriptors[releasedAction.second]; assert(descriptor.toCompute != nullptr); descriptor.toCompute.release(); @@ -371,18 +354,15 @@ public: /// Merge ////////////////////////////////////////////////////////////////////// if(releasedAction.first == MERGE_PARTICLES){ - DEBUG_MSG("[%d] MERGE_PARTICLES\n", my_rank); NeighborDescriptor& descriptor = neigDescriptors[releasedAction.second]; if(descriptor.isLower){ - DEBUG_MSG("[%d] low buffer received\n", my_rank); TIMEZONE("reduce"); assert(descriptor.toRecvAndMerge != nullptr); reduce_particles(&particles_positions[0], &particles_current_rhs[0], descriptor.toRecvAndMerge.get(), descriptor.nbParticlesToSend); descriptor.toRecvAndMerge.release(); } else { - DEBUG_MSG("[%d] up buffer received\n", my_rank); TIMEZONE("reduce"); assert(descriptor.toRecvAndMerge != nullptr); reduce_particles(&particles_positions[(current_offset_particles_for_partition[current_partition_size]-descriptor.nbParticlesToSend)*size_particle_positions], @@ -463,8 +443,6 @@ public: } } }); - DEBUG_MSG("[%d] nbOutLower %d\n", my_rank, nbOutLower); - const int offesetOutLow = (current_partition_size==1? nbOutLower : 0); const int nbOutUpper = current_my_nb_particles_per_partition[current_partition_size-1] - offesetOutLow - particles_utils::partition_extra<size_particle_positions>( @@ -486,7 +464,6 @@ public: } } }, (current_offset_particles_for_partition[current_partition_size-1]+offesetOutLow)); - DEBUG_MSG("[%d] nbOutUpper %d\n", my_rank, nbOutUpper); // Exchange number int eventsBeforeWaitall = 0; @@ -563,13 +540,10 @@ public: } while(mpiRequests.size() && eventsBeforeWaitall){ - DEBUG_MSG("eventsBeforeWaitall %d\n", eventsBeforeWaitall); - int idxDone = mpiRequests.size(); { TIMEZONE("waitany_move"); AssertMpi(MPI_Waitany(mpiRequests.size(), mpiRequests.data(), &idxDone, MPI_STATUSES_IGNORE)); - DEBUG_MSG("MPI_Waitany eventsBeforeWaitall %d\n", eventsBeforeWaitall); } const std::pair<Action, int> releasedAction = whatNext[idxDone]; std::swap(mpiRequests[idxDone], mpiRequests[mpiRequests.size()-1]); @@ -578,8 +552,6 @@ public: whatNext.pop_back(); if(releasedAction.first == RECV_MOVE_NB_LOW){ - DEBUG_MSG("[%d] nbNewFromLow %d from %d\n", my_rank, nbNewFromLow, (my_rank-1+nb_processes_involved)%nb_processes_involved); - if(nbNewFromLow){ assert(newParticlesLow == nullptr); newParticlesLow.reset(new real_number[nbNewFromLow*size_particle_positions]); @@ -605,8 +577,6 @@ public: eventsBeforeWaitall -= 1; } else if(releasedAction.first == RECV_MOVE_NB_UP){ - DEBUG_MSG("[%d] nbNewFromUp %d from %d\n", my_rank, nbNewFromUp, (my_rank+1)%nb_processes_involved); - if(nbNewFromUp){ assert(newParticlesUp == nullptr); newParticlesUp.reset(new real_number[nbNewFromUp*size_particle_positions]); @@ -635,7 +605,6 @@ public: } if(mpiRequests.size()){ - DEBUG_MSG("MPI_Waitall\n"); // TODO Proceed when received TIMEZONE("waitall-move"); AssertMpi(MPI_Waitall(mpiRequests.size(), mpiRequests.data(), MPI_STATUSES_IGNORE)); @@ -662,9 +631,6 @@ public: const int nbOldParticlesInside = myTotalNbParticles - nbOutLower - nbOutUpper; const int myTotalNewNbParticles = nbOldParticlesInside + nbNewFromLow + nbNewFromUp; - DEBUG_MSG("[%d] nbOldParticlesInside %d\n", my_rank, nbOldParticlesInside); - DEBUG_MSG("[%d] myTotalNewNbParticles %d\n", my_rank, myTotalNewNbParticles); - std::unique_ptr<real_number[]> newArray(new real_number[myTotalNewNbParticles*size_particle_positions]); std::unique_ptr<int[]> newArrayIndexes(new int[myTotalNewNbParticles]); std::vector<std::unique_ptr<real_number[]>> newArrayRhs(in_nb_rhs); diff --git a/bfps/cpp/particles/abstract_particles_output.hpp b/bfps/cpp/particles/abstract_particles_output.hpp index 162f7fab0c1f2538d0d7512a71f173effb6f1d10..955f1e6fd07f98421837bd9bf359026ea9535b74 100644 --- a/bfps/cpp/particles/abstract_particles_output.hpp +++ b/bfps/cpp/particles/abstract_particles_output.hpp @@ -78,8 +78,6 @@ public: const int index_particles[], const int nb_particles, const int idx_time_step){ TIMEZONE("abstract_particles_output::save"); assert(total_nb_particles != -1); - DEBUG_MSG("[%d] total_nb_particles %d \n", my_rank, total_nb_particles); - DEBUG_MSG("[%d] nb_particles %d to distribute for saving \n", my_rank, nb_particles); { TIMEZONE("sort-to-distribute"); @@ -120,7 +118,6 @@ public: } const particles_utils::IntervalSplitter<int> particles_splitter(total_nb_particles, nb_processes, my_rank); - DEBUG_MSG("[%d] nb_particles_per_proc %d for saving\n", my_rank, particles_splitter.getMySize()); int* buffer_indexes_send_tmp = reinterpret_cast<int*>(buffer_indexes_send.get());// trick re-use buffer_indexes_send memory std::vector<int> nb_particles_to_send(nb_processes, 0); diff --git a/bfps/cpp/particles/particles_input_hdf5.hpp b/bfps/cpp/particles/particles_input_hdf5.hpp index 8f9c6407f4009e1d2b154b8cb441ae0535c49feb..0f1fa1ada359806b2365ce3c784d35be0c329025 100644 --- a/bfps/cpp/particles/particles_input_hdf5.hpp +++ b/bfps/cpp/particles/particles_input_hdf5.hpp @@ -70,8 +70,6 @@ public: nb_particles_for_me(-1){ TIMEZONE("particles_input_hdf5"); - DEBUG_MSG("particles_input_hdf5 : Open %s\n", inFilename.c_str()); - AssertMpi(MPI_Comm_rank(mpi_comm, &my_rank)); AssertMpi(MPI_Comm_size(mpi_comm, &nb_processes)); assert(int(in_spatial_limit_per_proc.size()) == nb_processes+1); @@ -142,10 +140,6 @@ public: particles_utils::IntervalSplitter<hsize_t> load_splitter(nb_total_particles, nb_processes, my_rank); - DEBUG_MSG("nb_total_particles %lu\n", nb_total_particles); - DEBUG_MSG("load_splitter.getMyOffset() %lu\n", load_splitter.getMyOffset()); - DEBUG_MSG("load_splitter.getMySize() %lu\n", load_splitter.getMySize()); - static_assert(std::is_same<real_number, double>::value || std::is_same<real_number, float>::value, "real_number must be double or float"); const hid_t type_id = (sizeof(real_number) == 8?H5T_NATIVE_DOUBLE:H5T_NATIVE_FLOAT); @@ -249,7 +243,6 @@ public: TIMEZONE("exchanger"); alltoall_exchanger exchanger(mpi_comm, std::move(nb_particles_per_proc)); // nb_particles_per_processes cannot be used after due to move - DEBUG_MSG("exchanger.getTotalToRecv() %lu\n", exchanger.getTotalToRecv()); nb_particles_for_me = exchanger.getTotalToRecv(); my_particles_positions.reset(new real_number[exchanger.getTotalToRecv()*size_particle_positions]);