@@ -337,8 +337,7 @@ Base.length(batch::BatchedInverseProblem) = length(batch.batch)
337
337
Nensemble (batched_ip:: BatchedInverseProblem ) = Nensemble (first (batched_ip. batch))
338
338
339
339
function collect_forward_maps_asynchronously! (outputs, batched_ip, parameters; kw... )
340
- start_time = time_ns ()
341
-
340
+ #=
342
341
@sync begin
343
342
for (n, ip) in enumerate(batched_ip.batch)
344
343
@async begin
@@ -347,31 +346,25 @@ function collect_forward_maps_asynchronously!(outputs, batched_ip, parameters; k
347
346
end
348
347
end
349
348
end
349
+ =#
350
350
351
- #=
352
351
for (n, ip) in enumerate (batched_ip. batch)
353
352
forward_map_output = forward_map (ip, parameters; suppress= false , kw... )
354
353
outputs[n] = batched_ip. weights[n] * forward_map_output
355
354
end
356
- =#
357
-
358
- end_time = time_ns ()
359
- elapsed = 1e-9 * (end_time - start_time)
360
355
361
- return elapsed
356
+ return outputs
362
357
end
363
358
364
359
function forward_map (batched_ip:: BatchedInverseProblem , parameters; suppress= true , kw... )
365
360
outputs = Dict ()
366
361
367
362
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... )
369
364
else
370
- elapsed = collect_forward_maps_asynchronously! (outputs, batched_ip, parameters; kw... )
365
+ collect_forward_maps_asynchronously! (outputs, batched_ip, parameters; kw... )
371
366
end
372
367
373
- @info " Forward map collection took " * prettytime (elapsed)
374
-
375
368
vectorized_outputs = [outputs[n] for n = 1 : length (batched_ip)]
376
369
377
370
return vcat (vectorized_outputs... )
0 commit comments