def doStartProcess(self, *args, **kwargs): """ Action method. """ os.environ['PYTHONUNBUFFERED'] = '1' ncpus = bpio.detect_number_of_cpu_cores() if ncpus > 1: # do not use all CPU cors at once # need to keep at least one for all other operations # even decided to use only half of CPUs at the moment # TODO: make an option in the software settings ncpus = int(ncpus / 2.0) if True: from parallelp import pp self.processor = pp.Server( secret='bitdust', ncpus=ncpus, loglevel=lg.get_loging_level(_DebugLevel), logfile=settings.ParallelPLogFilename(), ) else: from raid import worker self.processor = worker.Manager(ncpus=ncpus) self.automat('process-started')
def doStartProcess(self, *args, **kwargs): """ Action method. """ ncpus = bpio.detect_number_of_cpu_cores() if ncpus > 1: # do not use all CPU cors at once # need to keep at least one for all other operations # even decided to use only half of CPUs at the moment # TODO: make an option in the software settings ncpus = int(ncpus / 2.0) if bpio.Android() or not config.conf().getBool( 'services/rebuilding/child-processes-enabled'): self.processor = ThreadedRaidProcessor() else: os.environ['PYTHONUNBUFFERED'] = '1' from parallelp import pp self.processor = pp.Server( secret='bitdust', ncpus=ncpus, loglevel=lg.get_loging_level(_DebugLevel), logfile=settings.ParallelPLogFilename(), ) # else: # from raid import worker # self.processor = worker.Manager(ncpus=ncpus) self.automat('process-started')
def doStartProcess(self, arg): """ Action method. """ os.environ['PYTHONUNBUFFERED'] = '1' ncpus = bpio.detect_number_of_cpu_cores() if ncpus > 1: # do not use all CPU cors at once # need to keep at least one for all other operations # even decided to use only half of CPUs at the moment # TODO: make an option in the software settings ncpus = int(ncpus / 2.0) self.processor = pp.Server(secret='bitdust', ncpus=ncpus, loglevel=lg.get_loging_level()) self.automat('process-started')