AliEn Tutorial

Solutions

Panos Christakoglou University of Athens - CERN

10/10/06 [email protected] -AliEn Tutorial 1 Installation of AliEn software Try it out

For the solutions, we assume that the user name is trn2301 with the following attributes: ● Local home : /home/trn2301 ● Alien home directory: /alice/cern.ch/user/t/trn2301 change the names accordingly to match your case!!!

Download the installer from the web []$ wget http://alien.cern.ch/alien-installer

Make the executable [bash]$ a+x alien-installer

Run the installer [bash]$ ./alien-installer

10/10/06 [email protected] -AliEn Tutorial 2 Authentication Try it out Get a valid proxy [bash]$ --> Your local bash [bash]$ grid-proxy-init [aliensh]$ --> Your alien bash //provide the password when asked shell No notation --> inside a file Get a valid token [bash]$ alien-token-init trn2301 //the username is optional and should be put if the local username isn't the same as the alien one

Get your proxy [bash]$ grid-proxy-info

Get your token info [bash]$ alien-token-info

10/10/06 [email protected] -AliEn Tutorial 3 General description of the shell Try it out (1) Access the shell [bash]$ --> Your local bash shell [bash]$ aliensh [aliensh]$ --> Your alien bash shell No notation --> inside a file Check your user name [aliensh]$

List the contents of your alien directory [aliensh]$ whoami

Check the alien working direcory [aliensh]$

10/10/06 [email protected] -AliEn Tutorial 4 General description of the shell Try it out (2)

Create the following directory structure in your alien $HOME directory: Tutorial/XML/jdl

[aliensh]$ Tutorial [bash]$ --> Your local bash shell [aliensh]$ --> Your alien bash [aliensh]$ mkdir Tutorial/XML shell No notation --> inside a file [aliensh]$ mkdir Tutorial/XML/jdl

Tutorial/XML/

[aliensh]$ mkdir Tutorial/XML/par

Tutorial/XML/output

[aliensh]$ mkdir Tutorial/XML/output

Tutorial/XML/selectors

[aliensh]$ mkdir Tutorial/XML/selector

Tutorial/XML/macros [aliensh]$ mkdir Tutorial/XML/macros

10/10/06 [email protected] -AliEn Tutorial 5 General description of the shell Try it out (3)

Get the information of the file: /alice/cern.ch/user/p/pchrist/Tutorial/XML/selectors/esdPt.C [aliensh]$ /alice/cern.ch/user/p/pchrist/Tutorial/XML/selectors/esdPt.C

[bash]$ --> Your local bash shell [aliensh]$ --> Your alien bash shell No notation --> inside a file

10/10/06 [email protected] -AliEn Tutorial 6 Working with the file catalog Try it out (1)

Exit the shell [bash]$ --> Your local bash shell [aliensh]$ --> Your alien bash [aliensh]$ shell No notation --> inside a file Create the following directory structure in your local $HOME directory: AliEn/PDC06/001 and AliEn/PDC06/002

[bash]$ mkdir AliEn

[bash]$ mkdir AliEn/PDC06

[bash]$ mkdir AliEn/PDC06/001

[bash]$ mkdir AliEn/PDC06/002

AliEn/Tags, AliEn/Local, AliEn/Interactive and AliEn/Batch

[bash]$ mkdir AliEn/Tags

[bash]$ mkdir AliEn/Local

[bash]$ mkdir AliEn/Interactive

[bash]$ mkdir AliEn/Batch

10/10/06 [email protected] -AliEn Tutorial 7 Working with the file catalog Try it out (2)

Copy the following files from the file catalog to your local $HOME/AliEn/Local directory: /alice/cern.ch/user/p/pchrist/Tutorial/LOCAL/ESD.par

[aliensh]$ /alice/cern.ch/user/p/pchrist/Tutorial/LOCAL/ESD.par file:/home/trn2301/AliEn/Local/ESD.par

/alice/cern.ch/user/p/pchrist/Tutorial/LOCAL/esdPt.C

[aliensh]$ cp /alice/cern.ch/user/p/pchrist/Tutorial/LOCAL/esdPt.C file:/home/trn2301/AliEn/Local/esdPt.C

/alice/cern.ch/user/p/pchrist/Tutorial/LOCAL/esdPt.h

[aliensh]$ cp /alice/cern.ch/user/p/pchrist/Tutorial/LOCAL/esdPt.h file:/home/trn2301/AliEn/Local/esdPt.h

/alice/cern.ch/user/p/pchrist/Tutorial/LOCAL/demoLocal.C

[aliensh]$ cp /alice/cern.ch/user/p/pchrist/Tutorial/LOCAL/demoLocal.C file:/home/trn2301/AliEn/Local/demoLocal.C [bash]$ --> Your local bash shell [aliensh]$ --> Your alien bash shell No notation --> inside a file 10/10/06 [email protected] -AliEn Tutorial 8 Working with the file catalog Try it out (3)

Copy the following files from the file catalog to your local $HOME/AliEn/Tags directory: /alice/cern.ch/user/p/pchrist/Tutorial/TAGS/ESD.par

[aliensh]$ cp /alice/cern.ch/user/p/pchrist/Tutorial/TAGS/ESD.par file:/home/trn2301/AliEn/Tags/ESD.par

/alice/cern.ch/user/p/pchrist/Tutorial/TAGS/CreateTags.C

[aliensh]$ cp /alice/cern.ch/user/p/pchrist/Tutorial/TAGS/CreateTags.C file:/home/trn2301/AliEn/Tags/CreateTags.C

[bash]$ --> Your local bash shell [aliensh]$ --> Your alien bash shell No notation --> inside a file

10/10/06 [email protected] -AliEn Tutorial 9 Working with the file catalog Try it out (4)

Copy the following files from the file catalog to your local $HOME/AliEn/PDC06/001 and $HOME/AliEn/PDC06/002 directories: /alice/cern.ch/user/a/aliprod/prod2006_2/output_pp/100/002/AliESDs.ro ot

[aliensh]$ cp /alice/cern.ch/user/a/aliprod/prod2006_2/output_pp/100/002/AliESDs. root file:/home/trn2301/AliEn/PDC06/001/AliESDs.root

/alice/cern.ch/user/a/aliprod/prod2006_2/output_pp/100/004/AliESDs.ro ot

[aliensh]$ cp /alice/cern.ch/user/a/aliprod/prod2006_2/output_pp/100/004/AliESDs. root file:/home/trn2301/AliEn/PDC06/002/AliESDs.root [bash]$ --> Your local bash shell [aliensh]$ --> Your alien bash shell No notation --> inside a file

10/10/06 [email protected] -AliEn Tutorial 10 Working with the file catalog Try it out (5) Query the f.c. and get all the tag files (*.tag.root) under: /alice/cern.ch/user/a/aliprod/prod2006_2/output_pp/100/* and redirect it to the file tag100.xml

[aliensh]$ -x tag100 alice/cern.ch/user/a/aliprod/prod2006_2/output_pp/100/* tag.root > tag100.xml Repeat the previous exercise, limiting this the number of output files to 10 and copy the xml file to your local $HOME/AliEn/Interactive

[aliensh]$ find -l 10 -x tag100 alice/cern.ch/user/a/aliprod/prod2006_2/output_pp/100/* tag.root > tag100.xml

[aliensh]$ exit

[bash]$ tag100.xml /home/trn2301/AliEn/Interactive/ [bash]$ --> Your local bash shell [aliensh]$ --> Your alien bash shell No notation --> inside a file

10/10/06 [email protected] -AliEn Tutorial 11 Local analysis Try it out

Open your local $HOME/AliEn/Tags/CreateTags.C file and modify it accordingly t->ReadLocalCollection("/home/trn2301/AliEn/PDC06"); [bash]$ --> Your local bash shell Run it to create the tag files. [aliensh]$ --> Your alien bash shell [bash]$ root.exe -b -q CreateTags.C No notation --> inside a file

Delete the single tag files and stay with just the merged one.

[bash]$ Run100.Event*

Go to your local $HOME/AliEn/Local directory and open the demoLocal.C file.

Change the line where you define the location of the tag files and run the macro.

TagAna->ChainLocalTags(“/home/trn2301/AliEn/Tags”);

[bash]$ root.exe demoLocal.C

Impose some selection criteria inside the macro and rerun the example.

EvCuts->SetMultiplicityRange(10,15);

10/10/06 [email protected] -AliEn Tutorial 12 Interactive analysis Try it out (1)

Copy the following files to your local $HOME/AliEn/Interactive:

/alice/cern.ch/user/p/pchrist/Tutorial/INTERACTIVE/ESD.par

[aliensh]$ cp /alice/cern.ch/user/p/pchrist/Tutorial/INTERACTIVE/ESD.par file:/home/trn2301/AliEn/Interactive/

/alice/cern.ch/user/p/pchrist/Tutorial/INTERACTIVE/esdPt.h

[aliensh]$ cp /alice/cern.ch/user/p/pchrist/Tutorial/INTERACTIVE/esdPt.h file:/home/trn2301/AliEn/Interactive/

/alice/cern.ch/user/p/pchrist/Tutorial/INTERACTIVE/esdPt.C

[aliensh]$ cp /alice/cern.ch/user/p/pchrist/Tutorial/INTERACTIVE/esdPt.C file:/home/trn2301/AliEn/Interactive/

/alice/cern.ch/user/p/pchrist/Tutorial/INTERACTIVE/demoInteractive.C

[aliensh]$ cp /alice/cern.ch/user/p/pchrist/Tutorial/INTERACTIVE/demoInteractive.C file:/home/trn2301/AliEn/Interactive/

10/10/06 [email protected] -AliEn Tutorial 13 Interactive analysis Try it out (2)

Go to your local $HOME/AliEn/Interactive directory and open the demoInteractive.C file. Change the line where you define the tag collection and put the name of the file you created by querying the f.c (it should be tag100.xml).

TAlienCollection* coll = TAlienCollection::Open("tag100.xml");

Run the macro.

[bash]$ root.exe demoInteractive.C

Impose some selection criteria and rerun the example.

EvCuts->SetMultiplicityRange(10,15);

[bash]$ --> Your local bash shell [aliensh]$ --> Your alien bash shell No notation --> inside a file

10/10/06 [email protected] -AliEn Tutorial 14 Batch analysis Try it out (1) Copy the following files to $HOME/AliEn/Batch:

/alice/cern.ch/user/p/pchrist/Tutorial/BATCH/ESD.par

[aliensh]$ cp /alice/cern.ch/user/p/pchrist/Tutorial/BATCH/ESD.par file:/home/trn2301/AliEn/Batch/

/alice/cern.ch/user/p/pchrist/Tutorial/BATCH/esdPt.h

[aliensh]$ cp /alice/cern.ch/user/p/pchrist/Tutorial/BATCH/esdPt.h file:/home/trn2301/AliEn/Batch/

/alice/cern.ch/user/p/pchrist/Tutorial/BATCH/esdPt.C

[aliensh]$ cp /alice/cern.ch/user/p/pchrist/Tutorial/BATCH/esdPt.C file:/home/trn2301/AliEn/Batch/

/alice/cern.ch/user/p/pchrist/Tutorial/BATCH/demoBatch.C

[aliensh]$ cp /alice/cern.ch/user/p/pchrist/Tutorial/BATCH/demoBatch.C file:/home/trn2301/AliEn/Batch/

10/10/06 [email protected] -AliEn Tutorial 15 Batch analysis Try it out (2)

/alice/cern.ch/user/p/pchrist/bin/batch.sh

[aliensh]$ cp /alice/cern.ch/user/p/pchrist/Tutorial/BATCH/batch.sh file:/home/trn2301/AliEn/Batch/

/alice/cern.ch/user/p/pchrist/Tutorial/BATCH/pp10.xml

[aliensh]$ cp /alice/cern.ch/user/p/pchrist/Tutorial/BATCH/pp10.xml file:/home/trn2301/AliEn/Batch/

/alice/cern.ch/user/p/pchrist/Tutorial/BATCH/analysis.jdl

[aliensh]$ cp /alice/cern.ch/user/p/pchrist/Tutorial/BATCH/analysis.jdl file:/home/trn2301/AliEn/Batch/

[bash]$ --> Your local bash shell [aliensh]$ --> Your alien bash shell No notation --> inside a file

10/10/06 [email protected] -AliEn Tutorial 16 Batch analysis Try it out (3)

Modify the InputFile, InputDataCollection and OutputDir fields of your analysis.jdl.

InputFile= {"LF:/alice/cern.ch/user/t/trn2301/Tutorial/XML/selectors/esdPt.C",

"LF:/alice/cern.ch/user/t/trn2301/Tutorial/XML/selectors/esdPt.h",

"LF:/alice/cern.ch/user/t/trn2301/Tutorial/XML/par/ESD.par",

"LF:/alice/cern.ch/user/t/trn2301/Tutorial/XML/macros/demoBatch.C"};

InputDataCollection="LF:/alice/cern.ch/user/t/trn2301/Tutorial/XML/xml/pp10.xml,nodow nload";

OutputDir="/alice/cern.ch/user/t/trn2301/Tutorial/XML/output";[bash]$ --> Your local bash shell [aliensh]$ --> Your alien bash shell No notation --> inside a file 10/10/06 [email protected] -AliEn Tutorial 17 Batch analysis Try it out (4)

Enter the shell and go to your AliEn $HOME directory. [bash]$ --> Your local bash shell [bash]$ aliensh [aliensh]$ --> Your alien bash shell [aliensh]$ No notation --> inside a file Copy the local batch.sh to your AliEn $HOME/bin.

[aliensh]$ cp file:/home/trn2301/AliEn/Batch/batch.sh bin/batch.sh@ALICE::CERN::Castor2

Copy the local analysis.jdl to your AliEn $HOME/Tutorial/XML/jdl.

[aliensh]$ cp file:/home/trn2301/AliEn/Batch/analysis.jdl Tutorial/XML/jdl/analysis.jdl@ALICE::CERN::Castor2

Copy the local pp10.xml to your AliEn $HOME/Tutorial/XML/xml.

[aliensh]$ cp file:/home/trn2301/AliEn/Batch/pp10.xml Tutorial/XML/xml/pp10.xml@ALICE::CERN::Castor2

10/10/06 [email protected] -AliEn Tutorial 18 Batch analysis Try it out (5)

Copy the local ESD.par to your AliEn $HOME/Tutorial/XML/par. [aliensh]$ cp file:/home/trn2301/AliEn/Batch/ESD.par Tutorial/XML/par/ESD.par@ALICE::CERN::Castor2 Copy the local esdPt.* to your AliEn $HOME/Tutorial/XML/selectors. [aliensh]$ cp file:/home/trn2301/AliEn/Batch/esdPt.C Tutorial/XML/selectors/esdPt.C::CERN::Castor2 [aliensh]$ cp file:/home/trn2301/AliEn/Batch/esdPt.h Tutorial/XML/selectors/esdPt.h::CERN::Castor2 Copy the local demoBatch.C to your AliEn $HOME/Tutorial/XML/macros. [aliensh]$ cp file:/home/trn2301/AliEn/Batch/demoBatch.C Tutorial/XML/macros/demoBatch.C::CERN::Castor2 Go to your AliEn $HOME/Tutorial/XML/jdl and submit the job. [aliensh]$ cd Tutorial/XML/jdl [bash]$ --> Your local bash shell [aliensh]$ submit analysis.jdl [aliensh]$ --> Your alien bash shell No notation --> inside a file

10/10/06 [email protected] -AliEn Tutorial 19 Batch analysis Try it out (6)

Check your job priority. [bash]$ --> Your local bash shell [aliensh]$ --> Your alien bash [aliensh]$ check priority jobs trn2301 shell No notation --> inside a file

Display all your active jobs.

[aliensh]$ -user trn2301

Display the jdl of your job:

[aliensh]$ -jdl XXX (where XXX is the given job id)

Trace the status of your job:

[aliensh]$ ps -trace XXX (where XXX is the given job id)

10/10/06 [email protected] -AliEn Tutorial 20 Batch analysis Try it out (7)

When the job 's status turns to RUNNING you can get the stdout and stderr of the job:

[aliensh]$ spy XXX stdout (where XXX is the given job id)

[aliensh]$ spy XXX stderr (where XXX is the given job id)

Edit the already registered analysis.jdl while being in the shell

[aliensh]$ edit analysis.jdl

[bash]$ --> Your local bash shell [aliensh]$ --> Your alien bash shell No notation --> inside a file

10/10/06 [email protected] -AliEn Tutorial 21