Commit 77becf8c authored by COULAUD Olivier's avatar COULAUD Olivier
Browse files

Fix bug in fma_dist_loader.hpp

parent a200aecd
......@@ -41,15 +41,16 @@ namespace scalfmm::tools
{
// the header is already read by the constructor of FFmaGenericLoader
std::size_t bloc = m_nbParticles / FReal(m_parallelManager->get_num_processes());
std::cout << "bloc: " << bloc << " part " << m_nbParticles << "nP "
std::cout << "bloc: " << bloc << " part " << m_nbParticles << " nP "
<< FReal(m_parallelManager->get_num_processes()) << std::endl;
// Determine the number of particles to read
std::size_t startPart = bloc * m_parallelManager->get_process_id();
std::size_t endPart = std::min(startPart + bloc, m_nbParticles);
auto rank = m_parallelManager->get_process_id();
std::size_t startPart = bloc * rank ;
std::size_t endPart = (rank+1 == m_parallelManager->get_num_processes()) ? m_nbParticles : startPart + bloc;
this->m_start = startPart;
this->m_local_number_of_particles = endPart - startPart;
// std::cout << " startPart " << startPart << " endPart " << endPart << std::endl;
//std::cout << " startPart " << startPart << " endPart " << endPart << std::endl;
// std::cout << "Proc " << m_parallelManager->get_process_id() << " will hold " <<
// m_local_number_of_particles
// << std::endl;
......
Markdown is supported
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