On Thursday, August 20, 2015 at 4:50:49 AM UTC+10, Ismael VC wrote:
>
> Well that works but it's indeed odd, can you open a new issue for this?
>
Not really odd, @parallel needs to divide the set of values between
multiple processes, so it needs the whole set of values.
>
> El miércoles, 19 de agosto de 2015, 13:48:28 (UTC-5), Ismael VC escribió:
>>
>> Enumerate is an iterator, you need to collect the items first:
>>
>> julia> @parallel for i in collect(enumerate(list))
>> println(i)
>> end
>>
>> julia> From worker 2: (1,"a")
>> From worker 2: (2,"b")
>> From worker 3: (3,"c")
>>
>>
>> El miércoles, 19 de agosto de 2015, 12:17:35 (UTC-5), Nils Gudat escribió:
>>>
>>> I just rewrote one of my parallel loops and was surprised by this:
>>>
>>> > list = ["a", "b", "c"]
>>>
>>> > for i in enumerate(list)
>>> > println(i)
>>> > end
>>>
>>> (1,"a")
>>> (2,"b")
>>> (3,"c")
>>>
>>> > addprocs(2)
>>>
>>> > @sync @parallel for i in enumerate(list)
>>> > println(i)
>>> > end
>>>
>>> ERROR: `getindex` has no method matching
>>> getindex(::Enumerate{Array{ASCIIString,1}}, ::UnitRange{Int64})
>>>
>>> Am I doing something wrong here? Is this expected behaviour?
>>>
>>