Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

readdlm issue with medium sized array #6952

Closed
kmsquire opened this issue May 24, 2014 · 2 comments
Closed

readdlm issue with medium sized array #6952

kmsquire opened this issue May 24, 2014 · 2 comments
Assignees

Comments

@kmsquire
Copy link
Member

I'm getting a strange error when reading a medium-sized float64 array:

julia> a = ones(25, 120)
25x120 Array{Float64,2}:
 1.0  1.0  1.0  1.0  1.0  1.0  1.0  1.0    1.0  1.0  1.0  1.0  1.0  1.0  1.0
 1.0  1.0  1.0  1.0  1.0  1.0  1.0  1.0     1.0  1.0  1.0  1.0  1.0  1.0  1.0
 1.0  1.0  1.0  1.0  1.0  1.0  1.0  1.0     1.0  1.0  1.0  1.0  1.0  1.0  1.0
 1.0  1.0  1.0  1.0  1.0  1.0  1.0  1.0     1.0  1.0  1.0  1.0  1.0  1.0  1.0
 1.0  1.0  1.0  1.0  1.0  1.0  1.0  1.0     1.0  1.0  1.0  1.0  1.0  1.0  1.0
 1.0  1.0  1.0  1.0  1.0  1.0  1.0  1.0    1.0  1.0  1.0  1.0  1.0  1.0  1.0
 1.0  1.0  1.0  1.0  1.0  1.0  1.0  1.0     1.0  1.0  1.0  1.0  1.0  1.0  1.0
 1.0  1.0  1.0  1.0  1.0  1.0  1.0  1.0     1.0  1.0  1.0  1.0  1.0  1.0  1.0
 1.0  1.0  1.0  1.0  1.0  1.0  1.0  1.0     1.0  1.0  1.0  1.0  1.0  1.0  1.0
 1.0  1.0  1.0  1.0  1.0  1.0  1.0  1.0     1.0  1.0  1.0  1.0  1.0  1.0  1.0
                                                                         
 1.0  1.0  1.0  1.0  1.0  1.0  1.0  1.0    1.0  1.0  1.0  1.0  1.0  1.0  1.0
 1.0  1.0  1.0  1.0  1.0  1.0  1.0  1.0     1.0  1.0  1.0  1.0  1.0  1.0  1.0
 1.0  1.0  1.0  1.0  1.0  1.0  1.0  1.0     1.0  1.0  1.0  1.0  1.0  1.0  1.0
 1.0  1.0  1.0  1.0  1.0  1.0  1.0  1.0     1.0  1.0  1.0  1.0  1.0  1.0  1.0
 1.0  1.0  1.0  1.0  1.0  1.0  1.0  1.0     1.0  1.0  1.0  1.0  1.0  1.0  1.0
 1.0  1.0  1.0  1.0  1.0  1.0  1.0  1.0    1.0  1.0  1.0  1.0  1.0  1.0  1.0
 1.0  1.0  1.0  1.0  1.0  1.0  1.0  1.0     1.0  1.0  1.0  1.0  1.0  1.0  1.0
 1.0  1.0  1.0  1.0  1.0  1.0  1.0  1.0     1.0  1.0  1.0  1.0  1.0  1.0  1.0
 1.0  1.0  1.0  1.0  1.0  1.0  1.0  1.0     1.0  1.0  1.0  1.0  1.0  1.0  1.0
 1.0  1.0  1.0  1.0  1.0  1.0  1.0  1.0     1.0  1.0  1.0  1.0  1.0  1.0  1.0

julia> io = IOBuffer()
IOBuffer(Uint8[],true,true,true,false,0,9223372036854775807,1)

julia> writedlm(io, a)

julia> seek(io, 0)
IOBuffer(Uint8[0x31,0x09,0x31,0x09,0x31,0x09,0x31,0x09,0x31,0x09    0x31,0x09,0x31,0x09,0x31,0x09,0x31,0x09,0x31,0x0a],true,true,true,false,6000,9223372036854775807,1)

julia> b = readdlm(io)
25x120 Array{Any,2}:
 1.0  1.0  1.0  1.0  1.0  1.0  1.0  1.0    1.0  1.0  1.0  1.0  1.0  1.0  1.0
 1.0  1.0  1.0  1.0  1.0  1.0  1.0  1.0     1.0  1.0  1.0  1.0  1.0  1.0  1.0
 1.0  1.0  1.0  1.0  1.0  1.0  1.0  1.0     1.0  1.0  1.0  1.0  1.0  1.0  1.0
 1.0  1.0  1.0  1.0  1.0  1.0  1.0  1.0     1.0  1.0  1.0  1.0  1.0  1.0  1.0
 1.0  1.0  1.0  1.0  1.0  1.0  1.0  1.0     1.0  1.0  1.0  1.0  1.0  1.0  1.0
 1.0  1.0  1.0  1.0  1.0  1.0  1.0  1.0    1.0  1.0  1.0  1.0  1.0  1.0  1.0
 1.0  1.0  1.0  1.0  1.0  1.0  1.0  1.0     1.0  1.0  1.0  1.0  1.0  1.0  1.0
 1.0  1.0  1.0  1.0  1.0  1.0  1.0  1.0     1.0  1.0  1.0  1.0  1.0  1.0  1.0
 1.0  1.0  1.0  1.0  1.0  1.0  1.0  1.0     1.0  1.0  1.0  1.0  1.0  1.0  1.0
 1.0  1.0  1.0  1.0  1.0  1.0  1.0  1.0     1.0  1.0  1.0  1.0  1.0  1.0  1.0
                                                                         
 1.0  1.0  1.0  1.0  1.0  1.0  1.0  1.0    1.0  1.0  1.0  1.0  1.0  1.0  1.0
 1.0  1.0  1.0  1.0  1.0  1.0  1.0  1.0      ""   ""   ""   ""   ""   ""   ""
  ""   ""   ""   ""   ""   ""   ""   ""      ""   ""   ""   ""   ""   ""   ""
  ""   ""   ""   ""   ""   ""   ""   ""      ""   ""   ""   ""   ""   ""   ""
  ""   ""   ""   ""   ""   ""   ""   ""      ""   ""   ""   ""   ""   ""   ""
  ""   ""   ""   ""   ""   ""   ""   ""     ""   ""   ""   ""   ""   ""   ""
  ""   ""   ""   ""   ""   ""   ""   ""      ""   ""   ""   ""   ""   ""   ""
  ""   ""   ""   ""   ""   ""   ""   ""      ""   ""   ""   ""   ""   ""   ""
  ""   ""   ""   ""   ""   ""   ""   ""      ""   ""   ""   ""   ""   ""   ""
  ""   ""   ""   ""   ""   ""   ""   ""      ""   ""   ""   ""   ""   ""   ""

Smaller arrays (even one row or one column smaller) are read fine.

I'm running on a version of Julia compiled today:

julia> versioninfo()
Julia Version 0.3.0-prerelease+3184
Commit 6e56c9d* (2014-05-23 21:28 UTC)
Platform Info:
  System: Linux (x86_64-linux-gnu)
  CPU: Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY)
  LAPACK: libopenblas
  LIBM: libopenlibm

I haven't had time to triage yet, but possibly related to #6718.
cc: @tanmaykm

@kmsquire
Copy link
Member Author

git bisect blames 258fa8a (#6902).

tanmaykm added a commit that referenced this issue May 24, 2014
@cbecker
Copy link
Contributor

cbecker commented May 24, 2014

It would be good to add that test in test/readdlm.jl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants