Ticket #11518 (new)
Alternative mechanism for sending end of runs messages to autoreduce
Reported by: | Anders Markvardsen | Owned by: | Lottie Greenwood |
---|---|---|---|
Priority: | critical | Milestone: | Backlog |
Component: | Tools | Keywords: | AUTOREDUCTION |
Cc: | marcus.noble@… | Blocked By: | |
Blocking: | Tester: |
Description
Code for this is used by a number of groups in the lab including Alex (and the powder diffraction scripts uses this).
In addition see below reply to Nick from Freddie about Knowing when runs ends:
as an alternative to using the “end of run” bat file (which we are happy for you to add something to), there is currently a file updated on the archive each time a run is ended. It is called “lastrun.txt” and is located in the “logs” area e.g.
isis\inst$\NDXMERLIN\Instrument\logs
The file contains:
file_prefix run_number sav_file_count
If sav_file_count is 0 the the run has ended and you will have “file prefix””run_number”.nxs etc present on the archive
If sav_file_count is > 0 then this indicates that the run hasn’t ended yet, but an update/store has been used to create .n001 and .s001 etc files, the number given being the highest index of file currently used. So you could auto-reduce sav files too prior to run end if you wished.
I have a linux file watcher program using this mechanism that Pascal runs on some of his linux machines to automatically copy files across to them at run end, it just monitors the file modification date of lastrun.txt via a cifs mount of the archive and then reads its contents when the file date changes; it knows the last run it has, and then knowing the last run in the archive it can copy across any missing runs.
Information that will be required from any ICAT replacement:
Replacing ICAT for the backend is feasible, by using a cron job to watch a certain text file that updates when a run is completed. We can then gain the RunNumber/RB Number by reading the raw file. The cycle number will be assumed to be the current cycle.