mirror of
https://github.com/microsoft/mscclpp.git
synced 2026-05-20 21:09:13 +00:00
fixed
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user