Castor is a mass-storage system which is composed of two parts:
  • the tape library, with
  • some buffer-disk in front of it

A real-life example

Suppose you want to run Medea on the RAW data of run 00012312.
First, you need to find out what DATA files are associated to such run.
[argoprod@ui01-lcg RecoTools]$   argoonl --showfiles --castor --runs
00012312
NAME RUNTYP DATE STARTTIME STOPTIME SECOND
NUMEV NFILE SIZE STAT
run-00012312-20060760455 PROD 06/01/01 00:07:04 00:07:05 1
3336729 10 10.54 3
FILE
/castor/cnaf.infn.it/argo/argo-cnaf/raw/2006/J07/000/123/run-00012312-20060760455/run-00012312-20060760455.000
FILE
/castor/cnaf.infn.it/argo/argo-cnaf/raw/2006/J07/000/123/run-00012312-20060760455/run-00012312-20060760455.001
FILE
/castor/cnaf.infn.it/argo/argo-cnaf/raw/2006/J07/000/123/run-00012312-20060760455/run-00012312-20060760455.002
FILE
/castor/cnaf.infn.it/argo/argo-cnaf/raw/2006/J07/000/123/run-00012312-20060760455/run-00012312-20060760455.003
FILE
/castor/cnaf.infn.it/argo/argo-cnaf/raw/2006/J07/000/123/run-00012312-20060760455/run-00012312-20060760455.004
FILE
/castor/cnaf.infn.it/argo/argo-cnaf/raw/2006/J07/000/123/run-00012312-20060760455/run-00012312-20060760455.005
FILE
/castor/cnaf.infn.it/argo/argo-cnaf/raw/2006/J07/000/123/run-00012312-20060760455/run-00012312-20060760455.006
FILE
/castor/cnaf.infn.it/argo/argo-cnaf/raw/2006/J07/000/123/run-00012312-20060760455/run-00012312-20060760455.007
FILE
/castor/cnaf.infn.it/argo/argo-cnaf/raw/2006/J07/000/123/run-00012312-20060760455/run-00012312-20060760455.008
FILE
/castor/cnaf.infn.it/argo/argo-cnaf/raw/2006/J07/000/123/run-00012312-20060760455/run-00012312-20060760455.009
Note that "argoonl" only returns the DATA files, not the auxiliary ones like the .final. However, there is a way to ask CASTOR all files relevant to any given run. You get any FILE string returned above, strip the last part (the file name) and run "nsls -l ...", that is:
[argoprod@ui01-lcg RecoTools]$ nsls -l
/castor/cnaf.infn.it/argo/argo-cnaf/raw/2006/J07/000/123/run-00012312-20060760455/
mrw-r--r-- 1 argoprod argo 1065109528 Apr 03 00:54
run-00012312-20060760455.000
mrw-r--r-- 1 argoprod argo 1065485712 Apr 03 00:57
run-00012312-20060760455.001
mrw-r--r-- 1 argoprod argo 1065271960 Apr 03 01:02
run-00012312-20060760455.002
mrw-r--r-- 1 argoprod argo 1065264144 Apr 03 01:05
run-00012312-20060760455.003
mrw-r--r-- 1 argoprod argo 1065404800 Apr 03 01:07
run-00012312-20060760455.004
mrw-r--r-- 1 argoprod argo 1065412160 Apr 03 01:10
run-00012312-20060760455.005
mrw-r--r-- 1 argoprod argo 1065497336 Apr 03 01:13
run-00012312-20060760455.006
mrw-r--r-- 1 argoprod argo 1065255928 Apr 03 01:15
run-00012312-20060760455.007
mrw-r--r-- 1 argoprod argo 1065441820 Apr 03 01:18
run-00012312-20060760455.008
mrw-r--r-- 1 argoprod argo 959123456 Apr 03 01:20
run-00012312-20060760455.009
mrw-r--r-- 1 argoprod argo 1509 Apr 03 01:20
run-00012312-20060760455.error
mrw-r--r-- 1 argoprod argo 371293 Apr 03 01:20
run-00012312-20060760455.final
In the script you will submit to the batch system you need to put, for each file, a line which will stage the file from tape and copy to the worker node. In our example, you should use:
...
rfcp
/castor/cnaf.infn.it/argo/argo-cnaf/raw/2006/J07/000/123/run-00012312-20060760455/run-00012312-20060760455.000
/data/run-00012312-20060760455.000
rfcp
/castor/cnaf.infn.it/argo/argo-cnaf/raw/2006/J07/000/123/run-00012312-20060760455/run-00012312-20060760455.001
/data/run-00012312-20060760455.001
rfcp
/castor/cnaf.infn.it/argo/argo-cnaf/raw/2006/J07/000/123/run-00012312-20060760455/run-00012312-20060760455.002
/data/run-00012312-20060760455.002
... and so on for the other DATA files and the .final ...
... and then the instructions you need to run Medea ...
Of course, your fileInput should reflect the location of the files on the worker node: the files will be found under /data/, not under /castor/!
By the way, the above rfcp commands were obtained by a cut-and-paste from the output of:
  argoonl --showfiles --castor --runs 00012312 | grep ^FILE | sed -e 's/FILE/rfcp/' | awk -F/ '{print $0" /data/"$NF}'
Easy, isn't it? :-)
Don't forget to also copy the .final file to the worker node!

Additional information