Skip to content

Commit

Permalink
work around splitrange issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Aug 24, 2018
1 parent 9f793c7 commit 58cbcf8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Parallel/centrality/betweenness.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function betweenness_centrality(g::AbstractGraph,

# Parallel reduction

betweenness = @distributed (+) for s in vs
betweenness = @distributed (+) for s in Int.(vs)
temp_betweenness = zeros(n_v)
if degree(g, s) > 0 # this might be 1?
state = LightGraphs.dijkstra_shortest_paths(g, s, distmx; allpaths=true, trackvertices=true)
Expand Down
2 changes: 1 addition & 1 deletion src/Parallel/centrality/radiality.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function radiality_centrality(g::AbstractGraph)::Vector{Float64}
meandists = SharedVector{Float64}(Int(n_v))
maxdists = SharedVector{Float64}(Int(n_v))

@sync @distributed for i = 1:n_v
@sync @distributed for i = 1:Int(n_v)
d = LightGraphs.dijkstra_shortest_paths(g, vs[i])
maxdists[i] = maximum(d.dists)
meandists[i] = sum(d.dists) / (n_v - 1)
Expand Down
6 changes: 3 additions & 3 deletions src/Parallel/centrality/stress.jl
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
function stress_centrality(g::AbstractGraph,
vs::AbstractVector=vertices(g))::Vector{Int64}
vs::AbstractVector=vertices(g))::Vector{Int}

n_v = nv(g)
k = length(vs)
isdir = is_directed(g)

# Parallel reduction
stress = @distributed (+) for s in vs
temp_stress = zeros(Int64, n_v)
stress = @distributed (+) for s in Int.(vs)
temp_stress = zeros(Int, n_v)
if degree(g, s) > 0 # this might be 1?
state = LightGraphs.dijkstra_shortest_paths(g, s; allpaths=true, trackvertices=true)
LightGraphs._stress_accumulate_basic!(temp_stress, state, g, s)
Expand Down

0 comments on commit 58cbcf8

Please sign in to comment.