From 87a034afff169d03a4acbb51d59e1571d51fd436 Mon Sep 17 00:00:00 2001 From: Olli Saarikivi Date: Fri, 25 Aug 2023 21:17:09 +0000 Subject: [PATCH] Fix a deadlock This deadlock was introduced when updating sendrecv_test.cu for Connection being returned in a future. --- test/mscclpp-test/sendrecv_test.cu | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/mscclpp-test/sendrecv_test.cu b/test/mscclpp-test/sendrecv_test.cu index 662555365..d0922014d 100644 --- a/test/mscclpp-test/sendrecv_test.cu +++ b/test/mscclpp-test/sendrecv_test.cu @@ -157,16 +157,16 @@ void SendRecvTestEngine::setupConnections() { auto sendConnFuture = comm_->connectOnSetup(sendToRank, 0, getTransport(args_.rank, sendToRank, args_.nRanksPerNode, ibDevice)); - comm_->setup(); - smSemaphores.push_back(std::make_shared(*comm_, sendConnFuture.get())); if (recvFromRank != sendToRank) { auto recvConnFuture = comm_->connectOnSetup(recvFromRank, 0, getTransport(args_.rank, recvFromRank, args_.nRanksPerNode, ibDevice)); comm_->setup(); + smSemaphores.push_back(std::make_shared(*comm_, sendConnFuture.get())); smSemaphores.push_back(std::make_shared(*comm_, recvConnFuture.get())); } else { - // reuse the send channel if worldSize is 2 - smSemaphores.push_back(smSemaphores[0]); + comm_->setup(); + smSemaphores.push_back(std::make_shared(*comm_, sendConnFuture.get())); + smSemaphores.push_back(smSemaphores[0]); // reuse the send channel if worldSize is 2 } comm_->setup();