Bugfix: offset calculation has been corrected
This commit is contained in:
@@ -250,8 +250,10 @@ void MpiParticleReader::readParticles(
|
|||||||
// calculate offset from particles read by other processes in this io_group
|
// calculate offset from particles read by other processes in this io_group
|
||||||
std::uint64_t this_offset = cpu_header.file_offset;
|
std::uint64_t this_offset = cpu_header.file_offset;
|
||||||
this_offset += io_rank*particle_number*sizeof(particle::SerializedParticle);
|
this_offset += io_rank*particle_number*sizeof(particle::SerializedParticle);
|
||||||
this_offset = io_rank < overflow ? this_offset + io_rank*particle_number*sizeof(particle::SerializedParticle)
|
// fprintf(stdout, "<%d>: offset: %ld, numpart: %ld\n", MpiCommunication::mpiRank(), this_offset, particle_number);
|
||||||
: this_offset + overflow*particle_number*sizeof(particle::SerializedParticle);
|
this_offset = io_rank < overflow ? this_offset + io_rank*sizeof(particle::SerializedParticle)
|
||||||
|
: this_offset + overflow*sizeof(particle::SerializedParticle);
|
||||||
|
// fprintf(stdout, "<%d>: offset: %ld, sizeof(SerializedParticle): %ld\n", MpiCommunication::mpiRank(), this_offset, sizeof(particle::SerializedParticle));
|
||||||
|
|
||||||
// correct number of particles for this proc
|
// correct number of particles for this proc
|
||||||
particle_number = (io_rank < overflow) ? particle_number + 1 : particle_number;
|
particle_number = (io_rank < overflow) ? particle_number + 1 : particle_number;
|
||||||
@@ -259,7 +261,7 @@ void MpiParticleReader::readParticles(
|
|||||||
#if defined(debug_level1) || defined(debug_level2) || defined(debug_level3)
|
#if defined(debug_level1) || defined(debug_level2) || defined(debug_level3)
|
||||||
{
|
{
|
||||||
std::stringstream out;
|
std::stringstream out;
|
||||||
out << io_rank << ": trying to read " << particle_number;
|
out << io_rank << ": trying to read " << cpu_header.num_particles;
|
||||||
out << " many particles";
|
out << " many particles";
|
||||||
DEBUG_LEVEL_1(out.str());
|
DEBUG_LEVEL_1(out.str());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user