else: print 'can not find any simulations!' sys.exit(-1) else: for dat in dats: loop_part(os.path.dirname(dat)) else: for chk in chks: loop_part(os.path.dirname(chk)) else: for part in parts: loop_part(part) else: for sim in sims: loop_sim(sim) else: for run in runs: loop_run(run) else: for system in systems: loop_system(system) if opts.d: print '' for not_done in results['not_done']: loop_part(not_done, record=False) print '' print '(' + ccodes.f('done' ) + '=' + ccodes.g('%d' % len(results['done' ])) + ')' + ' : ' + \ '(' + ccodes.f('not done') + '=' + ccodes.r('%d' % len(results['not_done'])) + ')'
part_id = lm.regex.part(part_relpath) new_part = os.path.join(os.path.dirname(part), 'part.%d' % (part_id + 1)) if os.path.exists(new_part): print ccodes.red('error:') + ' ' + ccodes.blue('part already exists?') + ' ' + \ ccodes.blue(os.path.relpath(new_part, work)) errors += 1 continue if opts.ok: os.mkdir(new_part) chk.save(os.path.join(new_part, 'sim.inp')) new_parts.append(new_part) print ' ' + ccodes.cyan(os.path.relpath(new_part, work)) + ' ' + \ '(' + 'current.step=' + ccodes.cyan('%d' % cstep) + ')' + ' ' + \ '(' + 'iterations.real=' + ccodes.cyan('%d' % tstep) + ')' + ' ' + \ '(' + 'iterations.print=' + ccodes.cyan('%d' % pstep) + ')' print '' print 'old sims:', ccodes.c('%d' % len(parts)) print 'new sims:', ccodes.c('%d' % len(new_parts)) print 'errors :', ccodes.c('%d' % errors) if not opts.ok: print '' print ccodes.r('warning: nothing was done, use --ok to turn off dry run') else: if new_parts: lm.common.command_script(new_parts, name=opts.name, stub=opts.stub)
'part.%d' % (part_id + 1)) if os.path.exists(new_part): print ccodes.red('error:') + ' ' + ccodes.blue('part already exists?') + ' ' + \ ccodes.blue(os.path.relpath(new_part, work)) errors += 1 continue if opts.ok: os.mkdir(new_part) chk.save(os.path.join(new_part, 'sim.inp')) new_parts.append(new_part) print ' ' + ccodes.cyan(os.path.relpath(new_part, work)) + ' ' + \ '(' + 'current.step=' + ccodes.cyan('%d' % cstep) + ')' + ' ' + \ '(' + 'iterations.real=' + ccodes.cyan('%d' % tstep) + ')' + ' ' + \ '(' + 'iterations.print=' + ccodes.cyan('%d' % pstep) + ')' print '' print 'old sims:', ccodes.c('%d' % len(parts)) print 'new sims:', ccodes.c('%d' % len(new_parts)) print 'errors :', ccodes.c('%d' % errors) if not opts.ok: print '' print ccodes.r( 'warning: nothing was done, use --ok to turn off dry run') else: if new_parts: lm.common.command_script(new_parts, name=opts.name, stub=opts.stub)