mirror of
https://github.com/microsoft/mscclpp.git
synced 2026-05-21 21:39:21 +00:00
testing connection setup
This commit is contained in:
@@ -5,6 +5,20 @@
|
||||
#include <iostream>
|
||||
#include <mpi.h>
|
||||
|
||||
mscclpp::TransportFlags findIb(int localRank){
|
||||
mscclpp::TransportFlags IBs[] = {
|
||||
mscclpp::TransportIB0,
|
||||
mscclpp::TransportIB1,
|
||||
mscclpp::TransportIB2,
|
||||
mscclpp::TransportIB3,
|
||||
mscclpp::TransportIB4,
|
||||
mscclpp::TransportIB5,
|
||||
mscclpp::TransportIB6,
|
||||
mscclpp::TransportIB7
|
||||
};
|
||||
return IBs[localRank];
|
||||
}
|
||||
|
||||
void test_communicator(int rank, int worldSize, int nranksPerNode){
|
||||
auto bootstrap = std::make_shared<mscclpp::Bootstrap>(rank, worldSize);
|
||||
mscclpp::UniqueId id;
|
||||
@@ -16,12 +30,14 @@ void test_communicator(int rank, int worldSize, int nranksPerNode){
|
||||
auto communicator = std::make_shared<mscclpp::Communicator>(bootstrap);
|
||||
for (int i = 0; i < worldSize; i++){
|
||||
if (i != rank){
|
||||
if (i % nranksPerNode == rank % nranksPerNode)
|
||||
if (i % nranksPerNode == rank % nranksPerNode){
|
||||
auto connect = communicator->connect(i, 0, mscclpp::TransportCudaIpc);
|
||||
else
|
||||
auto connect = communicator->connect(i, 0, mscclpp::TransportAllIB);
|
||||
} else {
|
||||
auto connect = communicator->connect(i, 0, findIb(rank % nranksPerNode));
|
||||
}
|
||||
}
|
||||
}
|
||||
communicator->connectionSetup();
|
||||
|
||||
if (bootstrap->getRank() == 0)
|
||||
std::cout << "--- MSCCLPP::Communicator tests passed! ---" << std::endl;
|
||||
|
||||
Reference in New Issue
Block a user