From af5010c5ff9b6ea9f5dad7836a9887c24a86afed Mon Sep 17 00:00:00 2001 From: =?utf8?q?Szil=C3=A1rd=20P=C3=A1ll?= Date: Tue, 23 Mar 2021 13:44:45 +0000 Subject: [PATCH] Fix deviceIdsAssigned() to return a unique list of IDs The method originally returned the rank's task-to-device mapping rather than the unique list of devices that have been assigned tasks. When #ranks > #devices this list contains duplicate device IDs. Due to the changes made in e2a2fe80 the vector returned by deviceIdsAssigned() was passed to setupGpuDevicePeerAccess() which results in redundant attempts to repeatedly enable peer access for the same device pairs. Refs #3980 --- src/gromacs/taskassignment/taskassignment.cpp | 14 +++++++++----- src/gromacs/taskassignment/taskassignment.h | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/gromacs/taskassignment/taskassignment.cpp b/src/gromacs/taskassignment/taskassignment.cpp index a9256ba27c..34acebbd26 100644 --- a/src/gromacs/taskassignment/taskassignment.cpp +++ b/src/gromacs/taskassignment/taskassignment.cpp @@ -265,7 +265,7 @@ GpuTaskAssignments GpuTaskAssignmentsBuilder::build(const gmx::ArrayRef taskAssignmentOnRanksOfThisNode; - std::vector deviceIdsAssigned; + std::vector deviceIdAssignment; try { // Use the GPU IDs from the user if they supplied @@ -320,7 +320,7 @@ GpuTaskAssignments GpuTaskAssignmentsBuilder::build(const gmx::ArrayRef deviceIdsAssigned() { return deviceIdsAssigned_; } }; -- 2.22.0