Using Clearcase and Grid Engine



In order to run remote jobs with Clearcase, it is necessary to invoke a special wrapper script which runs prior to the job. This script sets the appropriate view and will work for qrsh, qsub, qmake and qtcsh. First, create the wrapper script. For example:

---------------
#!/bin/sh
 if [ x_$CLEARCASE_ROOT = x_ ]; then
     /bin/sh -c "$*"
 else
# set the path to cleartool to the exact path for your site
     /usr/atria/bin/cleartool setview -exec "cd $SGE_O_WORKDIR;$*" \
         `basename $CLEARCASE_ROOT`
 fi
---------------
        QRSH_WRAPPER=/cc_wrapper

Then, to run a clearcase job:

- Set your clearcase view.

- cd to your work directory if necessary

- Run your job with qrsh with the following switch added:


     -v CLEARCASE_ROOT

This passes the CLEARCASE_ROOT variable to Grid Engine. Another method is to use qsub. This is desirable if there are many jobs that need to be run. In this case, QRSH_WRAPPER does not need to be set.


   qsub -v CLEARCASE_ROOT  

In this case, the cc_wrapper script is being submitted as a job script and the job arguments are being used as a vehicle to transfer the command.