change to pmap step in computeNextIteration
Hi -
I modified the pmap step in computeNextIteration! to only parallellize the objective function evaluation step (not the accept / reject or proposal steps). This avoids having to pass the entire chain to the workers. I was running into problems where the evaluation slowed down over time and eventually failed with a bus error because the chain objects get very large. I think this should solve that problem.
Greg
sounds like a good idea! thanks!
This actually doesn't go far enough. pmap still gets passed a reference to the chain object, which is growing over time. Will update shortly to fix that.
hey how are we doing with this? good to merge?
This change by itself doesn't give much of a memory improvement. To get any improvement it's necessary to use CachingPool. I couldn't figure out a way to do this cleanly. My current version of the code defines a global pool wp which gets passed to pmap in computeNextIteration!:
evs = pmap(x -> evaluateObjective(algo.m, x), wp, pps)
But this solution doesn't make a lot of sense for library use.
I've added an option to AlgoBGP.opts, "worker_pool", that allows the user to specify a worker pool to use for distributed computation. This gets passed to the pmap step in computeNextIteration!. This branch also has a few other additions, like the possibility of passing additional arguments to the objective function as keyword options.