Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update parallel.rst #10277

Closed
wants to merge 5 commits into from
Closed

Conversation

simeonbassett
Copy link

It was very confusing to me how to pass messages back and forth between processes, so I thought a complete example would help quite a bit.

It was very confusing to me how to pass messages back and forth between processes, so I thought a complete example
Corrected so mistakes and used the array returned from addprocs
@vtjnash
Copy link
Member

vtjnash commented Feb 22, 2015

looks like this failed the whitespace test on CI

Added white space to try to mimic the code in isready.   When I preview the file though it just shows the top most outline, so I am unfortunately not sure how to make sure it will pass the built in whitespace test.
Changed @spawnat to use a variable instead of a hardcoded constant.
end
@spawnat procList[1] f(rr)
put!(rr, 8)
@show( take!(rr) ) # => 64
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though the chances of seeing a return value of 8 here is almost nil, julia does not guarantee that f will execute on the remote worker before the take! here.

Hence, a better example for message passing would be to have two remote refs, say r1 and r2. r1 is always written to from the local process and read from the remote process, while r2 is always written to at the remote process and read from the local.

@jakebolewski
Copy link
Member

@simeonbassett do you have time to squash and rebase? Also, it would be great if you could address @amitmurthy's comment.

@tkelman tkelman added docs This change adds or pertains to documentation parallelism Parallel or distributed computation labels May 6, 2015
@quinnj
Copy link
Member

quinnj commented May 9, 2016

Old Doc PRs tend to be the most stale.....feel free to open additional issues/PRs around improvements on latest master.

@quinnj quinnj closed this May 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This change adds or pertains to documentation parallelism Parallel or distributed computation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants