Пример #1
0
def main(session_filename, objective_name, polling_period, plot):
    db_session = database.DBSession()
    with job_control.process('controller', db_session) as process:
        try:
            session, par_spec = factories.controllers.load_complete_session(
                db_session, session_filename)

            par_name, par_guess = _par_from_spec(par_spec)

            population = fitting_controller.SimplePopulation(
                dbs=db_session,
                session=session,
                parameter_name=par_name,
                parameter_guess=par_guess,
                objective_name=objective_name,
                process=process,
                plot=plot)

            c = fitting_controller.SimpleFitController(
                dbs=db_session,
                session=session,
                population=population,
                polling_period=polling_period,
                process=process)
            c.run()
        except:
            logger.exception('Exception in controller main.')
            raise
Пример #2
0
def main(session_filename):
    db_session = database.DBSession()
    with job_control.process('controller', db_session) as process:
        session, par_spec = factories.controllers.load_complete_session(
            db_session, session_filename)

        c = mesh_controller.Controller(session, par_spec)
        c.create_jobs(db_session, process)
Пример #3
0
def main(idle_timeout, retry_delay):
    db_session = database.DBSession()
    with job_control.process('worker', db_session) as process:
        stop_time = time.time() + idle_timeout
        while time.time() < stop_time:
            job = job_control.get_job(process.id, db_session)
            if job:
                run_support.run_job(job, db_session)
                job.complete = True
                stop_time = time.time() + idle_timeout
            else:
                time.sleep(retry_delay)
Пример #4
0
def main():
    db_session = database.DBSession()
    with job_control.process('test', db_session) as process:
        logger.debug('Test debug message.')
        logger.info('Test info message.')
        logger.warn('Test warn message.')
        logger.error('Test error message.')
        logger.critical('Test critical message.')
        try:
            foo_raises()
        except:
            logger.exception('Apparently I can catch exceptions too!')
Пример #5
0
def main(idle_timeout, retry_delay):
    db_session = database.DBSession()
    with job_control.process("worker", db_session) as process:
        stop_time = time.time() + idle_timeout
        while time.time() < stop_time:
            job = job_control.get_job(process.id, db_session)
            if job:
                run_support.run_job(job, db_session)
                job.complete = True
                stop_time = time.time() + idle_timeout
            else:
                time.sleep(retry_delay)
Пример #6
0
def main(session_filename, objective_name, polling_period, plot):
    db_session = database.DBSession()
    with job_control.process('controller', db_session) as process:
        try:
            session, par_spec = factories.controllers.load_complete_session(
                db_session, session_filename)

            par_name, par_guess = _par_from_spec(par_spec)

            population = fitting_controller.SimplePopulation(
                    dbs=db_session, session=session,
                    parameter_name=par_name, parameter_guess=par_guess,
                    objective_name=objective_name,
                    process=process, plot=plot)

            c = fitting_controller.SimpleFitController(
                    dbs=db_session, session=session,
                    population=population,
                    polling_period=polling_period,
                    process=process)
            c.run()
        except:
            logger.exception('Exception in controller main.')
            raise