Commit Graph

73 Commits

Author SHA1 Message Date
Sebastien Bourdeauducq 5e046dc5ce artiq_run: move parse_arguments and get_experiment to tools 2015-04-07 13:04:47 +08:00
Sebastien Bourdeauducq 9b46bc623a dbhub: do not use as context manager, turn close exceptions into warnings, do not close devices early in worker 2015-04-05 17:49:41 +08:00
Robert Jördens 0ec7e9a98c artiq_run: fix get_argparser() 2015-04-04 21:17:24 -06:00
Robert Jördens 1a1afd5410 artiq_run: refactor, support use from within experiments
You can always (under posix) use #!/usr/bin/env artiq_run as
shebang for experiments and make them executable.
Now, you can also do this (portable):

if __name__ == "__main__":
    from artiq.frontend.artiq_run import run
    run()

to make an experiment executable. The CLI options are all inherited.
Also:

* removed --elf: can be inferred from filename
* did some refactoring and cleanup
* use logging for all messages, except the result printing (use -v to get
parameter changes and dummy scheduler actions)
2015-04-04 20:51:48 -06:00
Sebastien Bourdeauducq 200e20fb39 worker: close devices immediately after run and before analyze 2015-03-20 12:01:34 +01:00
Sebastien Bourdeauducq 2b3641ac0a db,worker: fix realtime result initialization 2015-03-13 15:12:55 +01:00
Sebastien Bourdeauducq d5795fd619 master: watchdog support
Introduces a watchdog context manager to use in the experiment code that
terminates the process with an error if it times out. The syntax is:

with self.scheduler.watchdog(20*s):
   ...

Watchdogs timers are implemented by the master process (and the worker
communicates the necessary information about them) so that they can be
enforced even if the worker crashes. They can be nested arbitrarily.
During yields, all watchdog timers for the yielding worker are
suspended [TODO]. Setting up watchdogs is not supported in kernels,
however, a kernel can be called within watchdog contexts (and terminating
the worker will terminate the kernel [TODO]).

It is possible to implement a heartbeat mechanism using a watchdog, e.g.:

for i in range(...):
    with self.scheduler.watchdog(...):
        ....

Crashes/freezes within the iterator or the loop management would not be
detected, but they should be rare enough.
2015-03-11 16:43:14 +01:00
Sebastien Bourdeauducq ec1d082730 remove timeout from run_params (to be replaced by a better mechanism) 2015-03-09 10:51:32 +01:00
Sebastien Bourdeauducq d95a9cac9a move realtime result registration into dbh, simplify syntax 2015-03-08 17:27:27 +01:00
Sebastien Bourdeauducq f2e3dfb848 Experiment base class, replace __artiq_unit__ with docstring 2015-03-08 15:55:30 +01:00
Sebastien Bourdeauducq 0f007cb1a7 language/db: remove implicit_core 2015-03-08 11:37:53 +01:00
Sebastien Bourdeauducq 4267e0deab master,artiq_run: simplify unit autodetection 2015-02-21 20:26:58 -07:00
Sebastien Bourdeauducq 387de11e56 artiq_run: fix import 2015-02-21 20:09:46 -07:00
Sebastien Bourdeauducq 65555a3a09 artiq_run,master: introduce __artiq_unit__ attribute to mark and name experiments 2015-02-20 14:01:34 -07:00
Sebastien Bourdeauducq 0dd5692c32 master,run: pass run_params to experiment 2015-02-19 20:05:12 -07:00
Sebastien Bourdeauducq 4d21b78314 master,client,gui: factor timeout into run_params 2015-02-19 20:03:55 -07:00
Sebastien Bourdeauducq d01ba8e644 artiq_run: provide dummy scheduler API 2015-02-19 12:09:37 -07:00
Sebastien Bourdeauducq 9ffc370416 master,run: automatically call analyze function 2015-02-19 09:40:15 -07:00
Sebastien Bourdeauducq 656099a331 artiq_run: sort result output alphabetically 2015-02-17 16:12:21 -07:00
Sebastien Bourdeauducq 8df1b03f0f artiq_run: add verbosity config 2015-02-04 19:09:54 +08:00
Sebastien Bourdeauducq 0e65f71705 artiq_run: HDF5 output support 2015-02-04 18:46:55 +08:00
Sebastien Bourdeauducq 9fb42e4952 doc: use sphinx-argparse 2015-01-23 00:52:13 +08:00
Sebastien Bourdeauducq 0c2e960c85 frontend: restore artiq_ prefix 2015-01-17 19:41:00 +08:00