Hi Jason,

I don't really understand what you are trying to do but the problem is that 
the array a is not read-only in this context.
>From the manual: Using “outside” variables in parallel loops is perfectly 
reasonable if the variables are read-only.

See the parallel section of the manual: 
http://julia.readthedocs.org/en/latest/manual/parallel-computing/

The way you are using a is not amenable to parallelization as you have a 
clear data dependency for each iteration.

Best,
Jake

On Wednesday, March 5, 2014 2:51:11 PM UTC-5, Jason Solack wrote:
>
> i'm sorry, yes i did!
>
> On Wednesday, March 5, 2014 2:49:11 PM UTC-5, Jake Bolewski wrote:
>>
>> Is j = 1000000 a typo (did you mean 1:1000000)?  
>>
>>
>> On Wednesday, March 5, 2014 2:41:51 PM UTC-5, Jason Solack wrote:
>>>
>>> i'm trying to check out how Julia handles parallel for loops and i'm 
>>> getting some errors
>>>
>>> i'm not sure if it's because i'm working with a single array and i can't 
>>> append to this in parallel, so i thought i'd ask
>>>
>>> nprocs()
>>> addprocs(6)
>>>
>>> tic()
>>> onPass = 1
>>> a = Array(Int64, 0)
>>> @parallel for i = 1:100000, j=10000
>>>     a = [a, i*j]
>>>     onPass = onPass + 1
>>>     if onPass % 10000 == 0
>>>         println("on pass ", onPass)
>>>     end
>>> end
>>> toc()
>>>
>>> is this not possible in parallel?
>>>
>>> Thank you again for all your answers!
>>>
>>> jason
>>>
>>

Reply via email to