sreview-dispatch - Watch the database for talks that need work done, and schedule jobs for them
sreview-dispatch is the central script for SReview. It can be used in two ways:
Either you run it with an external scheduler (e.g., gridengine, slurm, PBS, torque). This is the recommended way of using SReview for large installations. In this mode of operation,
sreview-dispatchshould be run once in the entire network, and the
query_limitconfiguration value should be set to 0.
Or you run it with no external scheduler. This is the default. In this mode of operation, it is recommended that the
query_limitconfiguration parameter is set to a nonzero value, so that individual
sreview-dispatchinstances do not take all the work, keeping all the other instances idle. In this mode of operation, one
sreview-dispatchinstance should be run per CPU core on every machine that is used for performing work.
This mode works, but using an external scheduler allows for operating more flexibly on pending jobs, and on the addition or removal of extra nodes.
sreview-dispatch uses the system-wide SReview configuration. For more information, see sreview-config
sreview-dispatch considers the following configuration values:
The database connection string
A hash table of shell commands to execute when a talk is found in a particular state with the
waitingprogress value. The hash key should be the state name.
If a state is not specified in the
sreview-dispatchwill ignore that state. This allows for handling particular states on particular hosts, if necessary.
The shell commands can use the following template variables:
The maximum number of requests that should be handled per loop. Should be set to 0 (meaning infinity) when using an external scheduler; should probably be set to 1 when not.
The event in use for this instance of SReview. In previous versions of SReview, the dispatcher would run things for every event in the database; since version 0.4 this is no longer the case. This allows multiple instances of SReview to exist on the same host, sharing the same database if wanted.
The location where stderr and stdout output should be written to. This is supposed to be a directory; it is reasonable to create a file for stderr and a file for stdout for each script run.
sreview-dispatch currently polls the database every 10 seconds. This should be changed to an event-based system based on PostgreSQL asynchronous notifications.