Skip to content

Commit 8e57118

Browse files
committed
Revert "Actually collect maps asynchronously"
This reverts commit 324eadb.
1 parent 983fa93 commit 8e57118

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

src/InverseProblems.jl

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,7 @@ Base.length(batch::BatchedInverseProblem) = length(batch.batch)
337337
Nensemble(batched_ip::BatchedInverseProblem) = Nensemble(first(batched_ip.batch))
338338

339339
function collect_forward_maps_asynchronously!(outputs, batched_ip, parameters; kw...)
340-
start_time = time_ns()
341-
340+
#=
342341
@sync begin
343342
for (n, ip) in enumerate(batched_ip.batch)
344343
@async begin
@@ -347,31 +346,25 @@ function collect_forward_maps_asynchronously!(outputs, batched_ip, parameters; k
347346
end
348347
end
349348
end
349+
=#
350350

351-
#=
352351
for (n, ip) in enumerate(batched_ip.batch)
353352
forward_map_output = forward_map(ip, parameters; suppress=false, kw...)
354353
outputs[n] = batched_ip.weights[n] * forward_map_output
355354
end
356-
=#
357-
358-
end_time = time_ns()
359-
elapsed = 1e-9 * (end_time - start_time)
360355

361-
return elapsed
356+
return outputs
362357
end
363358

364359
function forward_map(batched_ip::BatchedInverseProblem, parameters; suppress=true, kw...)
365360
outputs = Dict()
366361

367362
if suppress
368-
@suppress elapsed = collect_forward_maps_asynchronously!(outputs, batched_ip, parameters; kw...)
363+
@suppress collect_forward_maps_asynchronously!(outputs, batched_ip, parameters; kw...)
369364
else
370-
elapsed = collect_forward_maps_asynchronously!(outputs, batched_ip, parameters; kw...)
365+
collect_forward_maps_asynchronously!(outputs, batched_ip, parameters; kw...)
371366
end
372367

373-
@info "Forward map collection took " * prettytime(elapsed)
374-
375368
vectorized_outputs = [outputs[n] for n = 1:length(batched_ip)]
376369

377370
return vcat(vectorized_outputs...)

0 commit comments

Comments
 (0)