Skip to content

Commit 1f0fff2

Browse files
mppf submitted a patch for DistributedBag which fixes the issue where we spawn too many tasks. NUMLOCALES dropped to 4 to help 'fifo' tasking layer, and made changes from 'barrier' to 'barriers'
1 parent 0b78940 commit 1f0fff2

9 files changed

+26
-18
lines changed

modules/packages/DistributedBag.chpl

+10-2
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,14 @@ class DistributedBag : Collection {
140140
pragma "no doc"
141141
var pid : int = -1;
142142

143+
iter targetLocalesNotHere() {
144+
for loc in targetLocales {
145+
if loc != here {
146+
yield loc;
147+
}
148+
}
149+
}
150+
143151
// Node-local fields below. These fields are specific to the privatized instance.
144152
// To access them from another node, make sure you use 'getPrivatizedThis'
145153
pragma "no doc"
@@ -979,8 +987,8 @@ class Bag {
979987
segment.releaseStatus();
980988
coforall segmentIdx in 0..#here.maxTaskPar {
981989
var stolenWork : [{0..#numLocales}] (int, c_ptr(eltType));
982-
coforall loc in parentHandle.targetLocales {
983-
if loc != here then on loc {
990+
coforall loc in parentHandle.targetLocalesNotHere() {
991+
on loc {
984992
// As we jumped to the target node, 'localBag' returns
985993
// the target's bag that we are attempting to steal from.
986994
var targetBag = parentHandle.bag;

test/modules/packages/collections/CollectionCounter.chpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use DistributedBag;
22
use DistributedDeque;
3-
use Barrier;
3+
use Barriers;
44

55
// For this test, we implement a simple counter; we add a predetermined number
66
// of elements, then concurrently remove all elements from it until it is empty,
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
--no-loop-invariant-code-motion -sisDeque --main-module=CollectionCounter
2-
--no-loop-invariant-code-motion -sisBag --main-module=CollectionCounter
3-
--no-loop-invariant-code-motion -sisBoundedDeque --main-module=CollectionCounter
1+
-sisDeque
2+
-sisBag
3+
-sisBoundedDeque

test/modules/packages/collections/CollectionNQueens.chpl

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use Barrier;
1+
use Barriers;
22
use DistributedBag;
33
use DistributedDeque;
44

@@ -134,9 +134,9 @@ proc canPlaceQueen(board, row, col) {
134134

135135
return true;
136136
}
137-
138-
139-
137+
138+
139+
140140

141141
type boardType = nQueens * int;
142142
const totalSolutions = getTotalSolutions();
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
-sisDeque --main-module=CollectionNQueens
2-
-sisBag --main-module=CollectionNQueens
1+
-sisDeque
2+
-sisBag
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
--main-module=DequeOrdering
2-
--main-module=DequeOrdering -sisBounded=true
1+
-sisBounded=false
2+
-sisBounded=true

test/modules/packages/collections/DequeParity.chpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use Barrier;
1+
use Barriers;
22
use DistributedDeque;
33

44
// For the parity test, we separate even and odd numbers on each side of the Deque.
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
-sisBounded --main-module=DequeParity
2-
--main-module=DequeParity
1+
-sisBounded=true
2+
-sisBounded=false
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8
1+
4

0 commit comments

Comments
 (0)