Linking and Running Using SAM Manager


If you have a framework executable, and you want to use a file that has been stored using sam for input, here's what you have to do:
 
 

Step 1: Linking

Now you have to recompile your executable, adding sam_manager's (sam_manager is a package) registration object  RegSAMManager and the sam_manager library to your CTEST instruction files (OBJECTS and LIBRARIES).  If you're not using CTEST, you should use arch_spec_orbacus.mk.

Step 2: RCP

You're now ready to change your rcp files.  In the main rcp (the one given on the command line, you need to add sam, for example
RCP sam = <mypackage  Sam>
sam then goes first in the list of packages to run.

In your ReadEvent.rcp, you change the InputFile to
string InputFile = "SAMInput:"

And you need to create a file Sam.rcp which contains (for example)
// ---------------------------------------------------------------
// SAMManager.rcp
// ---------------------------------------------------------------

string PackageName = "SAMManager"
string ApplicationFamily = "digitizer"
string ApplicationVersion = "pmc02_01"
string FileStoreLocation = "/pnfs/sam/mammoth/mcc99/"

int FileRequestTimeOut = 15     // in minutes; default 0 (indefinitely)
int StoreRequestTimeOut = 15    // in minutes; default 0 (indefinitely)
 

Step 3: Running the job

The best thing is to write a little shell script, here's a commented example:

#!/bin/sh

# environment variables
DATE=`date +%m_%d_%y_%H_%M`

# Note: SAM_PROJECT  is _not_ the same thing as the "project" which defines the files
#            that will be accessed, and SAM_PROJECT _has_ to be unique!!!

export SAM_PROJECT=taul3signal_mcc99_2_qcd_20_$DATE
export SAM_STATION=central-analysis

# ups setups
. /usr/local/etc/setups.sh

# need to setup sam
setup sam

# some cleanup to run the job
rm -f l3tau.root

# start project and allocate buffer space
# I already created my project - it's called taul3signal_mcc99_2_qcd_20

sam start project --defname=taul3signal_mcc99_2_qcd_20 --snapvers=new
sam allocate buffer --disk=/prj_root/762/dma_1/sam/buffer/ \
                    --sizeK=1000000 \
                    --project=$SAM_PROJECT

# run framework application
/prj_root/781/alg_10/gusbroo/67dev/bin/IRIX6-KCC_3_3/L3TauAna  -project $SAM_PROJECT -station $SAM_STATION -rcp test.rcp

# stop project and deallocate buffer space
sam stop project
sam deallocate buffer --disk=/prj_root/762/dma_1/sam/buffer/ --sizeK=1000000 \
                      --project=$SAM_PROJECT
 

Thanks Gustaaf Brooijmans for writing the initial version of this guide. Please contact sam-design@fnal.gov or Gustaaf (Gustaaf Brooijmans)  if there are any mistakes in this user guide.



GB / 2-Dec-99