*Warning this is still work in progress\!*
This is an example to run SLIC  the Simulator for the Linear Collider on the *[*FermiGrid*|http://fermigrid.fnal.gov/]* which is part of the *[*Open Science Grid*|http://www.opensciencegrid.org/]*.

*SLIC* is a Geant4-based simulations package that uses an XML geometry input format called LCDD to describe geometry, sensitive detectors and readout geometry.  In this  example *SLIC* is tared  up and put on a  web accessible disk space. The grid jobs {color:#3366ff}wgets{color} the tar file unpacks it and runs *SLIC*
on the stdhep files that is provided with the tar package.
This is only one way to do it, other option include:
** sending the tar file with the job submission
** install SLIC on nodes that are visible to the grid worker nodes
**  

----
*Prerequisites for sending jobs to the GRID are*:
1) get a DOE grid certificate:
[http://security.fnal.gov/pki/Get-Personal-DOEGrids-Cert.html]
This page also explains how to export the certificate from the browser and how to deal with directory permissions and such.

2) register to the ILC VO (Virtual organization)
[http://cd-amr.fnal.gov/ilc/ilcsim/ilcvo-registration.shtml]
that will guide you to:
[https://voms.fnal.gov:8443/vomrs/ilc/vomrs]

3) Everything is set up  on ILCSIM. So to try things out it is recommeneded to  get an account on *ILCSIM* using the following form
[http://cd-amr.fnal.gov/ilc/ilcsim/ilcsim.shtml]

If you don't use *ILCSIM* as the gateway the Virtual Data Toolkit (VDT) needs to be installed on the machine from where you want to submit jobs.  And as always if you plan on running any grid services you'll need a *host certificate* for your machine.

----
*The Example*

The *SLIC* test job below actually tries to store the output in mass storage using the grid srmcp file transfer tool. But It's probably easier to transfer the output via condor. An example will be provided once it has been tested.:-)

{color:#3366ff}.  /fnal/ups/grid/vdt/setup.sh{color}
{color:#3366ff}voms-proxy-init \-voms ilc:/ilc/detector{color}
{color:#3366ff}(give passwd etc.){color}

to submit the job do:
{color:#3366ff}condor_submit mytestslicjob.run{color}

where the job description file mytestslicjob.run looks like: 

{color:#006600}universe = grid{color}
{color:#006600}type = gt2{color}
{color:#006600}globusscheduler = fngp-osg.fnal.gov/jobmanager-condor{color}
{color:#006600}executable = /home2/ilc/wenzel/grid/test_slic.sh{color}
{color:#006600}transfer_output = true{color}
{color:#006600}transfer_error = true{color}
{color:#006600}transfer_executable = true{color}
{color:#006600}log = myjob.log.$(Cluster).$(Process){color}
{color:#006600}notification = NEVER{color}
{color:#006600}output = myjob.out.$(Cluster).$(Process){color}
{color:#006600}error = myjob.err.$(Cluster).$(Process){color}
{color:#006600}stream_output = false{color}
{color:#006600}stream_error = false{color}
{color:#006600}globusrsl = (jobtype=single)(maxwalltime=999){color}
{color:#006600}queue{color}

which triggers the following script:

{color:#006600}\#\!/bin/sh \-f{color}
{color:#006600}wget{color} [http://kyoto.fnal.gov/wenzel/SimDist.tgz]
{color:#006600}tar xzf SimDist.tgz{color}
{color:#006600}cd SimDist{color}
{color:#006600}printenv{color}
{color:#006600}scripts/slic.sh \-r 5  \-g sidaug05.lcdd \-i ffHAA_2k.stdhep  \-o ffHAA_2k{color}
{color:#006600}ls ffHAA_2k.slcio{color}
{color:#006600}\#This sets up the environment for osg{color}
{color:#006600}. $OSG_GRID/setup.sh{color}
{color:#006600}source $VDT_LOCATION/setup.csh{color}
{color:#006600}srmcp "file:///${color}
{PWD}
{color:#006600} {color}

{color:#006600}/ffHAA_2k.slcio" "srm://cmssrm.fnal.gov:8443/srm/managerv1?SFN=/2/wenzel/slic/ffHAA_2k.slcio"{color}

To run some commands directly on the grid head nodes use a syntax like this:

{color:#3366ff}globus-job-run fngp-osg.fnal.gov/jobmanager-condor /bin/ls /grid/app{color}
{color:#3366ff}globus-job-run fngp-osg.fnal.gov/jobmanager-condor /usr/bin/printenv{color}
{color:#3366ff}globus-job-run fngp-osg.fnal.gov/jobmanager-condor /bin/df{color}

The examples above show how to check what grid applications are installed, the runtime environment of a job and what file systems are mounted.