Project

General

Profile

Feature #23784

DAQInterface should be able to send messages to MessageViewer

Added by John Freeman 3 months ago. Updated 2 months ago.

Status:
Reviewed
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
12/19/2019
Due date:
% Done:

100%

Estimated time:
Experiment:
-
Co-Assignees:
Duration:

Description

One of the SBN needs Gennadiy presented at yesterday's meeting, and which was generally approved by the group, was the ability to see DAQInterface messages appear in MessageViewer since their GUI wrapper makes viewing DAQInterface messages harder than if they were running DAQInterface at the command line. Eric pointed out to me last week that a good start on this would be to review Issue #21799, which concerns the addition of functionality in artdaq-utilities and artdaq which makes this easier to implement.

messageviewer.png (401 KB) messageviewer.png Gennadiy Lukhanin, 01/31/2020 11:50 PM

Related issues

Related to artdaq - Feature #21799: Allow sending metrics and/or TRACEs from python or Node.jsClosed01/30/2019

Associated revisions

Revision 9bd662a4 (diff)
Added by John Freeman 3 months ago

JCF: Issue #23784: modified DAQInterface to send messages to MessageViewer given alterations to its environment as described in point number 2 of my Dec-30-2019 comment on Issue 21799

Revision daaa9e40 (diff)
Added by John Freeman 3 months ago

JCF: Issue #23784: if swig_artdaq is imported, ARTDAQ_LOG_FHICL needs to be properly set

In order for an instance of swig_artdaq to send messages to
messageviewer, ARTDAQ_LOG_FHICL needs to be set to point to a FHiCL
document which defines the udp port MessageViewer's listening
on. Consequently, if swig_artdaq is imported, DAQInterface will create
this document if necessary, and also require that ARTDAQ_LOG_FHICL
already be pointing to it.

Revision b1e4e5c8 (diff)
Added by John Freeman 3 months ago

JCF: Issue #23784: make sure to avoid DAQInterface double-printing to stdout if an instance of swig_artdaq is used to send out messages

History

#1 Updated by John Freeman 3 months ago

  • Related to Feature #21799: Allow sending metrics and/or TRACEs from python or Node.js added

#2 Updated by John Freeman 3 months ago

  • % Done changed from 0 to 100
  • Status changed from New to Resolved

This issue is resolved with commit b1e4e5c88d9231951a5f30286a895e328db39c8b at the head of feature/23784_send_to_messageviewer. If DAQInterface isn't able to successfully import swig_artdaq from the python_artdaq module, it will proceed as it always has - i.e., this change is backwards compatible. However, if it is able to, the following will be the case:

1) DAQInterface will make sure that the user has already pointed the environment variable ARTDAQ_LOG_FHICL to the name of the FHiCL document which defines the host and port messageviewer's listening on and which may be auto-generated by DAQInterface. If ARTDAQ_LOG_FHICL doesn't exist or isn't set properly, DAQInterface willl throw an exception telling the user to set ARTDAQ_LOG_FHICL.

2) Assuming use_messageviewer isn't set to "false" in $DAQINTERFACE_SETTINGS, DAQInterface will use an instance of swig_artdaq to output messages, rather than traditional python print statements. These messages will appear both in the MessageViewer for the partition in question and in the console (and hence the logfile in $DAQINTERFACE_LOGDIR).

#3 Updated by John Freeman 3 months ago

Notes on how to make the python_artdaq module available can be found in a comment I wrote yesterday (Dec-30-2019) for Issue #21799.

#4 Updated by Gennadiy Lukhanin 2 months ago

Works as described on mu2edaq13.

bash-4.2$ tshow |grep DAQInterface_partition_9 |head -5
   12 1580533139715539 106867 106867   2                         MessageFacility nfo . external-mu2edaq13-0, DAQInterface_partition_9:  swig_artdaq.cpp:72 ==> Fri Jan 31 22:58:59 CST 2020: DAQInterface in partition 9 launched and now in "stopped" state, listening on port 19000
   13 1580533139715470 106867 106867   2                DAQInterface_partition_9 nfo . Fri Jan 31 22:58:59 CST 2020: DAQInterface in partition 9 launched and now in "stopped" state, listening on port 19000
21225 1580532969749614  61511  61511  15                         MessageFacility nfo . external-mu2edaq13-0, DAQInterface_partition_9:  swig_artdaq.cpp:72 ==> Fri Jan 31 22:56:09 CST 2020: DAQInterface on partition 9 caught kill signal 15
21226 1580532969749509  61511  61511  15                DAQInterface_partition_9 nfo . Fri Jan 31 22:56:09 CST 2020: DAQInterface on partition 9 caught kill signal 15
21227 1580532943198837  61511  61520  16                         MessageFacility nfo . external-mu2edaq13-0, DAQInterface_partition_9:  swig_artdaq.cpp:72 ==> ;De



Also available in: Atom PDF