def precompute_cache_for_person(person_ids=None, all_persons=False, only_expired=False): pids = set() if all_persons: pids = get_existing_authors(with_papers_only=True) elif only_expired: pids = set(get_expired_person_ids()) if person_ids: pids |= set(person_ids) empty_pids = remove_empty_authors(remove=False) pids = pids - empty_pids last = len(pids) global IS_BATCH_PROCESS IS_BATCH_PROCESS = True for i, p in enumerate(pids): # start = time() print 'Doing ', i, ' of ', last #print 'STARTED: ', p, ' ', i _compute_cache_for_person(p) #print 'DONE: ', p , ',' , str(time() - start) IS_BATCH_PROCESS = False
def precompute_cache_for_person(person_ids=None, all_persons=False, only_expired=False): pids = [] if all_persons: pids = list(get_existing_personids(with_papers_only=True)) elif only_expired: pids = get_expired_person_ids() if person_ids: pids += person_ids for p in pids: _compute_cache_for_person(p)
def multiprocessing_precompute_cache_for_person(person_ids=None, all_persons=False, only_expired=False): pids = set() if all_persons: pids = get_existing_authors(with_papers_only=True) elif only_expired: pids = set(get_expired_person_ids()) if person_ids: pids |= person_ids from multiprocessing import Pool p = Pool() p.map(_compute_cache_for_person, pids)
def multiprocessing_precompute_cache_for_person(person_ids=None, all_persons=False, only_expired=False): pids = [] if all_persons: pids = list(get_existing_personids(with_papers_only=True)) elif only_expired: pids = get_expired_person_ids() if person_ids: pids += person_ids from multiprocessing import Pool p = Pool() p.map(_compute_cache_for_person, pids)
def _task_run_core(): """ Runs the requested task in the bibsched environment. """ all_pids = bibtask.task_get_option('all_pids', False) mp = bibtask.task_get_option('mp', False) if all_pids: pids = list(get_existing_personids(with_papers_only=True)) else: pids = get_expired_person_ids() if mp: compute_cache_mp(pids) else: compute_cache(pids) return 1
def precompute_cache_for_person(person_ids=None, all_persons=False, only_expired=False): pids = set() if all_persons: pids = get_existing_authors(with_papers_only=True) elif only_expired: pids = set(get_expired_person_ids()) if person_ids: pids |= person_ids empty_pids = remove_empty_authors(remove=False) pids = pids - empty_pids last = len(pids) global IS_BATCH_PROCESS IS_BATCH_PROCESS = True for i, p in enumerate(pids): # start = time() print 'Doing ', i,' of ', last #print 'STARTED: ', p, ' ', i _compute_cache_for_person(p) #print 'DONE: ', p , ',' , str(time() - start) IS_BATCH_PROCESS = False