Skip to content

Commit

Permalink
local scope lpart in tracker on openmp
Browse files Browse the repository at this point in the history
  • Loading branch information
szymonlopaciuk committed Mar 13, 2024
1 parent fa07c62 commit 1d5c4f1
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions xtrack/tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,13 +473,15 @@ def _build_kernel(
#ifndef XT_OMP_SKIP_REORGANIZE
const int64_t num_particles_to_track = ParticlesData_get__num_active_particles(particles);
LocalParticle lpart;
lpart.io_buffer = io_buffer;
Particles_to_LocalParticle(particles, &lpart, 0, capacity);
check_is_active(&lpart);
count_reorganized_particles(&lpart);
LocalParticle_to_Particles(&lpart, particles, 0, capacity);
{
LocalParticle lpart;
lpart.io_buffer = io_buffer;
Particles_to_LocalParticle(particles, &lpart, 0, capacity);
check_is_active(&lpart);
count_reorganized_particles(&lpart);
LocalParticle_to_Particles(&lpart, particles, 0, capacity);
}
#else // When we skip reorganize, we cannot just batch active particles
const int64_t num_particles_to_track = capacity;
#endif
Expand Down

0 comments on commit 1d5c4f1

Please sign in to comment.