[OPUS]

Frequently Asked Questions


OPUS Process Manager



OPUS Process Manager


What is the PMG?

The PMG is the Process ManaGer, a Graphical User Interface (GUI) that allows the user to control the computer processes that make up an OPUS pipeline. The PMG communicates with OPUS processes through process status files. The PMG display looks like this:

[Initial PMG 
window]


Do I need anything special to run the PMG?

The PMG is written as a Motif application and consequently requires that Motif and X are installed on your system. A new version of the PMG is under development at STScI that uses Java for the GUI.


How do I start the Process Manager?

Since the OPUS binaries are in your path, all you need to do to start the Process Manager in the background is enter:
      pmg &
   

However, with the introduction of the OAPI the PMG reports false error messages to the screen. If you would prefer not to see these messages, redirect both standard output and standard error to /dev/null when running the PMG. This is done in the CSH like:

      pmg >& /dev/null &
   


Has the PMG's performance degraded in the 2.2 release?

Yes. The PMG was ported to use the new OAPI in version 2.2; however, the port is incomplete and has not undergone any performance tuning because the current version of the PMG will be replaced by a completely new, Java-based version in the next release.


Does the PMG support the OAPI?

Not completely. The PMG was ported to use the new OAPI for the 2.2 release, but only so far as to be functional when using the default process status file structure. A new, Java-based version of the PMG that fully supports the OAPI will be included in the next release of OPUS.


What is a process status file?

A process status file is a zero-length file (contains no data) in which all necessary control information about a computer process is contained within the filename itself.

The Process Manager (PMG) uses these files to control and communicate with the computer processes running within the OPUS pipeline.

The process status file is parsed by the PMG to determine what information is to be displayed in the PMG GUI window. The PMG allows the user to modify certain fields in the process status file to control how the process functions.

The following information is contained in a process status file:

   00006426-getkw___-idle___________.340d7ed9-g2f______-area51-____
   |-- 1 -| |-- 2 -| |----- 3 -----| |-- 4 -| |-- 5 --| |- 6 | | 7| 

  1. PID: This portion of the process status file contains the process ID (00006426) assigned by the system at run time (in hex format for historical reasons). The process ID is used to distinguish between multiple versions of the same process running on the same path and node. This information is displayed under the "Process" column of the PMG window.

  2. PROCESS: This field of the process status file reflects the process name (getkw). This information is displayed under the "Process" column of the PMG display with the process ID. The default size of this field is 6 characters, so this is the default maximum size of a process name.

  3. STATUS: This portion of the process status file contains the status of the pipeline process ("idle"). Possible values of this field are: working, suspended, idle, iowait, starting, absent (process has exited due to an error), or the name of the dataset that the process is currently working on. This information is displayed under the "Status" column of the PMG.

  4. START TIME: This portion of the process status file contains a time stamp (340d7ed9) representing when the process was started (in hexadecimal format). This information is converted to user-friendly date-time text and is displayed under the "Started" column of the PMG. The time stamp can be inaccurate by up to 99 seconds since a random number has been added to it to keep it unique.

  5. PATH: This portion of the process status file contains the name of the path under which the process is running (g2f). This information is displayed under the "Path" column of the PMG. The default size of this field is 9 characters, so this is the maximum default size of a path name root.

  6. NODE: This portion of the process status file contains the name of the machine on which the process is running (area51). This information is displayed under the "Node" column of the PMG. Note: The default size of this field is 6 characters, so this is the default maximum node name length.

  7. COMMAND: This portion of the process status file is the command area. This tells the process to perform a specific task. In this example, the process status file contains only underscores (i.e., is "blank"); therefore, the process will continue its normal operation. Possible values for this field are: halt, susp, resu, and init. The commands are issued using the "Manage" menu selection of the PMG menu bar. The command values will tell the process to terminate processing, suspend processing, resume processing, or reinitialize the process, respectively. This information is displayed under the "CMD" portion of the PMG.


Can I modify the structure of a process status file?

Yes.

You can configure the sizes, locations, and formatting of fields in a process status file for your pipelines by changing the default parameters in the file opus.env located in OPUS_OBSERVATIONS_DIR . The portion of this file related to process status files looks like:

!
! PSTAT definitions
!
! The size of each PSTAT field must be specified here as must a template for
! composing a string representation of the PSTAT out of each field. The PSTAT
! fields that distinguish one PSTAT from another also must be specified.
!
! The formatting and keyword names are self-explanatory although it should
! be noted that each field must appear in the template once and only once,
! there must be at least one field labeled as "UNIQUE", and the template
! format and field sizes should be consistent with the blackboard
! implementation to be utilized (ie., appropriate for file names if BB_TYPE =
! FILE).
!
PSTAT.TEMPLATE_DELIMS = {}
PSTAT.TEMPLATE        = {PID}-{PROCESS}-{PROC_STAT}.{START_TIME}-{PATH}-{NODE}-{PROC_CMD}
PSTAT.UNIQUE1         = PID
PSTAT.UNIQUE2         = NODE
PID.SIZE              = 8
PROCESS.SIZE          = 8
PROC_STAT.SIZE        = 15
START_TIME.SIZE       = 8
PATH.SIZE             = 9
NODE.SIZE             = 6
PROC_CMD.SIZE         = 4

The comments above include the instructions for changing these parameters. The fields marked as "UNIQUE" are those used by the OPUS system to distinguish one process status file from another. This is important because duplicate process status files are not allowed on the blackboard. It is not recommended that you change the unique fields although you are free to do so.

Also, note that the PMG does not support changes to these parameters! The next release of OPUS will include a new, Java-based PMG that will.

Before changing any of these parameters for a pipeline, be sure that there are no process status files in your OPUS_HOME_DIR, otherwise they will not be recognized after you make the changes.


How do I tell the PMG which paths to monitor?

The "Select Paths..." option under the "File" pull down menu contains a list of all paths defined in OPUS_DEFINITIONS_DIR. Initially, each path is toggled "on" so that the default action of the PMG is to monitor processes in all paths.

[Select Paths 
Menu Option]

You can change which paths are monitored by the PMG by changing the state of the various toggle buttons representing each path. A path is monitored by the PMG when toggled "on" (represented by a filled square next to the path name). Paths not being monitored are toggled "off" (no square next to the name).

Later versions of the PMG implement this set of toggle buttons as a tear-off sheet. You can click on the dashed-line at the top of the menu, and the entire menu will stay visible. There is also now a "Toggle All" selection to toggle the state of every button on the menu.


How do I start up a process?

From the "File" menu, click on "Select Process".

PMG File Menu: Select

That will bring up a window that looks something like this:

PMG Open Pipeline Window

The box on the left-hand side will be blank until you choose, from on the right: a path from the "through path..." box, a node from the "on node..." box, and one or more processes from the "run process..." box and then click on the "<< Add" button.

Or you can bring up processes as part of a pipeline in the PMG. Once you have finished your process selection, click on the "Start" button. The Process Selection window will go away once all the processes have started up; however, the next time you choose "Select Process" from the file menu, you will see your list of processes again. If you don't want to start these processes again, highlight the list in the left-hand box and choose "Remove >>" BEFORE you hit the "Start" button again.


How do I terminate a running process?

You can terminate a running process (or set of processes) with the PMG by first selecting the process (or processes), then by:

- clicking on "Terminate Selected" in the "Manage" menu, or

- using the middle mouse button to drag the selection to the stop sign icon to the right of the refresh interval button.

In both cases, a confirmation dialog box will be displayed asking for confirmation of the termination request.


Can I suspend a specific process in the pipeline?

Yes.

To do this, use your mouse to select one or more processes found in your PMG screen and then click on the pull down "Manage" menu. Select "Suspend Selected".

[Manage Menu 
with Suspend Selected]

This will update the process status file with a "susp" in the command portion of the process status file (normally filled with underscores). The OPUS system suspends the process and changes the status of the process to "suspended" on the PMG display. The selected process will then suspend its operation, after the current dataset has completed processing.

[PMG with 
Suspended Process]

Note: Since the process status file is just a filename, you can manually rename the process status file to contain the "susp" string in the process status file command section, but using the PMG is a safer way to do this. For more information on why the PMG is safer, see the definition of lock files.


How do I resume a suspended process?

You can resume a suspended process by following the same procedure used to suspend that process, except that you select the "Resume Selected" option in the "Manage" pull down menu.

[Menu with Resume 
Selected]

Note: Since the process status file is just a filename, you can manually rename the process status file to contain the "resu" string in the process status file.


Can I bring the entire pipeline down?

Yes.

This is done by selecting the "Halt OPUS" option from the "Manage" pull down menu of the PMG, and selecting "All".

[PMG with Halt OPUS 
Selected]

When this option is exercised, *all* processes in *all* paths that are managed by that PMG will be terminated regardless of which pipeline the process is running under. You will be asked to verify the operation.

When any "Halt OPUS" option is chosen, the command field of the process status file is updated with the "halt" command and processes begin terminating. Corresponding PSFs will disappear with a future refresh of the screen.

[PMG with 
OPUS Halted]


Can I bring down processes in a single path?

Yes.

Each path you choose to monitor in the PMG will have a corresponding halt button in the "Halt OPUS..." cascade menu. By selecting a particular path in "Halt OPUS..." instead of the "All" button, you signal the PMG to halt only those processes running in that path.


What is a pipeline?

A pipeline is a collection of pre-selected computer processes running on a network of computers in which the data flows through a pre-defined disk/directory structure called a "path". The processes, nodes, and paths are defined by the user through the Process Manager.


How do I define a pipeline?

A specific pipeline is defined by creating a xxx.pipeline file (where xxx is the name of the pipeline - the length of the name is not restricted to three characters). The *.pipeline file is an ASCII file that contains three separate columns of text that list the process name, path, and node on which the process will be running. For example, this is part of a pipeline file called whopper.pipeline:
   g2f         whopper    area51
   getkw       whopper    area51
   gifin       whopper    area51
   listhd      whopper    area51
   gifin       whopper    orchid
   g2f         whopper    orchid
   getkw       whopper    orchid
The first column contains the process name (g2f for the first line). The second column contains the path in which the data will be processed (whopper). The third column contains the name of the machine on which the process will run (area51 for the first line).

So, if this pipeline file were to be used, the PMG would start the process g2f running under the whopper path on the area51 machine (and so on for the remaining lines).

There are two ways to create the pipeline file. The first is to use the PMG. To do this, click on the "File" pull down menu of the PMG. Click on "Select Process...".

[PMG File 
Menu]

This will activate another Motif window, the "OPUS Process Selection" window, in which the user can select from the available process names, paths, and nodes (located in the three frames in the right hand portion of the window) and add them to the pipeline frame on the left.

[OPUS 
Process Selection window]

The second way to create a pipeline file is to create it with a text editor. The format for each line of the file is exactly the same, as given above:

   process_name     path_name     node_name
As indicated in the example above, you should use lowercase for each of the fields. The columns are space delimited and any number of spaces can be used. Remember that the filename must be of the form *.pipeline. The file should be moved to the OPUS_DEFINITIONS_DIR directory for the PMG to find it.

It should be mentioned that the order in which the processes appear in the pipeline file is arbitrary. In other words, the processes do not have to be listed in the order in which they will be executed in the pipeline.


Can I save the pipeline definition?

Yes.

Once all the desired processes are added to the pipeline definition (via the first way described in the previous question), the user clicks on the "Save" button in the "OPUS Process Selection" window (located at the bottom of the window).

[Saving a 
Pipeline in OPUS Process Selection window]

This activates another Motif window which allows the user to determine the pipeline name under which to save the pipeline definition and the directory in which to save it.

[Save 
Pipeline window]


How do I load a saved pipeline definition?

Click on the "File" pull down menu of the PMG and select "Select Process..." to activate the "OPUS Process Selection" window.

[PMG File 
Menu]

Click on "Open" (at the bottom of the selection window) to bring up a previously saved pipeline file.

[Opening a 
Pipeline in OPUS Process Selection window]

Select the appropriate pipeline file from the file selection window and then click on "OK".

[Open 
Pipeline window]

This will display the selected pipeline in the pipeline frame of the "OPUS Process Selection" window. No processes are started until the "Start" button is selected.


How do I remove a process from the pipeline definition?

First, load a saved pipeline definition as described in the previous question. Then, scroll through the pipeline listing (located in the pipeline frame of the "OPUS Process Selection" window) until you reach the process(es) that you wish to remove. Click on the line(s) containing the process(es) you wish to remove and then click the "Remove>>" button (centrally located between the pipeline frame and selection frames).

[OPUS Process Selection with Remove chosen]

The task definition should now be removed from the pipeline. If the user wishes to save this version of the pipeline file, click on the "Save" button and save the pipeline file as described above

Note that if you do not save the changes just made to the pipeline, the pipeline will appear as it did before the changes were made to it when you next select that pipeline file.


Can't I just edit the pipeline file?

Sure. The second method to remove a task from the pipeline definition is to manually edit the *.pipeline file (with your favorite editor) and remove the appropriate line(s).


How do I start the pipeline?

To start a pipeline, the user must first load a previously saved pipeline definition or create a new pipeline definition. Once this is done and all desired task components (processes, path, and nodes) are in the pipeline frame of the "OPUS Process Selection" window, the user simply clicks on the "Start" button located at the bottom of the "OPUS Process Selection" window.

[OPUS 
Process Selection button choices]

The cursor will indicate a wait state while the selected processes are started. When all processes have been started (this can take some time depending on how many processes you are bringing up) the "OPUS Process Selection" window will disappear. Then you should start to see entries in the PMG main window.


OK. I did that, but nothing happened! Now what?

The PMG might have had a problem, but it is pretty good at leaving diagnostic messages around. Look in the $OPUS_HOME_DIR/pmg-######.log file (the hashes represent a string of arbitrary numbers) for messages from the PMG, or look in the scrolling message window at the bottom of the main display.

[PMG Message 
pane]


How do I know if a task exits abnormally?

If a process exits abnormally, the process status file "Status" field is updated with the string "absent". The PMG parses this status field and displays the word "absent" in the Status portion of the PMG for that process. A running total of Absent (as well as Suspended and Total processes) are tracked on the statistics line of the PMG (located at the bottom of the process status frame in the middle of the PMG).

[PMG with Absent 
Process]


What do I do if a process exits abnormally?

You can tell what the process was doing by viewing the log file for that process. Log files are kept in OPUS_HOME_DIR.


How do I view the log file for a particular process?

To view a log file for a particular process, the user simply selects the desired process with the mouse and, under the "Utilities" pull down menu, selects "Show Log".

[PMG Utilities Menu with Show Log chosen]

This causes another motif window to be created containing the log file for the selected process. The window initially displays the end of the file since pertinent error messages will have just been written there.

[Process
   Log File Window]

The window containing the log file allows the user to scroll through the text, search for text, and also copy text to the clipboard for pasting elsewhere.


How do I (logically) add/remove a machine to the local network of computers that are used by the PMG?

First, a "new" machine should already be physically and operationally connected to the network of computers being used by the OPUS pipeline (the OPUS pipeline does not have to use all the machines available to the local network, but to use a given machine, it must be available to the rest of the local network). Also, make sure the relevant rhosts files are updated to permit access to the new machine.

Next, select "Define nodes..." from the "Utilities" pull down menu:

[PMG Utilities 
Menu with Define Nodes chosen]

This brings up a dialog listing all of the nodes that OPUS knows about:

[PMG Define 
Nodes window]

To add a new node, type the name of the machine you wish to add in the "Add/Remove" text field, then press enter. The name will appear on the list of available nodes. To remove a node, select it from the list by clicking once on its name; this removes the selected node from the list, placing it in the "Add/Remove" text field where it can be edited or discarded. The node entries in the example above with the "::" are for VMS batch queues; the current release of the OPUS sample pipeline does not yet support this feature.

A user account can be specified as part of the node definition by prepending the node with the account name followed by the @ symbol. For example, a node entry bubba@foo indicates to the PMG that the process should be started on host foo under the account bubba. Note that the indicated user account must allow rsh transactions by the account name and host on which the PMG is running, and must be configured to run OPUS.

Press "OK" to save any changes you make. Note that these changes do not take effect until the next time the PMG is run. To negate any changes made, select "Cancel".


If I want to use another disk, how do I tell OPUS?

The disks are specified in the path file. You must modify your path file to include new disks.


How do I specify printers and a print command?

Certain windows brought up by the PMG allow printing of their contents. Such windows will contain a "Print" command under their "File" pull down menu. When "Print" is selected, a dialog containing printer names appears. At this point you choose to which printer the window contents are sent. The list of printers in this dialog is determined by the "Printer setup..." option under the PMG's "File" pull down menu.

[PMG File Menu with Printer Setup chosen]

Selecting "Printer setup..." brings up a dialog containing a list of printer names, a text field in which to "Add/Remove" printers, and a text field in which you define the command issued to the operating system to print the window contents:

[PMG Printer Setup window]

Note that the method used by the PMG to send data to a printer is to append a printer chosen from the list to the specified print command. As such, the last option to the print command must signal the operating system that the target printer is specified next. For example, in System V based Unix, the printer option is specified in the "lp" command with the "-d" option. Hence, the last option in the print command must be "-d", as in "lp -m -d"; "lp" alone is not acceptable.

To add a printer to the list, type its name in the "Add/Remove" text field, then press enter. The printer will be added to the list. To remove a printer from the list, select it in the list by clicking once on its name. This will remove the printer from the list, placing it in the "Add/Remove" text field. At this point it can be edited and re-entered to the list, or ignored.

Press "OK" to save any changes you make. Note that these changes do not take effect until the next time the PMG is run. To negate any changes made, select "Cancel".


How can I restrict the number of processes in a pipeline?

It is sometimes necessary to have a single, or a small number of a particular kind of task. For example, if you have a task which scans and modifies the directory of Observation Status Files it might be dangerous if two or more of these tasks are running at the same time.

The file pmg_restrictions.dat which is located in the OPUS_DEFINITIONS_DIR contains the control necessary for you to limit the number of tasks. The Process Manager will load this file when it is initially activated, and will ensure that the number of specified tasks is kept under the limit.

The syntax of entries is:

PROCESS.PATH.NODE = NUM_COPIES

where

Note that the "*" wildcard entry is allowed for the PATH and NODE components.

For example,

gifin.g2f.* = 1   !Allows only 1 instance of gifin in g2f path across all cpus
mytask.*.* = 1    !Allows only 1 instance of mytask in all paths across all cpus


Top of PMG FAQ

Top of OPUS FAQ