Skip to content

feat(smp): add MPI-distributed island model#86

Open
evvaletov wants to merge 3 commits intonojhan:masterfrom
evvaletov:feat/smp-mpi-island-model
Open

feat(smp): add MPI-distributed island model#86
evvaletov wants to merge 3 commits intonojhan:masterfrom
evvaletov:feat/smp-mpi-island-model

Conversation

@evvaletov
Copy link

@evvaletov evvaletov commented Feb 22, 2026

Summary

Add MPI_IslandModel: a distributed island model where each MPI rank runs
one island with asynchronous migration via MPI send/receive.

  • Single-message MPI protocol using MPI_Isend/MPI_Get_count/MPI_Recv,
    avoiding the two-message pattern in communicator::recv() that can
    deadlock under oversubscription
  • MPI_Iprobe for non-blocking message detection
  • Non-blocking sends with PendingSend tracking and MPI_Test cleanup
  • Receive-before-send ordering to prevent message accumulation
  • Post-loop drain with safe shutdown (cancel pending sends)

Extended Island with IslandType/IslandModelKind enums, algoEOT
template parameter, and finalize() call after population integration.

Extended islandModelWrapper with MPI_IslandModel overloads.

Dependencies

Once those are merged, this branch can be rebased to drop the dependency
commits.

New files

File Description
smp/src/MPI_IslandModel.h Header with class template, PendingSend struct
smp/src/MPI_IslandModel.cpp Template implementation

Modified files

File Change
smp/src/abstractIsland.h Forward declaration + pure virtual setModel()
smp/src/island.h IslandType/IslandModelKind enums, algoEOT template param
smp/src/island.cpp send()/receive() MPI dispatch, heterogeneous re-evaluation
smp/src/islandModelWrapper.h New overloads for MPI_IslandModel
smp/src/smp.h Include MPI_IslandModel.h

Backward compatibility

Existing code using Island<EOAlgo, EOT> continues to work — bEOT
defaults to EOT and algoEOT defaults to EOT.

@nojhan
Copy link
Owner

nojhan commented Feb 27, 2026

Seems awesome, I would review that once the history is clean.

Eremey Valetov added 3 commits February 28, 2026 19:55
Add virtual finalize() and hasFinalize() to moeoAlgo/moeoPopAlgo hierarchy.
NSGA-II implements finalize() to recompute fitness and diversity assignments
after population modifications (e.g. immigrant integration in island model).
Template wrapper making any type T serializable via eoserial::Persistent,
required for transferring populations between MPI ranks in the island model.
Add MPI_IslandModel: a distributed island model where each MPI rank
runs one island with asynchronous migration via MPI send/receive.

Key features:
- Single-message MPI protocol: MPI_Isend (data) + MPI_Get_count/
  MPI_Recv on receive side. Avoids the two-message (size + data)
  pattern that can deadlock under oversubscription.
- MPI_Iprobe for non-blocking message detection (upstream's
  communicator lacks iprobe())
- Non-blocking sends with PendingSend tracking and MPI_Test cleanup
- Receive-before-send ordering to prevent message accumulation
- Post-loop drain with safe shutdown (cancel pending sends)
- Configurable poll interval (default 1s)
- Thread-safe update method for asynchronous migration
- Debug-level migration logging via eo::log

Extended Island with:
- IslandType enum (HOMOGENEOUS/HETEROGENEOUS) for conditional
  immigrant re-evaluation
- IslandModelKind enum (None/Shared/MPI) replacing string dispatch
- algoEOT template parameter for algorithm/individual type mismatch
- finalize() call after population integration

Extended islandModelWrapper with MPI_IslandModel overloads,
initial_values parameter, and algoEOT support.
@evvaletov
Copy link
Author

Rebased onto HEAD. This PR includes commits from #84 and #85 as dependencies; once those are merged, this branch can be rebased to drop them.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants