Skip to content

Commit 3e4d7ef

Browse files
committed
Move broken Parallel.gdistances function to Experimental submodule
1 parent abdfceb commit 3e4d7ef

File tree

9 files changed

+50
-22
lines changed

9 files changed

+50
-22
lines changed

src/Experimental/Experimental.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ description() = "This module contains experimental graph functions."
1515

1616
include("isomorphism.jl")
1717
include("vf2.jl") # Julian implementation of VF2 algorithm
18+
include("Parallel/Parallel.jl")
1819
include("Traversals/Traversals.jl")
1920
include("ShortestPaths/ShortestPaths.jl")
2021

src/Experimental/Parallel/Parallel.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module Parallel
2+
3+
using Graphs
4+
using Base.Threads: @threads, nthreads
5+
6+
include("traversals/gdistances.jl")
7+
8+
end

src/Parallel/traversals/gdistances.jl renamed to src/Experimental/Parallel/traversals/gdistances.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2+
# TODO the algorithms in this file probably relay on incorrect assumptions
3+
# about the memory handling of Julia.
4+
# See: https://github.com/JuliaGraphs/Graphs.jl/issues/10
5+
16
"""
27
partition_sources!(queue_list, sources)
38
@@ -40,6 +45,8 @@ function gdistances!(
4045
queue_segment_size::Integer=20
4146
) where T <:Integer
4247

48+
@warn "Graphs.Experimental.Parallel.gdistances is very likely broken at the moment and can return unreliable results."
49+
4350
nvg = nv(g)
4451
n_t = nthreads()
4552
segment_size = convert(T, queue_segment_size) # Type stability

src/Parallel/Parallel.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ include("centrality/radiality.jl")
2121
include("centrality/stress.jl")
2222
include("distance.jl")
2323
include("traversals/bfs.jl")
24-
include("traversals/gdistances.jl")
2524
include("traversals/greedy_color.jl")
2625
include("utils.jl")
2726
include("dominatingset/minimal_dom_set.jl")

test/experimental/experimental.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const exptestdir = dirname(@__FILE__)
2-
tests = ["isomorphism", "shortestpaths", "traversals"]
2+
tests = ["isomorphism", "parallel/runtests", "shortestpaths", "traversals"]
33

44
@testset "Experimental" begin
55
@test length(description()) > 1
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#using Graphs
2+
#using Graphs.Parallel
3+
#using Base.Threads: @threads, Atomic
4+
5+
tests = [
6+
# "traversals/gdistances", # TODO currently disabled as the code in gdistances seems to be broken
7+
]
8+
9+
@testset "Graphs.Experimental.Parallel" begin
10+
for t in tests
11+
tp = joinpath(dirname(@__FILE__), "$(t).jl")
12+
include(tp)
13+
end
14+
end
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
@testset "Experimental.Parallel.BFS" begin
2+
3+
4+
g5 = SimpleDiGraph(4)
5+
add_edge!(g5, 1, 2); add_edge!(g5, 2, 3); add_edge!(g5, 1, 3); add_edge!(g5, 3, 4)
6+
7+
for g in testdigraphs(g5)
8+
@test @inferred(Experimental.Parallel.gdistances(g, 1)) == gdistances(g, 1)
9+
@test @inferred(Experimental.Parallel.gdistances(g, [1, 3])) == gdistances(g, [1, 3])
10+
end
11+
12+
g6 = smallgraph(:house)
13+
14+
for g in testgraphs(g6)
15+
@test @inferred(Experimental.Parallel.gdistances(g, 2)) == gdistances(g, 2)
16+
@test @inferred(Experimental.Parallel.gdistances(g, [1, 2])) == gdistances(g, [1, 2])
17+
end
18+
19+
end

test/parallel/runtests.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ tests = [
1515
"shortestpaths/floyd-warshall",
1616
"shortestpaths/johnson",
1717
"traversals/bfs",
18-
"traversals/gdistances",
1918
"traversals/greedy_color",
2019
"dominatingset/minimal_dom_set",
2120
"independentset/maximal_ind_set",

test/parallel/traversals/gdistances.jl

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)