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

Shareglrm "broadcasting" overwrites variables #17

Open
alejandroschuler opened this issue Jul 1, 2015 · 2 comments
Open

Shareglrm "broadcasting" overwrites variables #17

alejandroschuler opened this issue Jul 1, 2015 · 2 comments
Labels

Comments

@alejandroschuler
Copy link
Contributor

oe = 10 # some variable I was using earlier


A = ones(5,5)
A::Array # A is clearly an array here
glrm = GLRM(A, losses, rx, ry, k) # define some losses, regs, etc.
X,Y,ch = fit!(glrm)

A::Array # This throws an error because A has been overwritten by fit!() in this scope during broadcasting of variables to all processes!
oe == 10 # this returns FALSE because oe has also been overwritten!
@madeleineudell
Copy link
Owner

shareglrm uses global variables, which is definitely terrible programming style and is why these local variables get overwritten. I don't know how to avoid it given current parallel programming primitives in Julia. Suggestions welcome.

@madeleineudell
Copy link
Owner

Now that Julia v0.5 is out, we should be able to use the multithreading feature instead of the horrible global variables to fit GLRMs in parallel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants