From 1392dd29977fe2ae6eddd64d6d80609ced56de9f Mon Sep 17 00:00:00 2001 From: Gilbert Lee Date: Fri, 11 Oct 2019 09:16:19 -0700 Subject: [PATCH] Performing __threadfence_system() with only first thread --- src/collectives/device/primitives.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/collectives/device/primitives.h b/src/collectives/device/primitives.h index 8c63a6a4f1..b0d4a2938d 100644 --- a/src/collectives/device/primitives.h +++ b/src/collectives/device/primitives.h @@ -189,10 +189,13 @@ class ncclPrimitives { } } exitIfAbortBarrier(abort, abortCount); - if (tid == 0) FOR_SEND(postSendSize, realSize*sizeof(T)); - if (SEND) __threadfence_system(); - if (tid == 0) FOR_SEND(postSend); - if (tid == 0) FOR_RECV(postRecv); + if (tid == 0) + { + FOR_SEND(postSendSize, realSize*sizeof(T)); + __threadfence_system(); + FOR_SEND(postSend); + FOR_RECV(postRecv); + } for (int i=0; i