This commit is contained in:
Saeed Maleki
2023-04-24 07:45:01 +00:00
parent a9cfb82fcb
commit 6f4dc57331
2 changed files with 11 additions and 6 deletions

View File

@@ -152,6 +152,11 @@ void MscclppBootstrap::Impl::initialize(std::string ipPortPair)
uniqueId_.magic = 0xdeadbeef;
std::memcpy(&uniqueId_.addr, &netIfAddr_, sizeof(union mscclppSocketAddress));
ret = mscclppSocketGetAddrFromString(&uniqueId_.addr, ipPortPair.c_str());
if (ret != mscclppSuccess) {
throw std::runtime_error("Failed to get address from string");
}
if (rank_ == 0) {
rootThread_ = std::thread(&MscclppBootstrap::Impl::bootstrapRoot, this);
}

View File

@@ -12,12 +12,12 @@ int main()
MPI_Comm_size(MPI_COMM_WORLD, &worldSize);
std::shared_ptr<MscclppBootstrap> bootstrap(new MscclppBootstrap(rank, worldSize));
// bootstrap->Initialize("costsim-dev-00000A:50000");
UniqueId id;
if (rank == 0)
id = bootstrap->GetUniqueId();
MPI_Bcast(&id, sizeof(id), MPI_BYTE, 0, MPI_COMM_WORLD);
bootstrap->Initialize(id);
bootstrap->Initialize("costsim-dev-00000A:50000");
// UniqueId id;
// if (rank == 0)
// id = bootstrap->GetUniqueId();
// MPI_Bcast(&id, sizeof(id), MPI_BYTE, 0, MPI_COMM_WORLD);
// bootstrap->Initialize(id);
// need to call initialization first
MPI_Finalize();