More on usage of Random Numbers (taken from isajet$doc)

Random Number use with CDF's ISAJET

The ISAJET Monte Carlo generator originally uses the CERNlib RANF() function to generate random numbers. The RANF function itself is mapped onto a RANMAR sequence in its current CERNlib implementation.

This approach provides several problems in the CDF environment. In CDF Monte Carlo generators are normally not run on their own but inside analysis control with several other modules. The use of a "public" random number generator with only one active sequence at a time allows other consumers to pull undetected random numbers from the same sequence. This in term causes ISAJET generations to become unreproducable. A RANF() random number generator has only one predefined sequence. Thus jobs of same generation cannot be run in parallel with well defined, independent, random number sequence. Chaining jobs is the only possibility. It is rather painfull and requires changing the ISAJET parameter file for each job.

The CDF random number interface package provides a solution to the above short commings. Starting with ISAJET version v7_06 the ISAJET random number handling was replaced by calls to the new CDF interface package. For more detailed information on this package, please see CDF-2459, WWW offline r_n documentation, or R_N$DOC:rn_note.doc. ISAJET has now its own random number stream with well defined, reproducable, machine-independent sequences for all 800 000 jobs sequences.

A consequence of this switch is that the SEED keyword in the ISAJET parameter file is no longer used and ignored. Of primary interest to novice users is probably the how to save and reload seeds (to chain jobs) and how to switch to a different jobs sequences (to run jobs in parallel). The r_n interface package writes the status of all initialized r_n streams at the end of a job to the file defined by RNSTAT. If the logical/environmental variable is not defined, no file is written (the default). A seed file saved through RNSTAT can be reloaded at the beginning of a job by pointing RNSEED to this file. Most interesting to people, however, is probably the ability to run several generation jobs in parallel. The logical/environmental variable RNJSEQ defines the job sequence used by a job. The default is 1.

Attached some examples:

a) to run 3 jobs with well defined random number sequence in parallel:

   1st job:                 2nd job:                    3rd job:
   ========                 ========                    ========
                            setenv RNJSEQ 2             setenv RNJSEQ 3
   run executable           run executable              run executable

b) to run 2 chained jobs in parallel:

   1st job:                            2nd job:
   ========                            ========
                                       setenv RNJSEQ 2
   setenv RNSTAT s_1001.dbt            setenv RNSTAT s_2001.dbt
   run executable                      run executable
                                       unsetenv RNJSEQ

   setenv RNSEED s_1001.dbt            setenv RNSEED s_2001.dbt
   setenv RNSTAT s_1002.dbt            setenv RNSTAT s_2002.dbt
   run executable                      run executable

   setenv RNSEED s_1002.dbt            setenv RNSEED s_2002.dbt
   setenv RNSTAT s_1003.dbt            setenv RNSTAT s_2003.dbt
   run executable                      run executable

   setenv RNSEED s_1003.dbt            setenv RNSEED s_2003.dbt
   setenv RNSTAT s_1004.dbt            setenv RNSTAT s_2004.dbt
   run executable                      run executable
   :                                   :
   :                                   :

adapted by Marcus Hohlmann ( Jun 17, 1996