That's no surprise your CPU is better :) 

Regarding devectorization 
            for l in 1:q
            for k in 1:nz
            for j in 1:ny
            for i in 1:nx 
            u = ux[i,j,k]
            v = uy[i,j,k]
            w = uz[i,j,k]

                cu = c[k,1]*u  + c[k,2]*v + c[k,3]*w
                u2 = u*u + v*v + w*w
                feq[i,j,k,l] = weights[k]*ρ[i,j,k]*(1 + 3*cu + 9/2*(cu*cu) 
- 3/2*u2)
                f[i,j,k,l] = f[i,j,k,l]*(1-ω) + ω*feq[i,j,k,l]
              end
              end
              end
             end

Actually makes the code a lot slower....

On Sunday, May 8, 2016 at 4:37:18 AM UTC-4, Patrick Kofod Mogensen wrote:
>
> For what it's worth  it run in about 3-4 seconds on my computer on latest 
> v0.4. 
>
> CPU : Intel(R) Core(TM) i7-4600U CPU @ 2.10GHz
>
> On Sunday, May 8, 2016 at 10:33:14 AM UTC+2, Patrick Kofod Mogensen wrote:
>>
>> As for the v0.5 performance (which is horrible), I think it's the boxing 
>> issue with closure https://github.com/JuliaLang/julia/issues/15276 . 
>> Right?
>>
>> On Sunday, May 8, 2016 at 10:29:59 AM UTC+2, STAR0SS wrote:
>>>
>>> You are using a lot of vectorized operations and Julia isn't as good as 
>>> matlab is with those.
>>>
>>> The usual solution is to devectorized your code and to use loops (except 
>>> for matrix multiplication if you have large matrices).
>>>
>>

Reply via email to