Skip to content

[MPI] Distribute text blocks across MPI processes #7

Description

@hubertwojcik

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

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

    algorithmCore algorithm implementation: trie, failure links, automatonmpiMPI distributed-memory parallelism

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions