wiki:eqbuf
Last modified 8 years ago Last modified on 05/28/12 10:36:01

Earthworm Module: eqbuf

Contributed by:

Function

Buffers events (part of mega-module)

Details

Eqbuf is a sub-module in Earthworm's event-processing mega-module. It is generally the second link in the mega-module and is started by the first link (either eqproc or eqprelim). Eqbuf in turn starts up the third link (generally eqcoda) and communicates to it via a one-directional pipe. Once the third link is started, eqbuf's job is simply to buffer all the messages output by the process that started it. This allows the "head" module to produce events as fast as it cares to while allowing the "tail" of the mega-module to take its time finishing the event-processing. Eqbuf never looks inside a message, it just passes them thru as they are.

Configuration File Commands

On startup, eqbuf reads the configuration file named on the command-line. In the control file, lines may begin with a valid eqbuf command (listed below) or with one of 2 special characters:

#  marks the line as a comment (example: # This is a comment).

@  allows control files to be nested; one control file can be
   accessed from another with the command "@" followed by
   a string representing the path name of the next control file
   (example: @model.d).

Command names must be typed in the control file exactly as shown in this document (upper/lower case matters!).

EXAMPLE CONFIGURATION FILE

 #
#                 Eqbuf's Configuration File
#
#
MyModuleId  MOD_EQPROC     # Module id used to label the logfile.  Eqbuf is a
                           # descendent of the eqproc program.  All descendents
                           # of eqproc need to use eqproc's module id.
#
RingSize   10              # Buffer will hold RingSize items of size MAX_BYTES_PER_EQ
LogFile     1              # 0=no log; 1=log errors
PipeTo  "eqcoda eqcoda.d"  # The child program to be spawned by eqbuf

FUNCTIONAL COMMAND LISTING

Below are the commands recognized by eqbuf, grouped by the function they influence. ALL the commands are required; they must be specified in the control file in order for eqbuf to operate.

	Earthworm system setup:
 		MyModuleId	required
                PipeTo          required

	Output Control:
		LogFile		required

ALPHABETIC COMMAND LISTING & DESCRIPTION

In the following section, all configuration file commands are listed in alphabetical order. Listed along with the command (bold-type) are its arguments (in red), the name of the subroutine that processes the command, and the function within the module that the command influences. A detailed description of the command and is also given. Default values and the values used by Calnet are listed after each command description.

The following list is organized by:

command [argument here]

LogFile [switch]
Processed by: eqbuf_config
Function: output

Sets the on-off switch for writing a log file to disk. If switch is 0, no log file will be written. If switch is 1, eqbuf will write daily log file(s) called eqbufxx.log_yymmdd where xx is eqbuf's module id (set with "MyModuleId" command) and yymmdd is the current UTC date (ex: 960123) on the system clock. The file(s) will be written in the EW_LOG directory (environment variable).

Default:  none

MyModuleId [mod_id]
Processed by: eqbuf_config
Function: Earthworm setup

Sets the module id for labeling all outgoing messages. mod_id is a character string (valid strings are listed in earthworm.d) that relates (in earthworm.d) to a unique single-byte number.

NOTE: eqbuf is part of a mega-module which is ultimately started by the program eqproc. All sub-modules of this megamodule should be given the same module id.

Default: none Calnet: MyModuleId MOD_EQPROC

PipeTo [cmdstring]
Processed by: eqbuf_config
Function: Earthworm setup

Sets the command to which eqproc will pipe a "binder-finalized" event for the next step in earthquake processing. Blank spaces are allowed in cmdstring as long as the entire command is enclosed in double-quotes.

Default:  none
Calnet:   PipeTo "eqcoda eqcoda.d"

Helpful Hints