JuliaParallel / Blocks.jl

A framework to represent chunks of entities and parallel methods on them.
MIT License
30 stars 6 forks source link

./julia ~/.julia/Blocks/test/runtests.jl fails #6

Closed rickhg12hs closed 10 years ago

rickhg12hs commented 10 years ago
$ ./julia ~/.julia/Blocks/test/runtests.jl 
loading packages...

WARNING: deprecated syntax "x[i:]" at /home/rick/.julia/DataFrames/src/formula.jl:58.
Use "x[i:end]" instead.

WARNING: deprecated syntax "x[i:]" at /home/rick/.julia/DataFrames/src/formula.jl:71.
Use "x[i:end]" instead.

WARNING: deprecated syntax "x[i:]" at /home/rick/.julia/DataFrames/src/formula.jl:77.
Use "x[i:end]" instead.

WARNING: deprecated syntax "x[i:]" at /home/rick/.julia/DataFrames/src/formula.jl:92.
Use "x[i:end]" instead.

WARNING: deprecated syntax "x[i:]" at /home/rick/.julia/DataFrames/src/formula.jl:106.
Use "x[i:end]" instead.

WARNING: deprecated syntax "x[i:]" at /home/rick/.julia/DataFrames/src/formula.jl:111.
Use "x[i:end]" instead.

WARNING: deprecated syntax "x[i:]" at /home/rick/.julia/DataFrames/src/formula.jl:122.
Use "x[i:end]" instead.
running tests...
    pmap array->array...
ERROR: assertion failed: :((ret==exp_res))
 in testfn at /home/rick/.julia/Blocks/test/test.jl:9
 in do_all_tests at /home/rick/.julia/Blocks/test/test.jl:47
 in include_from_node1 at loading.jl:120
while loading /home/rick/.julia/Blocks/test/test.jl, in expression starting on line 59
while loading /home/rick/.julia/Blocks/test/runtests.jl, in expression starting on line 1

$ ./julia -e 'versioninfo()'
Julia Version 0.3.0-prerelease+1241
Commit 9bd4618* (2014-01-26 07:31 UTC)
Platform Info:
  System: Linux (i686-redhat-linux)
  CPU: Genuine Intel(R) CPU           T2250  @ 1.73GHz
  WORD_SIZE: 32
  BLAS: libopenblas (DYNAMIC_ARCH NO_AFFINITY)
  LAPACK: libopenblas
  LIBM: libopenlibm
tanmaykm commented 10 years ago

Thanks for reporting. I am not able to replicate this. I am on:

Julia Version 0.3.0-prerelease+1261
Commit 16d9ef6* (2014-01-27 05:40 UTC)
Platform Info:
  System: Darwin (x86_64-apple-darwin13.0.0)
  CPU: Intel(R) Core(TM)2 Duo CPU     P7550  @ 2.26GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY)
  LAPACK: libopenblas
  LIBM: libopenlibm

Looks like it's due to an integer overflow? You are on a 32bit system. Can you please re-run the tests by changing the ranges from 1:1000000 to 1:1000 in test.jl lines 19 and 20? The result then should be changed to match 1001000 in lines 47 and 48.

rickhg12hs commented 10 years ago

Running the very latest Julia and Blocks master branch, errors are still encountered.

I had to run the test from the test directory so that test.csv could be found (error otherwise).

$ pwd
/home/rick/.julia/Blocks/test
$ /usr/local/src/julia/julia/julia runtests.jl
loading packages...
running tests...
        pmap array->array...
                result: 1001000
                result: 1001000
                time: 8.807799999999999e-5
        map array->array...
                result: 1001000
                result: 1001000
                time: 3.22671e-5
        pmap array->array...
                result: 1001000
                result: 1001000
                time: 0.0002742981
        map array->array...
                result: 1001000
                result: 1001000
                time: 0.0001310169
        pmap file->iostream...
ERROR: no method splitrange(Int64, Int32) in Block at /home/rick/.julia/Blocks/src/block_framework.jl:194
 in Block at /home/rick/.julia/Blocks/src/block_framework.jl:215
 in f_ios_pmap at /home/rick/.julia/Blocks/test/test.jl:23
 in testfn at /home/rick/.julia/Blocks/test/test.jl:8
 in do_all_tests at /home/rick/.julia/Blocks/test/test.jl:51
 in include_from_node1 at loading.jl:120
while loading /home/rick/.julia/Blocks/test/test.jl,
in expression starting on line 59
while loading /home/rick/.julia/Blocks/test/runtests.jl, in expression starting on line 1
tanmaykm commented 10 years ago

Ok. So the first test passed now, but it failed in the fifth. This looks like another 32bit incompatibility; filesize returns an Int64 where as Base.splitrange takes Int32 on 32bit systems.

I have pushed a fix for now, and I hope there are no more such instances. I can get hold of a 32bit system only by tomorrow to run a full test. Please pull the master branch and check this out in the meantime.

rickhg12hs commented 10 years ago

If I run the tests from the test directory, all pass.

It would be convenient if the current directory was irrelevant for running the tests.

Pirating how the DSP'ers do it in ~/.julia/DSP/test/windows.jl here's how you could do it.

$ git diff
diff --git a/test/test.jl b/test/test.jl
index 618b3f0..6ce3150 100644
--- a/test/test.jl
+++ b/test/test.jl
@@ -1,6 +1,6 @@
 using Blocks

-const datafile = "test.csv"
+const datafile = joinpath(dirname(@__FILE__),"test.csv")
 const nloops = 10

 function testfn(f::Function, s::String, exp_res)
tanmaykm commented 10 years ago

Thanks! Done via https://github.com/tanmaykm/Blocks.jl/commit/06e2c3aadb775959ed94597ce807112bb15c8494. I shall bump the package sha1 in a few days if there are no further issues.

rickhg12hs commented 10 years ago

Ready for a bump?

tanmaykm commented 10 years ago

Done!

rickhg12hs commented 10 years ago

Yay! :+1:

rickhg12hs commented 10 years ago

Whoops!

~/.julia/METADATA/Blocks/versions/0.0.2/sha1 == ~/.julia/METADATA/Blocks/versions/0.0.1/sha1

tanmaykm commented 10 years ago

Sorry. I think I messed up Pkg.tag somehow. Will fix it in a few minutes.

tanmaykm commented 10 years ago

Thanks for pointing it out. I have corrected METADATA. Please try now.

rickhg12hs commented 10 years ago

Yep, works now! Thanks.