def main():
profiledir = '<STR_LIT>'<EOL>if not os.path.isdir(profiledir):<EOL><INDENT>os.mkdir(profiledir)<EOL><DEDENT>print("<STR_LIT>".format(profiledir))<EOL>alignment = '<STR_LIT>'<EOL>tree = '<STR_LIT>'<EOL>prefs = '<STR_LIT>'<EOL>print("<STR_LIT>".format('<STR_LIT>'.join(<EOL>[alignment, tree, prefs])))<EOL>ncpus = max(<NUM_LIT:1>, multiprocessing.cpu_count() - <NUM_LIT:1>)<EOL>print("<STR_LIT>".format(ncpus))<EOL>pool = {}<EOL>for (name1, model, baseargs) in [<EOL>('<STR_LIT>', '<STR_LIT>', []),<EOL>('<STR_LIT>', '<STR_LIT>', []),<EOL>('<STR_LIT>', '<STR_LIT>'.format(prefs), []),<EOL>('<STR_LIT>', '<STR_LIT>'.format(prefs), ['<STR_LIT>']),<EOL>('<STR_LIT>', '<STR_LIT>'.format(prefs), ['<STR_LIT>']),<EOL>]:<EOL><INDENT>for (brlen, brlenargs) in [<EOL>('<STR_LIT>', ['<STR_LIT>', '<STR_LIT>']),<EOL>('<STR_LIT>', ['<STR_LIT>', '<STR_LIT>']),<EOL>]:<EOL><INDENT>args = baseargs + brlenargs<EOL><INDENT>args.append('<STR_LIT>')<EOL><DEDENT>name = '<STR_LIT>'.format(name1, brlen)<EOL>outprefix = '<STR_LIT>'.format(profiledir, name)<EOL>for f in glob.glob('<STR_LIT>'.format(outprefix)):<EOL><INDENT>os.remove(f)<EOL><DEDENT>cmd = ['<STR_LIT>', alignment, tree, model, outprefix, '<STR_LIT>'] + args<EOL>pool[name] = multiprocessing.Process(target=subprocess.check_call, <EOL>args=(cmd,), kwargs={'<STR_LIT>':subprocess.PIPE, <EOL>'<STR_LIT>':subprocess.PIPE})<EOL><DEDENT><DEDENT>started = dict([(name, False) for name in pool])<EOL>completed = dict([(name, False) for name in pool])<EOL>while not all(completed.values()):<EOL><INDENT>nrunning = (list(started.values()).count(True) - <EOL>list(completed.values()).count(True))<EOL>if nrunning < ncpus:<EOL><INDENT>for (name, p) in pool.items():<EOL><INDENT>if (not started[name]) and (not completed[name]):<EOL><INDENT>p.start()<EOL>started[name] = True<EOL>print("<STR_LIT>".format(name))<EOL>break<EOL><DEDENT><DEDENT><DEDENT>for (name, p) in pool.items():<EOL><INDENT>if started[name] and (not completed[name]) and (<EOL>not p.is_alive()):<EOL><INDENT>completed[name] = True<EOL>print("<STR_LIT>".format(name))<EOL><DEDENT><DEDENT>time.sleep(<NUM_LIT:5>)<EOL><DEDENT>print("<STR_LIT>")<EOL>
Main body of script.