-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
📁 Location
- Files:
tests/test_nest_file/*.py(6 files) - Category: nest-mpi-races
- Severity: high
- Hashes:
0d1f9750806d,c15ab18ce2da,2aa2e840d4bd,bdb5950c5d9b,9fb87c8a0bf1,2b4faa1a082c
🔍 Problem
nest.SetKernelStatus() called globally without rank 0 guard. With MPI, ALL ranks execute this, causing race conditions on shared kernel state.
Affected Files
spikedetector_mpi_thread.py:14spikegenerator_mpi_dict.py:15step_current_generator_mpi_thread.py:17step_current_generator_mpi.py:14spikegenerator_mpi.py:40spikedetector_mpi.py:14
💡 Fix
# Before
nest.SetKernelStatus({"overwrite_files": True, "total_num_virtual_procs": 4})
# After
if nest.Rank() == 0:
nest.SetKernelStatus({"overwrite_files": True, "total_num_virtual_procs": 4})
nest.Barrier() # Synchronize after kernel modification🧪 TDD Evidence
Test file: tests/evidence/test_nest_mpi_races.py
- Verifies rank-guarded pattern only allows rank 0 to modify kernel
- Documents current broken pattern lacking guards
tests/evidence/test_nest_mpi_races.py::TestNestMpiRaceConditions::test_set_kernel_status_pattern_with_rank_guard PASSED
tests/evidence/test_nest_mpi_races.py::TestNestMpiRaceConditions::test_current_code_lacks_rank_guard PASSED
Run: 2026-02-05-1228 | Auto-generated by UltraQA
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels