madeleineudell / LowRankModels.jl

LowRankModels.jl is a julia package for modeling and fitting generalized low rank models.
Other
190 stars 65 forks source link

Shareglrm "broadcasting" overwrites variables #17

Open alejandroschuler opened 9 years ago

alejandroschuler commented 9 years ago
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 commented 9 years ago

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 commented 8 years ago

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.