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

local scope problems with @parallel #6760

Closed
EthanAnderes opened this issue May 6, 2014 · 9 comments
Closed

local scope problems with @parallel #6760

EthanAnderes opened this issue May 6, 2014 · 9 comments
Labels
parallelism Parallel or distributed computation

Comments

@EthanAnderes
Copy link

The call to @parallel in the local scope below can't find a

addprocs(3)
if true
    a = 2
    x = @parallel (vcat) for k=1:2
        sin(a)
    end  #<--- gives an error
end

Outside the conditional scope it works fine

addprocs(3)
a = 2
x = @parallel (vcat) for k=1:2
    sin(a)
end   #<---works fine

google groups reference

[pao: quoting macro name]

@pao
Copy link
Member

pao commented May 15, 2014

@EthanAnderes not directly related to the issue, but please try to always code-quote Julia macro names to avoid sending notifications to GitHub users who happen to share them.

@porterjamesj
Copy link
Contributor

does this have something to do with localize_vars? I looked into it briefly and couldn't figure it out.

@EthanAnderes
Copy link
Author

@pao: Sorry to be dense here but I'm a total newbie at github. Could you elaborate a bit. I'm not sure I know what you mean when you say "code-quote Julia macro names"

@StefanKarpinski
Copy link
Member

If you don't put backticks around @parallel it will send a notification email to this person on GitHub and subscribe them to this discussion. They likely have no interest in this conversion and will be very annoyed. This doesn't happen in markdown code syntax – so inside backticks, or in blocks that are indented four spaces or preceded and followed by three backticks on a line.

@EthanAnderes
Copy link
Author

@StefanKarpinski I see now..the problem was that I left out the backticks in the title. Sorry about that.

@pao
Copy link
Member

pao commented May 15, 2014

I left out the backticks in the title

I'm not sure if the title causes a notification--I hope not. It was in the first line (I edited it to add the backticks). Sorry for the confusion.

@StefanKarpinski
Copy link
Member

I don't think titles are interpreted as markdown for better or worse.

@amitmurthy
Copy link
Contributor

Closed by #19594

@tkelman
Copy link
Contributor

tkelman commented Jan 26, 2017

is this case tested?

@tkelman tkelman added needs tests Unit tests are required for this change and removed needs tests Unit tests are required for this change labels Jan 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
parallelism Parallel or distributed computation
Projects
None yet
Development

No branches or pull requests

7 participants