## Goal Implement MPI-based parallelism where rank 0 distributes text blocks to all processes and each runs an independent Aho-Corasick search. ## Tasks - [ ] Rank 0 reads the full text and scatters blocks to all processes using `MPI_Scatterv` - [ ] Broadcast the pre-built automaton transition table to all ranks using `MPI_Bcast` - [ ] Each rank searches its block and returns matches to rank 0 via `MPI_Gatherv` - [ ] Rank 0 merges results, adjusting match positions by block offset - [ ] Add CLI invocation via `mpirun -np N aho_mpi --patterns FILE --text FILE` ## Acceptance Criteria - [ ] Results match sequential baseline (excluding boundary patterns — handled in next issue) - [ ] Runs correctly with 2, 4, and 8 processes - [ ] No MPI errors or memory leaks detected with `valgrind --tool=helgrind`
Goal
Implement MPI-based parallelism where rank 0 distributes text blocks to all processes and each runs an independent Aho-Corasick search.
Tasks
MPI_ScattervMPI_BcastMPI_Gathervmpirun -np N aho_mpi --patterns FILE --text FILEAcceptance Criteria
valgrind --tool=helgrind