def __init__(self, builders, num_workers=0, processor=None):
"""
Initialize with a list of builders
Args:
builders(list): list of builders
num_workers (int): number of processes. Used only for multiprocessing.
Will be automatically set to (number of cpus - 1) if set to 0.
processor(BaseProcessor): set this if custom processor is needed(must
subclass BaseProcessor though)
"""
self.builders = builders
self.num_workers = num_workers
self.logger = logging.getLogger(type(self).__name__)
self.logger.addHandler(logging.NullHandler())
default_processor = MPIProcessor(
builders) if self.use_mpi else MultiprocProcessor(builders, num_workers)
self.processor = default_processor if processor is None else processor
self.dependency_graph = self._get_builder_dependency_graph()
self.has_run = [] # for bookkeeping builder runs
评论列表
文章目录