def run_tobacco_parallel(templates, CHARGES): apply_reindex(CHARGES) print('running parallel on', multiprocessing.cpu_count(), 'processors...') args = [template for template in templates] pool = multiprocessing.Pool(multiprocessing.cpu_count()) pool.map_async(run_template, args) pool.close() pool.join()
def run_tobacco_serial(templates, CHARGES): apply_reindex(CHARGES) if IGNORE_ERRORS: for template in templates: try: run_template(template) except Exception as e: print() print( '*****************************************************************' ) print('!!!!! ERROR for template :', template, ' !!!!!') print('!!!!! ', e, ' !!!!!') print( '*****************************************************************' ) print() else: for template in templates: run_template(template)
def run_tobacco_serial(templates, CHARGES): apply_reindex(CHARGES) for template in templates: run_template(template)
'Al': 18, 'Si': 19, 'P': 20, 'Cl': 21, 'Ar': 22, 'K': 23, 'Ca': 24, 'Sc': 24, 'Cr': 26, 'Mn': 27, 'Fe': 28, 'Co': 29, 'Ni': 30 } apply_reindex(CHARGES) for d in ['templates', 'nodes', 'edges']: try: os.remove(os.path.join(d, '.DS_store')) except: pass for template in os.listdir('templates'): print '' print '=========================================================================================================' print 'template :', template print '=========================================================================================================' print '' TG, unit_cell, TVT, TET, TNAME, a, b, c, ang_alpha, ang_beta, ang_gamma, max_le = ct2g(