Sample Offline JOB Prototypes

The JOB prototypes are now distributed via CDS to the ~klue/dist/jobs directory on each participating machine. Note that ~klue/test.job now contains soft links to files in ~klue/dist/jobs . Old JOBs should be changed to the format of these JOB prototypes. The new JOB prototype is designed to run on any supported machine architecture, INTERACTIVELY or in the CCD BATCH farm. Before JOBs will run, one must add the lines: source ~klue/.cshrc.klue to one's file .cshrc , and source ~klue/.login.klue to one's file .login The JOBs currently in ~klue/dist/jobs are: 871data - runs the offline program on a data file. The JOB is run INTERACTIVELY with the command: 871data -f=data/run.0522 -x -o & , for example. The job can be submitted to the CCD BATCH farm with: klsub 871data -f=data/run.0522 -x The data path is relative to the absolute path given in the environment variable DATAROOT, defined in ~klue/.cshrc.klue , which the user should source in his .cshrc file. The "-o" JOB option diverts all STDERR, STDOUT and Fortran Unit 6 output to the $JOBNAME.printer file in the working directory. This diversion is done automatically for klsub invocations. To turn on script tracing, invoke 871data with the -x option. To turn on the debugging hooks use the -g option. The CERN libraries are automatically linked by the JOB. 871svc - identical to 871data, except for the line which defines the input data file for TAPE00. In this case TAPE00 points to an event server thread on The JOB is invoked with: 871svc -x -o & , for INTERACTIVE running or klsub 871svc -x , for the CCD BATCH farm. E871 detector groups should edit the integer "X" in "KHFSVC:X" on the TAPE00 line to point to the data server thread assigned to each detector group: thread no.(X) detector-group 10, 20, 30 online detector monitor programs 1, 11, 21, 31 CER 2, 12, 22, 32 MHO 3, 13, 23, 33 MRG 4, 14, 24, 34 PBG 5, 15, 25, 35 TSC 6, 16, 26, 36 STC - UTA 7, 17, 27, 37 STC - Stanford 8, 18, 28, 38 DCH - UCI 9, 19, 29, 39 offline Thread 0 is now restricted to starting up new threads. 871mcwrit - identical to 871data and 871svc except for 3 JCPARM flags: &JCPARM JBTPUS=2, ICUTUS=7, ===> LGENUS=T, turns on the Monte Carlo generator as event source ===> LRTPUS=F, turns off event reading from TAPE00 ===> LWTPUS=T, turns on event writing to TAPE99 in stage 11 TLFTUS=15, &END You can define ENVIRONMENT variables for the inside of a JOB from the command line when you submit the JOB using a new option: -Denvironment_variable=value For example, you can change the JOBNAME to be different from the name of the JOBSCRIPT which you are running. The files produced by the JOB will have names like ${JOBNAME}.printer, etc., instead of the default ${JOBSCRIPT}.* names. Using -DJOBNAME=... allows you to run several JOBs simultaneously from the same JOB script, without conflict between the JOBs submitted from the same directory. Another use of the -D... option allows redefinition of the JOB's TAPE00 or TAPE99 variables from outside the JOB. If you submit the JOB with: -DTAPE00=my_input_file this will override the TAPE00 definition in the JOB script, provided the TAPE00 line within the JOB has the new form: export TAPE00; TAPE00=${TAPE00-"${DATAROOT}/${DATAFILE}"} This construction only sets TAPE00 to ${DATAROOT}/${DATAFILE} provided TAPE00 has not been previously defined. The option: -DTAPE99=/dev/null pipes event output to the NULL device (throws it away), if the JOB has: export TAPE99; TAPE99=${TAPE99-${JOBNAME}.tape99} The sample JOBs in ~klue/dist/jobs now reflect this construction for several variables. One can use the -D... mechanism to send environment variables to the Mortran of the JOB, using: CHARACTER*256 value_string; "Here 256 is arbitrary, but must be enough" CALL GETENV('varname',value_string); to retrieve their values from within the Mortran. The -D... construction works for JOBs run INTERACTIVELY and in BATCH. The position of the option is unimportant within the klsub invocation. These two forms both work: -Dvar1=value1 -D var2=value2