You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The default instrument is controlled in the [mantid properties files](https://docs.mantidproject.org/nightly/concepts/PropertiesFile.html)
21
+
and is typically defined in `/etc/mantid.local.properties`.
17
22
18
-
The logfile of what was setup for running, as well as other messages, is
19
-
`/var/log/SNS_applications/livereduce.log` if run as the user `snsdata`,
20
-
or `livereduce.log` in the current working directory (if run from the
21
-
command line).
23
+
24
+
Managing the service
25
+
--------------------
22
26
23
27
If run from inside `systemctl`, use the standard commands for starting and stopping it.
28
+
24
29
```shell
25
30
sudo systemctl start livereduce
26
31
sudo systemctl stop livereduce
@@ -30,25 +35,43 @@ The status of the service can be found via
30
35
```shell
31
36
sudo systemctl status livereduce status
32
37
```
38
+
39
+
Logging
40
+
--------
41
+
42
+
The logfile of what was setup for running, as well as other messages, is
43
+
`/var/log/SNS_applications/livereduce.log` if run as the user `snsdata`,
44
+
or `livereduce.log` in the current working directory (if run from the
45
+
command line).
46
+
33
47
the logs are stored in `/var/log/SNS_applications/livereduce.log` and are readable by anyone.
34
48
People with extra permissions can run ``sudo journalctl -u livereduce -f`` and see all of the logs without them flushing on restart of the service.
35
49
Sometimes the service refuses to restart, in that case `stop` then `start` it in separate commands.
36
50
37
-
If the instrument is not defined in the configuration file (default is `/etc/livereduce.conf`) the software will ask mantid for the default instrument using `mantid.kerel.ConfigService.getInstrument()` ([docs](https://docs.mantidproject.org/nightly/api/python/mantid/kernel/ConfigServiceImpl.html#mantid.kernel.ConfigServiceImpl.getInstrument)).
38
-
The default instrument is controlled in the [mantid properties files](https://docs.mantidproject.org/nightly/concepts/PropertiesFile.html) and is typically defined in `/etc/mantid.local.properties`.
39
51
40
-
The script files that are used/looked for are
52
+
Python processing scripts
53
+
-------------------------
41
54
42
-
*`<script_dir>/reduce_<instrument>_proc.py` is the processing script
43
-
(for each chunk). This is required.
44
-
*`<script_dir>/reduce_<instrument>_post_proc.py` is the
45
-
post-processing script (for the accumulated data). To disable this
46
-
step rename the python script so it is not found by the daemon.
47
55
48
-
Example filenames for NOMAD with default script location is
56
+
-[livereduce.sh](../scripts/livereduce.sh) is the script that is run when the service is started.
57
+
This shell script invokes `livereduce.py` within a conda environment
58
+
specified in the configuration file. Otherwise the environment is set to `"mantid-dev"`.
59
+
-[livereduce.py](../scripts/livereduce.py) script manages live data reduction using the Mantid framework.
60
+
It configures logging, handles signals for graceful termination, reads the configuration JSON,
61
+
and manages live data processing with Mantid's StartLiveData and MonitorLiveData algorithms.
62
+
The script monitors memory usage and restarts the live data processing if memory limits are exceeded.
63
+
It uses `pyinotify` to watch for changes in configuration and processing scripts,
64
+
restarting the live data processing as needed. The service relies on instrument-specific processing scripts
65
+
for data accumulation and reduction
66
+
-`<script_dir>/reduce_<instrument>_proc.py` is the instrument-specific processing script for each chunk (required).
67
+
-`<script_dir>/reduce_<instrument>_post_proc.py` is the post-processing script for the accumulated data.
68
+
To disable this step rename the python script so it is not found by the daemon.
69
+
70
+
Example instrument-specific scripts for NOMAD with default script location are
49
71
`/SNS/NOM/shared/livereduce/reduce_NOM_live_proc.py` and
0 commit comments