IntelLabs / ParallelAccelerator.jl

The ParallelAccelerator package, part of the High Performance Scripting project at Intel Labs
BSD 2-Clause "Simplified" License
294 stars 32 forks source link

runStencil inside a module #138

Closed raminammour closed 7 years ago

raminammour commented 7 years ago

Hello,

I am trying to include a runStencil inside a module on Julia 0.5. For example,


module VarDen

import ParallelAccelerator

export mm

ParallelAccelerator.@acc function mm(a,b)
       ParallelAccelerator.runStencil(a,b,1,:oob_skip) do a,b
       a[0,0]*=b[0,0]
       end
       return 0
       end
end

Then, using VarDen produces many warnings that end with: ** incremental compilation may be broken for this module **

If I try to the call:

n=10
 a,b=rand(n,n),rand(n,n)
mm(a,b)

Julia exits with the error: ParallelAccelerator no longer supports @acc at callsites. Please add @acc to the declarations of functions that you want to optimize. Function tried to optimize = VarDen.##mm#271 with signature = (Array{Float64,2},Array{Float64,2})

Any help?

Thanks!

ehsantn commented 7 years ago

This code works for me on Julia 0.5. Are you using 0.5?

raminammour commented 7 years ago

Yes, I am, using the binary from the website, and ParallelAccelerator is using intel compilers.

The code builds and runs normally at the REPL, it just would not inside a module.

raminammour commented 7 years ago

If it helps, I see the same warnings as in this comment:

https://github.com/IntelLabs/ParallelAccelerator.jl/issues/110#issuecomment-236275372

Thanks for the help :)

ehsantn commented 7 years ago

Are you using userimg.jl? Unfortunately, seems like it's not supported in Julia anymore.

raminammour commented 7 years ago

No, I am not.

ehsantn commented 7 years ago

I can't reproduce this on Linux and Mac (Julia 0.5). Are you using Windows? Also, checking out the latest master branch of packages might help:

Pkg.checkout("ParallelAccelerator")     # Switch to master branch
Pkg.checkout("CompilerTools")           # Switch to master branch
Pkg.build("ParallelAccelerator")
raminammour commented 7 years ago

Here is the version info:

Julia Version 0.5.0
Commit 3c9d753 (2016-09-19 18:14 UTC)
Platform Info:
  System: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Xeon(R) CPU E5-4640 0 @ 2.40GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.7.1 (ORCJIT, sandybridge)

I have the master branch of the packages, I just rebuilt to be sure.

DrTodd13 commented 7 years ago

I am also unable to replicate. I think we normally do "using ParallelAccelerator" instead of import but even with import this example worked for me. Does it work for you without the runStencil call?

raminammour commented 7 years ago

I had just changed import to using before I saw your message and it worked!

I don't understand why though :)

raminammour commented 7 years ago

Thank you gentlemen!