New IRAF Messaging Applications
Francisco Valdes, Michael Fitzpatrick, Robert Seaman
NOAO/SDSG(IRAF)
Abstact
New examples of IRAF applications interacting using a low-volume,
socket-based text messaging scheme are described and demonstrated. The
tasks may be distributed across multiple CPUs or locations, using a
many-to-one or one-to-many client-server architecture. Server
applications respond to messages without blocking so other activities such
as data processing, user interaction through a GUI, or responding to
another client application, may take place.
Messaging is based on a simple text-based scheme consisting of either
commands begining with a colon or data in keyword/value pairs. This
also allows any non-IRAF application which understands the protocol to
participate as either a new client or server application. The
commands have the same form as IRAF GUI commands so that applications may
easily interact with GUI tasks.
One such server application demonstrated is a GUI IRAF processing
monitor. IRAF (or non-IRAF) data reduction tasks send status and
processing information to GUI server tasks which provide graphical displays
and interaction with the received information. One motivation for
this is the powerful and easily customizable nature of IRAF GUIs by means
of the GUI description files (which are currently TCL interpreted modules),
and the need for such a component in the NOAO Mosaic Data Product
Pipeline. This pipeline uses multiple IRAF data reduction tasks and
data parallel processing distributed across a network, requiring a central
monitoring facility to ensure proper operation of the pipeline. Other
applications of this messaging scheme are also discussed.
IRAF Server GUIs
The server GUIs are under development and the ones
demonstrated here are prototypes. The basic structure of the servers
is:
-
IRAF monitor server task
-
Starts the OBM TCL GUI
-
Enters a "cursor" loop blocking on input from the GUI
-
The GUI periodically sends command to check for messages
-
Task reads messages from any number of connections
-
The reads do not block if there is no input or the clients
disconnect
-
The task manages and formats the data and feeds the GUI
-
IRAF OBM GUI
-
Customizable TCL script
-
Communicates with server through simple text messages
Includes a timer callback to request the server check
for new data
-
IRAF client application task
-
Requires very simple calls to send messages to the client
-
Open FIO descriptor with special filename (eg inet:4566)
-
Write to descriptor (typically with printf)
-
Close descriptor
-
If the server is not running the task fails to open the
descriptor and
client can continue without sending messages and/or
writing to a log file
-
If the server disconnects (shutsdown) a trapable error
occurs and
the client continues without sending message and/or
writing to a log file
Figure 1: Messaging Architecture
New IRAF Monitor Servers
Keyword Monitor (see figure 2a and figure 2b)
-
Receives keyword messages from various distributed processes
-
The messages are grouped by a keyword to monitor and various
associated keywords
-
The last values received are displayed in a table along
with statistics
-
Alarm limits alert user of potential problems or poor
data quality
-
The set of values for the monitored may be graphed against
any associated keyword
-
The graphs may be displayed in two formats:
-
A mnimal graph similar to a strip chart
-
A full sized graph with axes
-
Both graphs support full IRAF options
Figure 2a: Keyword monitor with small stripcharts
Figure 2b: Keyword monitor with expanded graph
Status Monitor (see figure 3)
-
Receives keyword messages grouped by an identifier (typically
an image name or id)
-
The group contains a process identifier and a status
-
A timer in GUI is used to warn of potentially hung processing
steps
Figure 3: Status monitor mock-up
Technical Details
This paper discusses specific conventions and architectures
for the servers presented here. Other messaging conventions are possible
as well as two-way communications. So what is described does
not imply restrictions in the IRAF system or in the use of other messaging
architectures for other purposes.
The message protocol consists of commands and keywords.
Examples of messages used with the Keyword Monitor are shown below.
The grouping is defined by the BEGIN/END cards.
BEGIN = CCDMEAN
TEMP = 370.
UT = 8:01:30.0
CCDMEAN = 46.
END = CCDMEAN
BEGIN = CCDMEAN
TEMP = 371.
UT = 8:01:39.0
CCDMEAN = 46.
END = CCDMEAN
-
The IRAF application interface is standard text file I/O
(FIO). Messaging connections are specified by special filenames such
as "inet:<port>" or "unix:<name>". Non-blocking I/O is provided
by trapping errors during file opens, reads, and writes.
-
The IRAF VOS network device (ND) interface currently provides
sockets. In the future other types of messaging methods can be added
such as a "message bus". The applications would only need to specify
a different type of filename.