Production scripts

Aus HERMESwiki
Zur Navigation springen Zur Suche springen

uDST production scripts

In a normal production, the uDST daemon spawns off a subprocess which performs the required task via the following four scripts:

1.

handle_uDSTproduction

2.

setup_production

3.

execute_uDST_preprocessors.sh

4.

do_production

5.

wipe_production

6.

prepare_runlist.sh

7.

prepare_burstbounds.sh

All of these scripts expect that the required environment variables for a uDST production have been created. If the scripts are executed by the daemon, these variables will be created according to the contents of the udst.conf files and the fill's entry in the fill.conf files. On the otherhand, when the production manager executes these scripts by hand, it is necessary to create these variables first. Typically, this task can be performed by executing one of the following commands from the directory containing the executeable code for a production (typically the bin subdirectory in a production):

. setup_environment.sh

for sh/bash shells or

source setup_environment.csh

for csh/tcsh shells.


the handle_uDSTproduction script

This script has no documentation at the moment. Such bad luck.


the setup_production script

In detail, the "setup_production" script does the following tasks:

(1) checks that all of the required environment variables exist; if not, it will record an error message in its logfile and then abort the production via an "exit 1" command.
(2) from the deepest subdirectory in the current working directory, the script determines the fill name for the fill being produced.
(3) check that the slow control production exists; if not, it report an error message in its logfile and then abort the production via an "exit 1" command.
(4)

make the symlink to the slow control production information required for the production. Presently, the following two slow production files are used by the uDST production:

(a) runlist - this file contains a list of run numbers for the runs in this fill. A symlink of the same name is created to this file.
(b) fill.(...).da.(gz) - the fillfile containing all of the slow control information for a fill. A symlink called either fillfile.da or fillfile.da.gz (depending on whether the fillfile is compressed or not) is created to this file.
(5) using the list of run numbers in the runlist file, make the symlinks to the hrc.devents files for the runs in the fill.
(6) make a symlink to ASCII files containing the data quality information from Kevin McIlhany for the CAEN HV and the GMS (only meaningful for 96 data).
(7) make a symlink to ASCII file containing the descriptions for the table monitoring.
(8) make a symlink to event_checker executeable. The executable is expected to be located in the bin directory of the production base directory.
(9) make a symlink to the udst_maker executeable. The executeable is expected to be located in the bin directory of the production base directory.
(10) insert an entry for this fill into the operations directory

the execute_uDST_preprocessors.sh script

If "setup_production" script was successful, the "execute_uDST_preprocessor.sh" script will be executed. This script executes the preprocessor programs and scripts which collect and generate necessary input files for the uDST production program. To be specific, this script does the following tasks:

(1) checks that all of the required environment variables exist; if not, it will abort the production via an "exit 1" command.
(2) allocates the disk space needed by the preprocessor scripts/programs. at present, the code allocates 1000 kB of disk space for each run in the fill. if this space is not available and the production is being run on the opa account, the production will fail at this point (via an exit 1)
(3) create the CAEN HV trip list file (which is called trip_list.dat) for the fill. this task is accomplished by executing the udst_handleCAENHV.sh script. if script fails, the production will fail at this point (via an exit 1)
(4) collects the run-level data quality information for the runs in this fill from the various runlists and store this information into the runlist file called runs.dat. This operation is handled by the prepare_runlists.sh shell script. if this task fails, a warning message will be placed into the log file but the production will still proceed. However, one should be aware that, in this case, the runlist placed into the resulted uDSTs is probably suspect.
(5) create the GMS dead detector file (which is called gms_deaddets_per_burst.dat) for the fill. this task is accomplished by executing the prepare_gms_deaddets.sh script. if this task fails, a warning message will be placed into the log file and the production will proceed. However, the GMS dead detector information in the resulted uDSTs will probably be suspect.
(6) create the production version file (which is called production_version.dat) for the fill by collecting the production version files created for each run by the main (hrc) production.
(7) create the burst boundary file (which is called burstbounds.dat) for the fill. this task is accomplished by executing the prepare_burstbounds.sh script. if this task fails, a warning message will be placed into the log file and the production will proceed. However, the burst boundary information in the resulted uDSTs will probably be suspect.
(8) executes the event_checker code on the hrc files to locate event jumps and other oddities in the event data. These problems are chronicled in the event_checker_file. Later, this file is fed into the uDST production program so that the records with these problems are appropriately marked. If this tasks core dumps, the production will terminate at this point (via an exit 1). because the uDST production program, also being a HANNA-frame code, will very likely also fail on this fill. On the other hand, if this task fails but does not produce a core dump, only a warning message will be put to the log file.

the do_production script

If "execute_uDST_preprocessor.sh" script was successful executed, the "do_production" script will be executed. This script executes the uDST production program and thereby makes the uDSTs. To be specific, it does the following tasks:

(1) checks that all of the required environment variables exist; if not, it will abort the production via an "exit 1" command.
(2) checks that there are hrc files for this fill. if not, it it will abort the production via an "exit 1" command.
(3)

allocates the disk space needed for the uDST production using the scalloc scheme. The production uses a multiple of the size of the hrc files for each run to determine the disk space needs for the uDSTs. At present, the multiple factors depend upon the production mode and the type of uDSTs as shown below:

TEST g1 2.0 (MB per run) PROD g1 4.0
sm 1.0 sm 3.0
pd 1.0 pd 3.0

if this space is not available and the production is being run on the opa account, the production will fail at this point (via an exit 1)

NOTE: The above multiplicative factors for determining the disk space needs for each uDST type have not been tuned.
(4) determine the format of the fillfile (i.e.DAD zipped or DAD not zipped) for the fill
(5)

set additional environment variables used by the uDST production to locate various ASCII input files. At present, the following environment variables are created:

(a) PID_DIRECTORY
this environment variable is used to locate the PID parent distributions for the calorimeter and TRD.
(b) TransPSmoothed_FILE
the environment variable is used to locate the file with the smoothed TPOL information whenever this information is not taken from the fillfile.
(c) calibrated_target_FILE
this environment variable is used to locate the file with the calibrated target information whenever this information is not taken from an fillfile.
(d) TARGETDQ_FILE
this environment variable is used to locate the file with the target DQ information whenever this information is not taken from an fillfile.
(e) RICH_ALIGNMENT_FILE and RICH_LOCAL_ALIGNMENT_FILE
these two alignment file environment variable are used to locate the two files containing the mirror alignment information for the RICH.
(6) sets the argument flags for the uDST production program
(7) executes the udst_maker program using command line options appropriate for the production mode (TEST or PRODuction) and the uDST type (g1 or sm or pd) as determined from the MODE and TYPE environment variables.
(8) check if there was a core file created. If so, there was a probably a production problem, so the production will record an error message in logfile and then abort via an "exit 1" command.
(9) creates the symlinks in the g1links, smlinks, or pdlinks directory for each uDST if the uDSTs were made in production mode.
(10) check that the number of produced uDSTs is the same as the number of hrc.devents files in the fill. If not, an error message (which includes a list of the runs without uDSTs) will be placed into the logfile and the production will abort via an exit 1.

the wipe_production script

This script has not been documented yet.


the prepare_runlist.sh script

This script has not been documented yet.


the prepare_burstbounds.sh script

This script has not been documented yet.