def run_tasks(tasks, cpu=4):
    for t in tasks:
        print(t.name)
	t.stdout = os.path.join(PATH_DATABASES, t.name+'.stdout')
        t.stderr = os.path.join(PATH_DATABASES, t.name+'.stderr')

    s = Supervisor(tasks=tasks, force_run=False, log=database_supervisor_log, cpu=cpu)
    s.run()
    for t in tasks:#if everything executes properly, rm the task logs
        if os.path.exists(t.stdout):
	    os.remove(t.stdout)
        if os.path.exists(t.stderr):
            os.remove(t.stderr)
def run_tasks(tasks, cpu=4):
    for t in tasks:
        print(t.name)
        t.stdout = join(PATH_TOOLS, t.name+'.stdout')
        t.stderr = join(PATH_TOOLS, t.name+'.stderr')

    s = Supervisor(tasks=tasks, force_run=False, log=tool_supervisor_log, cpu=cpu)
    s.run()
    for t in tasks:  #if everything executes properly, rm the task logs
        if exists(t.stdout):
            os.remove(t.stdout)
        if exists(t.stderr):
            os.remove(t.stderr)
def run_tasks(tasks, cpu=4):
    for t in tasks:
        print(t.name)
        t.stdout = join(PATH_TOOLS, t.name+'.stdout')
        t.stderr = join(PATH_TOOLS, t.name+'.stderr')

    s = Supervisor(tasks=tasks, force_run=False, log=tool_supervisor_log, cpu=cpu)
    s.run()
    for t in tasks:  #if everything executes properly, rm the task logs
        if exists(t.stdout):
            os.remove(t.stdout)
        if exists(t.stderr):
            os.remove(t.stderr)
def run_tasks(tasks, cpu=4):
    for t in tasks:
        print(t.name)
        t.stdout = os.path.join(PATH_DATABASES, t.name + '.stdout')
        t.stderr = os.path.join(PATH_DATABASES, t.name + '.stderr')

    s = Supervisor(tasks=tasks,
                   force_run=False,
                   log=database_supervisor_log,
                   cpu=cpu)
    s.run()
    for t in tasks:  #if everything executes properly, rm the task logs
        if os.path.exists(t.stdout):
            os.remove(t.stdout)
        if os.path.exists(t.stderr):
            os.remove(t.stderr)