Skip to content

add_particles_with_global_coordinates duplicates particles at np>1 (each rank adds the full array) #324

Description

@lmoresi

Summary

Found during #323's gating: when every rank passes the SAME global coordinate array to add_particles_with_global_coordinates() — the natural reading of its docstring — the particles are added once per rank: observed 64 particles from a 32-point array at np2. The docstring implies global/deduplicated semantics.

Impact

read_timestep()-style restoration patterns that pass identical global arrays on all ranks are at duplication risk in parallel. Silent (no error), affects mass/statistics.

Suggested direction

Either claim ownership by locality (each rank adds only the points it owns — kd-tree / cell test — making identical-array calls safe), or document rank-partitioned input semantics loudly and add a guard/assert against full-duplication. Regression test at np2/np4 either way.

Related: 2026-07 audit SWARM findings family; discovered while validating PR #323.

Underworld development team with AI support from Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions