#
#
# The 'di_pairing' script is called from Custom Pairing Mode.
# It receives one parameter - pathname of a csh script to be sourced.
# This csh script contains the following information : 
#
# set outFILE    = ($GENESIS_TMP/di_pairs_out)
#
# In addition the following environment variables are set by Genesis :
#
#   JOB          - Current job
#
# Format of the output file is a list of pairs (layer can be single), for example
#        
# layer1 layer2
# layer3
# layer4 layer5
# layer6 layer7        
# layer8 layer9
# layer10        
        

# Define correct temp. dir. depending on env. vars.
if ($?GENESIS_TMP) then
        set TMP = $GENESIS_TMP
else if ($?GENESIS_DIR) then
        set TMP = $GENESIS_DIR/tmp
else
        set TMP = /genesis/tmp
endif

#To check if the script is running, un-comment the following line.
#echo "Starting custom pairing on job - " $JOB > $TMP/test_di_pair

#Do not comment out
source $1

#Run the pairing program, it's output should be written to the outFILE variable.

#Example
#echo "cs ps" > ${outFILE}
#echo "in01 in02" >> ${outFILE}
#echo "in03 in04" >> ${outFILE}        
#echo "sm-top sm-bot" >> ${outFILE}
