Re: [julia-users] SharedArray definition and assignation of values. Is this behavior a bug?

2015-05-19 Thread Tim Holy
Almost certainly https://github.com/JuliaLang/julia/issues/10773, which was 
fixed (on julia 0.4) in https://github.com/JuliaLang/julia/pull/10877.

--Tim


On Monday, May 18, 2015 11:06:29 PM Jacob Quinn wrote:
 I'm not able to reproduce the above behavior with my latest changes to
 #11280, so that's a good sign!
 
 If you're feeling ambitious/able, feel free to give that PR a spin to see
 if it fixes it for you as well.
 
 -Jacob
 
 On Mon, May 18, 2015 at 8:55 PM, Jacob Quinn quinn.jac...@gmail.com wrote:
  I'm actually just about to do another round of windows testing on #11280,
  so I'll test this out as well. Thanks for the report!
  
  -Jacob
  
  On Mon, May 18, 2015 at 6:27 PM, Sebastian Souyris 
  
  sebastian.souy...@gmail.com wrote:
  It seems that there is a bug when you define several SharedArray in one
  call (for example using include(file.jl)). Or maybe I'm missing
  something about how to use SharedArray. I'm using Windows 7. Let me
  explain
  with an example:
  
  This code has no problem. It assign correctly the values of SharedArrays
  a and b:
  
  ##
  julia a = SharedArray(Float64, (2));
  julia b = SharedArray(Float64, (2));
  julia for i in 1:2
  
  a[i] = i
  
  end
  julia for i in 1:2
  
  b[i] = i+2
  
  end
  julia a
  
  2-element SharedArray{Float64,1}:
   1.0
   2.0
  
  julia b
  
  2-element SharedArray{Float64,1}:
   3.0
   4.0
  
  ##
  
  But the following code has a problem.  It assign incorrectly the same
  value to a and b:
  
  ##
  julia a = SharedArray(Float64, (2));b = SharedArray(Float64, (2));
  
  julia for i in 1:2
  
  a[i] = i
  
  end
  
  julia for i in 1:2
  
  b[i] = i+2
  
  end
  
  julia a
  
  2-element SharedArray{Float64,1}:
   3.0
   4.0
  
  julia b
  
  2-element SharedArray{Float64,1}:
   3.0
   4.0
  
  ##
  
  If you define multiple SharedArray in one call, the values of all the
  SharedArrays of that call are equal to the values of the last
  SharedArray that was defined and has assigned values.
  
  Is this behavior expected? Or is it a bug?
  
  
  Thanks!



Re: [julia-users] SharedArray definition and assignation of values. Is this behavior a bug?

2015-05-19 Thread Tracy Wadleigh
Yeah, I didn't prepare a backport. Probably should have.

On Tue, May 19, 2015 at 1:38 PM Sebastian Souyris 
sebastian.souy...@gmail.com wrote:

 Thanks, Tim. I'll try later 0.4.

 I'm using 0.3.8 and #11280 fix the issue.



 Sebastian





Re: [julia-users] SharedArray definition and assignation of values. Is this behavior a bug?

2015-05-19 Thread Sebastian Souyris
I used #11280 and it fixes the problem. Thank you, Jacob!



Sebastian


On Tuesday, May 19, 2015 at 12:06:52 AM UTC-5, Jacob Quinn wrote:

 I'm not able to reproduce the above behavior with my latest changes to 
 #11280, so that's a good sign!

 If you're feeling ambitious/able, feel free to give that PR a spin to see 
 if it fixes it for you as well.

 -Jacob

 On Mon, May 18, 2015 at 8:55 PM, Jacob Quinn quinn@gmail.com 
 javascript: wrote:

 I'm actually just about to do another round of windows testing on #11280, 
 so I'll test this out as well. Thanks for the report!

 -Jacob

 On Mon, May 18, 2015 at 6:27 PM, Sebastian Souyris sebastia...@gmail.com 
 javascript: wrote:

 It seems that there is a bug when you define several SharedArray in one 
 call (for example using include(file.jl)). Or maybe I'm missing 
 something about how to use SharedArray. I'm using Windows 7. Let me explain 
 with an example:

 This code has no problem. It assign correctly the values of SharedArrays 
 a and b:

 ##
 julia a = SharedArray(Float64, (2));
 julia b = SharedArray(Float64, (2));
 julia for i in 1:2
 a[i] = i
 end
 julia for i in 1:2
 b[i] = i+2
 end
 julia a
 2-element SharedArray{Float64,1}:
  1.0
  2.0
 julia b
 2-element SharedArray{Float64,1}:
  3.0
  4.0
 ##

 But the following code has a problem.  It assign incorrectly the same 
 value to a and b:

 ##
 julia a = SharedArray(Float64, (2));b = SharedArray(Float64, (2));

 julia for i in 1:2
 a[i] = i
 end

 julia for i in 1:2
 b[i] = i+2
 end

 julia a
 2-element SharedArray{Float64,1}:
  3.0
  4.0

 julia b
 2-element SharedArray{Float64,1}:
  3.0
  4.0
 ##

 If you define multiple SharedArray in one call, the values of all the 
 SharedArrays of that call are equal to the values of the last 
 SharedArray that was defined and has assigned values. 

 Is this behavior expected? Or is it a bug?


 Thanks!





Re: [julia-users] SharedArray definition and assignation of values. Is this behavior a bug?

2015-05-19 Thread Sebastian Souyris
Thanks, Tim. I'll try later 0.4.

I'm using 0.3.8 and #11280 fix the issue.



Sebastian




Re: [julia-users] SharedArray definition and assignation of values. Is this behavior a bug?

2015-05-18 Thread Jacob Quinn
I'm actually just about to do another round of windows testing on #11280,
so I'll test this out as well. Thanks for the report!

-Jacob

On Mon, May 18, 2015 at 6:27 PM, Sebastian Souyris 
sebastian.souy...@gmail.com wrote:

 It seems that there is a bug when you define several SharedArray in one
 call (for example using include(file.jl)). Or maybe I'm missing
 something about how to use SharedArray. I'm using Windows 7. Let me explain
 with an example:

 This code has no problem. It assign correctly the values of SharedArrays a
 and b:

 ##
 julia a = SharedArray(Float64, (2));
 julia b = SharedArray(Float64, (2));
 julia for i in 1:2
 a[i] = i
 end
 julia for i in 1:2
 b[i] = i+2
 end
 julia a
 2-element SharedArray{Float64,1}:
  1.0
  2.0
 julia b
 2-element SharedArray{Float64,1}:
  3.0
  4.0
 ##

 But the following code has a problem.  It assign incorrectly the same
 value to a and b:

 ##
 julia a = SharedArray(Float64, (2));b = SharedArray(Float64, (2));

 julia for i in 1:2
 a[i] = i
 end

 julia for i in 1:2
 b[i] = i+2
 end

 julia a
 2-element SharedArray{Float64,1}:
  3.0
  4.0

 julia b
 2-element SharedArray{Float64,1}:
  3.0
  4.0
 ##

 If you define multiple SharedArray in one call, the values of all the
 SharedArrays of that call are equal to the values of the last SharedArray that
 was defined and has assigned values.

 Is this behavior expected? Or is it a bug?


 Thanks!




Re: [julia-users] SharedArray definition and assignation of values. Is this behavior a bug?

2015-05-18 Thread Jacob Quinn
I'm not able to reproduce the above behavior with my latest changes to
#11280, so that's a good sign!

If you're feeling ambitious/able, feel free to give that PR a spin to see
if it fixes it for you as well.

-Jacob

On Mon, May 18, 2015 at 8:55 PM, Jacob Quinn quinn.jac...@gmail.com wrote:

 I'm actually just about to do another round of windows testing on #11280,
 so I'll test this out as well. Thanks for the report!

 -Jacob

 On Mon, May 18, 2015 at 6:27 PM, Sebastian Souyris 
 sebastian.souy...@gmail.com wrote:

 It seems that there is a bug when you define several SharedArray in one
 call (for example using include(file.jl)). Or maybe I'm missing
 something about how to use SharedArray. I'm using Windows 7. Let me explain
 with an example:

 This code has no problem. It assign correctly the values of SharedArrays
 a and b:

 ##
 julia a = SharedArray(Float64, (2));
 julia b = SharedArray(Float64, (2));
 julia for i in 1:2
 a[i] = i
 end
 julia for i in 1:2
 b[i] = i+2
 end
 julia a
 2-element SharedArray{Float64,1}:
  1.0
  2.0
 julia b
 2-element SharedArray{Float64,1}:
  3.0
  4.0
 ##

 But the following code has a problem.  It assign incorrectly the same
 value to a and b:

 ##
 julia a = SharedArray(Float64, (2));b = SharedArray(Float64, (2));

 julia for i in 1:2
 a[i] = i
 end

 julia for i in 1:2
 b[i] = i+2
 end

 julia a
 2-element SharedArray{Float64,1}:
  3.0
  4.0

 julia b
 2-element SharedArray{Float64,1}:
  3.0
  4.0
 ##

 If you define multiple SharedArray in one call, the values of all the
 SharedArrays of that call are equal to the values of the last
 SharedArray that was defined and has assigned values.

 Is this behavior expected? Or is it a bug?


 Thanks!





Re: [julia-users] SharedArray definition and assignation of values. Is this behavior a bug?

2015-05-18 Thread Jameson Nash
this definitely looks like a bug. can you post an issue? it might be good
to see if https://github.com/JuliaLang/julia/pull/11280 fixes it as well.

On Mon, May 18, 2015 at 10:44 PM Sebastian Souyris 
sebastian.souy...@gmail.com wrote:

 It seems that there is a bug when you define several SharedArray in one
 call (for example using include(file.jl)). Or maybe I'm missing
 something about how to use SharedArray. I'm using Windows 7. Let me explain
 with an example:

 This code has no problem. It assign correctly the values of SharedArrays a
 and b:

 ##
 julia a = SharedArray(Float64, (2));
 julia b = SharedArray(Float64, (2));
 julia for i in 1:2
 a[i] = i
 end
 julia for i in 1:2
 b[i] = i+2
 end
 julia a
 2-element SharedArray{Float64,1}:
  1.0
  2.0
 julia b
 2-element SharedArray{Float64,1}:
  3.0
  4.0
 ##

 But the following code has a problem.  It assign incorrectly the same
 value to a and b:

 ##
 julia a = SharedArray(Float64, (2));b = SharedArray(Float64, (2));

 julia for i in 1:2
 a[i] = i
 end

 julia for i in 1:2
 b[i] = i+2
 end

 julia a
 2-element SharedArray{Float64,1}:
  3.0
  4.0

 julia b
 2-element SharedArray{Float64,1}:
  3.0
  4.0
 ##

 If you define multiple SharedArray in one call, the values of all the
 SharedArrays of that call are equal to the values of the last SharedArray that
 was defined and has assigned values.

 Is this behavior expected? Or is it a bug?


 Thanks!