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

Modify default call to pmap when paralellizing #243

Merged
merged 1 commit into from
Jun 10, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions src/core.jl
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,12 @@ function amg_solver_path(data::GraphData{T,V}, flags, cfg, log)::Matrix{T} where
f(1)
update_shortcut_resistances!(idx, shortcut, resistances, points, comp)
else
X = pmap(x ->f(x), 1:size(csub,1))
is_parallel = cfg["parallelize"] in TRUELIST
if is_parallel
X = pmap(x ->f(x), 1:size(csub,1))
else
X = map(x ->f(x), 1:size(csub,1))
end

# Set all resistances
for x in X
Expand Down Expand Up @@ -417,8 +422,13 @@ function _cholmod_solver_path(data::GraphData{T,V}, flags,
end
end


pmap(x -> f(x, rng, lhs), 1:length(rng))
is_parallel = cfg["parallelize"] in TRUELIST
if is_parallel
X = pmap(x -> f(x, rng, lhs), 1:length(rng))
else
X = map(x -> f(x, rng, lhs), 1:length(rng))
end

for (i,v) in enumerate(rng)
coords = cholmod_batch[v].points_idx
r = lhs[cholmod_batch[v].cc_idx[2], i] -
Expand Down