Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix new bug in pure soa communication #4337

Merged
merged 3 commits into from
Feb 18, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Src/Particle/AMReX_ParticleCommunication.H
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,11 @@ struct ParticleCopyPlan
int NStructInt = PC::ParticleContainerType::NStructInt;

int num_real_comm_comp = 0;
for (int i = AMREX_SPACEDIM + NStructReal; i < real_comp_mask.size(); ++i) {
int comm_comps_start = 0;
if constexpr (!PC::ParticleType::is_soa_particle) {
comm_comps_start += AMREX_SPACEDIM + NStructReal;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some more formatting :)

for (int i = comm_comps_start; i < real_comp_mask.size(); ++i) {
if (real_comp_mask[i]) {++num_real_comm_comp;}
}

Expand Down
21 changes: 15 additions & 6 deletions Src/Particle/AMReX_ParticleTile.H
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,10 @@ struct ParticleTileData
memcpy(dst, m_idcpu + src_index, sizeof(uint64_t));
dst += sizeof(uint64_t);
}
int array_start_index = AMREX_SPACEDIM + NStructReal;
int array_start_index = 0;
if constexpr (!ParticleType::is_soa_particle) {
array_start_index = AMREX_SPACEDIM + NStructReal;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some more formatting :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I upgraded to Ubuntu 24.04 and now my init.el is b0rked.

for (int i = 0; i < NAR; ++i)
{
if (comm_real[array_start_index + i])
Expand All @@ -143,7 +146,7 @@ struct ParticleTileData
dst += sizeof(ParticleReal);
}
}
int runtime_start_index = AMREX_SPACEDIM + NStructReal + NAR;
int runtime_start_index = array_start_index + NAR;
for (int i = 0; i < m_num_runtime_real; ++i)
{
if (comm_real[runtime_start_index + i])
Expand Down Expand Up @@ -185,7 +188,10 @@ struct ParticleTileData
memcpy(m_idcpu + dst_index, src, sizeof(uint64_t));
src += sizeof(uint64_t);
}
int array_start_index = AMREX_SPACEDIM + NStructReal;
int array_start_index = 0;
if constexpr (!ParticleType::is_soa_particle) {
array_start_index = AMREX_SPACEDIM + NStructReal;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some more formatting :)

for (int i = 0; i < NAR; ++i)
{
if (comm_real[array_start_index + i])
Expand All @@ -194,7 +200,7 @@ struct ParticleTileData
src += sizeof(ParticleReal);
}
}
int runtime_start_index = AMREX_SPACEDIM + NStructReal + NAR;
int runtime_start_index = array_start_index + NAR;
for (int i = 0; i < m_num_runtime_real; ++i)
{
if (comm_real[runtime_start_index + i])
Expand Down Expand Up @@ -595,7 +601,10 @@ struct ConstParticleTileData
memcpy(dst, m_idcpu + src_index, sizeof(uint64_t));
dst += sizeof(uint64_t);
}
int array_start_index = AMREX_SPACEDIM + NStructReal;
int array_start_index = 0;
if constexpr (!ParticleType::is_soa_particle) {
array_start_index = AMREX_SPACEDIM + NStructReal;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some more formatting :)

for (int i = 0; i < NArrayReal; ++i)
{
if (comm_real[array_start_index + i])
Expand All @@ -604,7 +613,7 @@ struct ConstParticleTileData
dst += sizeof(ParticleReal);
}
}
int runtime_start_index = AMREX_SPACEDIM + NStructReal + NArrayReal;
int runtime_start_index = array_start_index + NArrayReal;
for (int i = 0; i < m_num_runtime_real; ++i)
{
if (comm_real[runtime_start_index + i])
Expand Down
Loading