Skip to content

Commit

Permalink
fix pmap example code in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
bjarthur committed Dec 1, 2017
1 parent dba7e57 commit 1bb74b8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions doc/src/manual/parallel-computing.md
Original file line number Diff line number Diff line change
Expand Up @@ -478,16 +478,14 @@ function pmap(f, lst)
i = 1
# function to produce the next work item from the queue.
# in this case it's just an index.
nextidx() = (idx=i; i+=1; idx)
nextidx() = (global i; idx=i; i+=1; idx)
@sync begin
for p=1:np
if p != myid() || np == 1
@async begin
while true
idx = nextidx()
if idx > n
break
end
idx > n && break
results[idx] = remotecall_fetch(f, p, lst[idx])
end
end
Expand Down

0 comments on commit 1bb74b8

Please sign in to comment.