[docs]classFuturesExecutor(BaseExecutor):"""Futures executor Uses ``concurrent.futures`` to parallelize execution over CPU cores on the same node where the benchmark is launched. """
[docs]def_execute(self,func,args,**kwargs):"""Execute ``func`` over ``args`` in parallel using ``concurrent.futures.ThreadPoolExecutor``. :meta public: """withfutures.ThreadPoolExecutor()asexecutor:self.max_workers=executor._max_workersresults=list(executor.map(lambdaarg:func(arg,**kwargs),args))returnresults