From 6f4dc57331a9ea6f33fe387972a55024baf3ed50 Mon Sep 17 00:00:00 2001 From: Saeed Maleki Date: Mon, 24 Apr 2023 07:45:01 +0000 Subject: [PATCH] fixed --- src/bootstrap/bootstrap.cc | 5 +++++ tests/bootstrap_test_cpp.cc | 12 ++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/bootstrap/bootstrap.cc b/src/bootstrap/bootstrap.cc index b12afb61..97a68634 100644 --- a/src/bootstrap/bootstrap.cc +++ b/src/bootstrap/bootstrap.cc @@ -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); } diff --git a/tests/bootstrap_test_cpp.cc b/tests/bootstrap_test_cpp.cc index 8e3b1e87..8a170ccd 100644 --- a/tests/bootstrap_test_cpp.cc +++ b/tests/bootstrap_test_cpp.cc @@ -12,12 +12,12 @@ int main() MPI_Comm_size(MPI_COMM_WORLD, &worldSize); std::shared_ptr 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();