Skip to content

Commit

Permalink
Locality aware gather (#198)
Browse files Browse the repository at this point in the history
* first version at optimised scatter

* add test for receiver non local leader

* re-factor and organise the hosts to ranks mappings

* adding double colons for global namespaces

* inline set hosts for ranks and re-factor gather to reduce complexity with more explainatory comments

* add test to check the number of messages sent during gather, and the size of these messages
  • Loading branch information
csegarragonz committed Dec 16, 2021
1 parent 5f0d60a commit 1e9edf6
Show file tree
Hide file tree
Showing 3 changed files with 369 additions and 124 deletions.
11 changes: 6 additions & 5 deletions include/faabric/scheduler/MpiWorld.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,15 +224,16 @@ class MpiWorld
/* MPI internal messaging layer */

// Track at which host each rank lives
std::vector<std::string> rankHosts;
std::vector<std::string> hostForRank;
int getIndexForRanks(int sendRank, int recvRank);
std::vector<int> getRanksForHost(const std::string& host);

// Track ranks that are local to this world, and local/remote leaders
// Store the ranks that live in each host
std::map<std::string, std::vector<int>> ranksForHost;

// Track local and remote leaders. The leader is stored in the first
// position of the host to ranks map.
// MPITOPTP - this information exists in the broker
int localLeader = -1;
std::vector<int> localRanks;
std::vector<int> remoteLeaders;
void initLocalRemoteLeaders();

// In-memory queues for local messaging
Expand Down
Loading

0 comments on commit 1e9edf6

Please sign in to comment.