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

Tests crash with coverage #25

Closed ehsantn closed 8 years ago

ehsantn commented 8 years ago

When coverage is on, the package tests crash:

Testing rand()...
ERROR: LoadError: LoadError: ArgumentError: argument is not a generic function
 in methods at reflection.jl:140
 in function_module at reflection.jl:340
 in code_typed at /home/etotoni/.julia/v0.4/ParallelAccelerator/src/driver.jl:308
 in insert at /home/etotoni/.julia/v0.4/ParallelAccelerator/src/cgen.jl:2435
 in insert at /home/etotoni/.julia/v0.4/ParallelAccelerator/src/cgen.jl:2417
 in insert at /home/etotoni/.julia/v0.4/ParallelAccelerator/src/cgen.jl:2406
 in from_call at /home/etotoni/.julia/v0.4/ParallelAccelerator/src/cgen.jl:1605
 in from_expr at /home/etotoni/.julia/v0.4/ParallelAccelerator/src/cgen.jl:1962
 in from_call at /home/etotoni/.julia/v0.4/ParallelAccelerator/src/cgen.jl:1576
 in from_expr at /home/etotoni/.julia/v0.4/ParallelAccelerator/src/cgen.jl:1962
 in from_call at /home/etotoni/.julia/v0.4/ParallelAccelerator/src/cgen.jl:1576
 in from_expr at /home/etotoni/.julia/v0.4/ParallelAccelerator/src/cgen.jl:1962
 in from_call at /home/etotoni/.julia/v0.4/ParallelAccelerator/src/cgen.jl:1576
 in from_expr at /home/etotoni/.julia/v0.4/ParallelAccelerator/src/cgen.jl:1962
 in from_return at /home/etotoni/.julia/v0.4/ParallelAccelerator/src/cgen.jl:1640
 in from_expr at /home/etotoni/.julia/v0.4/ParallelAccelerator/src/cgen.jl:1962
 in from_exprs at /home/etotoni/.julia/v0.4/ParallelAccelerator/src/cgen.jl:444
 in from_expr at /home/etotoni/.julia/v0.4/ParallelAccelerator/src/cgen.jl:1942
 in from_lambda at /home/etotoni/.julia/v0.4/ParallelAccelerator/src/cgen.jl:420
 in from_expr at /home/etotoni/.julia/v0.4/ParallelAccelerator/src/cgen.jl:1946
 in from_root at /home/etotoni/.julia/v0.4/ParallelAccelerator/src/cgen.jl:2296
 in from_worklist at /home/etotoni/.julia/v0.4/ParallelAccelerator/src/cgen.jl:2473
 in from_root at /home/etotoni/.julia/v0.4/ParallelAccelerator/src/cgen.jl:2386
 in from_root at /home/etotoni/.julia/v0.4/ParallelAccelerator/src/cgen.jl:2263
 in toCGen at /home/etotoni/.julia/v0.4/ParallelAccelerator/src/driver.jl:172
 in processFuncCall at /home/etotoni/.julia/v0.4/CompilerTools/src/OptFramework.jl:338
 in simple_rand at /home/etotoni/.julia/v0.4/CompilerTools/src/OptFramework.jl:400
 in test1 at /home/etotoni/.julia/v0.4/ParallelAccelerator/test/rand.jl:47
 in include at ./boot.jl:261
 in include_from_node1 at ./loading.jl:304
 in include at ./boot.jl:261
 in include_from_node1 at ./loading.jl:304
 in process_options at ./client.jl:308
 in _start at ./client.jl:411
ehsantn commented 8 years ago

Seems like Pkg.test(...;coverage=true) automatically sets --inline=no which causes issues for ParallelAccelerator since inlined AST is assumed for input from code_typed. Using --code-coverage=user fixes this. We need to find a solution for this since inlining decreases the coverage accuracy.

ehsantn commented 8 years ago

Inlining doesn't seem to decrease coverage accuracy too much for ParallelAccelerator.