You can define your our "+" function for whatever inputs. In your case you 
could do something like
+(a::(Array{Float64,1},Array{Complex128,1}),b::(Array{Float64,1},Array{
Complex128,1}))=(a[1]+b[1],a[2]+b[2])



On Sunday, May 24, 2015 at 10:57:52 PM UTC+2, Jérémy Béjanin wrote:
>
> Is it possible to perform reduction on more than one variable in the case 
> where the loop is computing more than one quantity?
> I tried doing something like this:
>
> var1=zeros(Float64,10,4)
> var2=zeros(Complex128,10,1)
> @parallel (+) for m=1:10
>     var1[m,:] = [m,2*m,3*m,4*m]
>     var2[m] = m
>     (var1, var2)
> end
>
> but the addition method cannot add that type...
>
> The goal here is to fill two arrays where each loop computes a specific 
> element. I figured that simply adding each end of loop array (which would 
> not overlap since all non-modified entries are zeroes) would be more simple 
> than using a shared array.
>
> Thanks,
> Jeremy
>

Reply via email to