Пример #1
0
def status(args, unknownArgs):
    # No matter what check the overseer
    from simtools.ExperimentManager.BaseExperimentManager import BaseExperimentManager
    BaseExperimentManager.check_overseer()

    if args.active:
        print('Getting status of all active dtk experiments.')
        active_experiments = DataStore.get_active_experiments()

        for exp in active_experiments:
            exp_manager = ExperimentManagerFactory.from_experiment(exp)
            exp_manager.print_status()
        return
    exp_manager = reload_experiment(args)
    if args.repeat:
        exp_manager.wait_for_finished(verbose=True, sleep_time=20)
    else:
        exp_manager.print_status()
Пример #2
0
    local_queue = multiprocessing.Queue(max_local_sims)

    managers = OrderedDict()

    # Queue to be shared among all runners in order to update the individual simulation states in the DB
    manager = Manager()

    # Take this opportunity to cleanup the logs
    lc = threading.Thread(target=LogCleaner)
    lc.start()

    count = 0

    while True:
        # Retrieve the active LOCAL experiments
        active_experiments = DataStore.get_active_experiments()
        logger.debug('Waiting loop pass number %d, pid %d' % (count, os.getpid()))
        logger.debug('Active experiments')
        logger.debug(active_experiments)
        logger.debug('Managers')
        logger.debug(managers.keys())

        # Create all the managers
        for experiment in active_experiments:
            logger.debug("Looking for manager for experiment %s" % experiment.id)
            if experiment.id not in managers:
                logger.debug('Creating manager for experiment id: %s' % experiment.id)
                manager = None
                try:
                    sys.path.append(experiment.working_directory)
                    manager = ExperimentManagerFactory.from_experiment(experiment)