rlpyt icon indicating copy to clipboard operation
rlpyt copied to clipboard

Set number of workers in ParallelSamplerBase without setting affinities manually

Open bpiv400 opened this issue 4 years ago • 0 comments

Hi Adam,

When using a class that inherits from ParallelSamplerBase (e.g. CPUSampler), I set the number of workers by passing a list of cpu affinities into my runner in the worker_cpus key of the affinity dictionary. But I'd like to allow the operating system to choose which cpu(s) each worker gets assigned to, rather than setting this by hand.

It looks like that could be accomplished by setting the n_worker argument to ParallelSamplerBase._get_n_envs_list, but when the function is called in initialize, the n_worker argument isn't given. Is there a good reason for this that I'm not thinking of? If not, could I submit a pull request to add the functionality?

bpiv400 avatar May 01 '20 15:05 bpiv400