From f1d734a078ba4ac806126ef10e10f563a520e711 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mamy=20Andr=C3=A9-Ratsimbazafy?= Date: Sat, 28 Dec 2019 17:46:40 +0100 Subject: [PATCH] loadBalance on loop tasks entry to address https://github.com/mratsim/weave/issues/76#issuecomment-569428292 --- weave/parallel_for.nim | 1 + weave/parallel_for_staged.nim | 1 + weave/parallel_reduce.nim | 1 + 3 files changed, 3 insertions(+) diff --git a/weave/parallel_for.nim b/weave/parallel_for.nim index f2ef228..b46730c 100644 --- a/weave/parallel_for.nim +++ b/weave/parallel_for.nim @@ -32,6 +32,7 @@ template parallelForWrapper( ## Loop prologue, epilogue, ## remoteAccum, resultTy and returnStmt ## are unused + loadBalance(Weave) block: let this = myTask() diff --git a/weave/parallel_for_staged.nim b/weave/parallel_for_staged.nim index 641e5cb..54b37cf 100644 --- a/weave/parallel_for_staged.nim +++ b/weave/parallel_for_staged.nim @@ -29,6 +29,7 @@ template parallelStagedWrapper( ## Also poll steal requests in-between iterations ## ## remoteAccum and resultFlowvarType are unused + loadBalance(Weave) prologue diff --git a/weave/parallel_reduce.nim b/weave/parallel_reduce.nim index 36ea5ed..d214629 100644 --- a/weave/parallel_reduce.nim +++ b/weave/parallel_reduce.nim @@ -28,6 +28,7 @@ template parallelReduceWrapper( ## To be called within a loop task ## Gets the loop bounds and iterate the over them ## Also poll steal requests in-between iterations + loadBalance(Weave) prologue