I am trying to run simulations in parallel but also have an updates on the simulation on the main thread. I basically have the following code:
function calibration()
numofsims = 10
siminfo = RemoteChannel(()->Channel{Tuple}(numofsims));
@showprogress pmap(1:numofsims) do x
simulation(x, siminfo)
end
## make `pmap` not blocking so i can do stuff with `sims` as information is put in the channel.
end
As you can see, each independent simulation simulation()
is given the RemoteChannel
as an argument. The function then updates this channel with some information about the work that’s happening. It would be nice if pmap
was not blocking so I can run some sort of analysis as the RemoteChannel
is fed with information.
Any ideas how to accomplish this?