sbromberger / LightGraphs.jl

An optimized graphs package for the Julia programming language
Other
672 stars 185 forks source link

Pkg.test failed on Julia v1.0.0 on a 32bit machine #985

Closed BoundaryValueProblems closed 6 years ago

BoundaryValueProblems commented 6 years ago

I could successfully added LightGraphs.jl on my laptops after upgrading Julia from v0.6.4 to v0.7.0/v1.0.0. Then, I tried Pkg.test("LightGraphs"), and it completed without any error on my MacBook Pro (64 bit, OS X 10.11.6). However, on my 32 bit Linux machine (Ubuntu 16.04.4 LTS), the test failed with the following errors, which all seem to me related to Int32 vs Int64 mismatches.

...
Graph matrices: Error During Test at /home/xxx/.julia/packages/LightGraphs/RFHAr/test/linalg/graphmatrices.jl:3
  Got exception outside of a @test
  MethodError: no method matching CombinatorialAdjacency(::SparseMatrixCSC{Float64,Int32})
  Closest candidates are:
    CombinatorialAdjacency(!Matched::SparseMatrixCSC{T,Int64}) where T at /home/saito/.julia/packages/LightGraphs/RFHAr/src/linalg/graphmatrices.jl:38
...
Parallel.Betweenness: Error During Test at /home/xxx/.julia/packages/LightGraphs/RFHAr/test/parallel/centrality/betweenness.jl:1
  Got exception outside of a @test
  MethodError: no method matching _rescale!(::Array{Float64,1}, ::Int64, ::Bool, ::Bool, ::Int64)
  Closest candidates are:
    _rescale!(::Array{Float64,1}, ::Integer, ::Bool, ::Bool, !Matched::Int32) at /home/saito/.julia/packages/LightGraphs/RFHAr/src/centrality/betweenness.jl:119
...
Parallel.Radiality: Error During Test at /home/xxx/.julia/packages/LightGraphs/RFHAr/test/parallel/centrality/radiality.jl:1
  Got exception outside of a @test
  MethodError: no method matching splitrange(::Int64, ::Int32)
  Closest candidates are:
    splitrange(!Matched::Int32, ::Int32) at /buildworker/worker/package_linux32/build/usr/share/julia/stdlib/v1.0/Distributed/src/macros.jl:235
  (::getfield(Distributed, Symbol("##169#171")){getfield(LightGraphs.Parallel, Symbol("##21#22")){SimpleDiGraph{Int64},Int64,UnitRange{Int64},SharedArrays.SharedArray{Float64,1},SharedArrays.SharedArray{Float64,1}},UnitRange{Int64}})() at ./task.jl:244
...
Parallel.Stress: Error During Test at /home/xxx/.julia/packages/LightGraphs/RFHAr/test/parallel/centrality/stress.jl:1
  Got exception outside of a @test
  MethodError: no method matching splitrange(::Int64, ::Int32)
  Closest candidates are:
    splitrange(!Matched::Int32, ::Int32) at /buildworker/worker/package_linux32/build/usr/share/julia/stdlib/v1.0/Distributed/src/macros.jl:235
...
Betweenness: Error During Test at /home/xxx/.julia/packages/LightGraphs/RFHAr/test/centrality/betweenness.jl:1
  Got exception outside of a @test
  MethodError: no method matching _rescale!(::Array{Float64,1}, ::Int64, ::Bool, ::Bool, ::Int64)
  Closest candidates are:
    _rescale!(::Array{Float64,1}, ::Integer, ::Bool, ::Bool, !Matched::Int32) at /home/xxx/.julia/packages/LightGraphs/RFHAr/src/centrality/betweenness.jl:119
...
Test Summary:                  |  Pass  Error  Total
LightGraphs                    | 29303      5  29308
  LightGraphs.SimpleGraphs     |  4283          4283
  LightGraphs.LinAlg           |   294      1    295
    Graph matrices             |            1      1
    Spectral                   |   294           294
  LightGraphs.Parallel         |   496      3    499
    Parallel.Betweenness       |            1      1
    Parallel.Closeness         |    24            24
    Parallel.Pagerank          |    54            54
    Parallel.Radiality         |            1      1
    Parallel.Stress            |            1      1
    Parallel.Distance          |    30            30
    Parallel.Bellman Ford      |    42            42
    Parallel.Dijkstra          |   243           243
    Parallel.Floyd Warshall    |    24            24
    Parallel.Johnson           |    24            24
    Parallel.BFS               |    25            25
    Parallel.Greedy Coloring   |    30            30
  Interface                    |    19            19
  Core                         |   122           122
  Operators                    |   324           324
  Decomposition                |    48            48
  Distance                     |    36            36
  Transitivity                 |    57            57
  Hadwick-James Cycles         |    21            21
  Cycles                       |    30            30
  Karp Minimum Cycle Mean      |    30            30
  Cycle Basis                  |    57            57
  Edit distance                |   240           240
  Connectivity                 |   260           260
  Persistence                  |    15            15
  A star                       |    18            18
  Bellman Ford                 |    48            48
  Dijkstra                     |    48            48
  Johnson                      |    24            24
  Floyd Warshall               |    24            24
  Yen                          |    72            72
  BFS                          |    75            75
  Bipartiteness                |    27            27
  Greedy Coloring              |    30            30
  DFS                          |    24            24
  Max adj visit                |    33            33
  Random walks                 | 21879         21879
  Diffusion Simulation         |    57            57
  Cliques                      |    12            12
  Core periphery               |    93            93
  Label propagation            |    24            24
  Modularity                   |     6             6
  Clustering                   |    18            18
  Clique percolation           |     1             1
  Betweenness                  |            1      1
  Closeness                    |    24            24
  Degree                       |     9             9
  Katz                         |     3             3
  Pagerank                     |    54            54
  Eigenvector                  |     6             6
  Stress                       |    12            12
  Radiality                    |     6             6
  Utils                        |    48            48
  Generate Reduce              |     6             6
  Greedy Contiguous Partition  |     3             3
  Optimal Contiguous Partition |     3             3
  Kruskal                      |     6             6
  Prim                         |     6             6
  Articulation                 |    24            24
  Biconnect                    |     6             6
  Normalized Cut               |    29            29
  Experimental                 |   212           212
ERROR: LoadError: Some tests did not pass: 29303 passed, 0 failed, 5 errored, 0 broken.

Thanks for your help!

sbromberger commented 6 years ago

Yeah, I suspected we'd have an issue with this. I think the best (easiest) course of action is to change all the Ints to Int64s.

@jpfairbanks - aside from killing performance on 32-bit machines, do you see any other drawbacks?

sbromberger commented 6 years ago

On second thought, these just look like errors in the test code. Let me look into this a bit more.

sbromberger commented 6 years ago

@BoundaryValueProblems - we're working on this. sorry for the delay.

ChrisRackauckas commented 6 years ago

32-bit tests are passing in https://github.com/JuliaGraphs/LightGraphs.jl/pull/999 . It is a bit more complicated than making everything Int since overflow seems to be possible as indicated by some failing accuracy tests, so there are some hardcoded default upconversions to Int64 in that PR in places which are required. In addition, the splitrange issue is a bad interaction in the Julia stdlib which got a PR ( https://github.com/JuliaLang/julia/pull/28865) but for now we can work around it by doing an Int conversion on any collection that is @distributed for looped over.

BoundaryValueProblems commented 6 years ago

@ChrisRackauckas and @sbromberger , I just want to point out that the current master branch still gives me one error on my 32 bit linux machine as I reported at https://github.com/JuliaGraphs/LightGraphs.jl/pull/999#issuecomment-416012707 Thanks for your help!

ChrisRackauckas commented 6 years ago

This should fix it https://github.com/JuliaGraphs/LightGraphs.jl/pull/1004 , but it's hard to test since CI doesn't have 32-bit Linux. Can you test that PR locally?

BoundaryValueProblems commented 6 years ago

@ChrisRackauckas , I just tested it, and it worked, i.e., the test passed without any error! Thanks a lot!!