110/10/06 [email protected] - alien [email protected] alien tutorial...

21
1 10/10/06 [email protected] - AliEn Tutorial AliEn Tutorial Solutions Panos Christakoglou University of Athens - CERN

Upload: meredith-barnett

Post on 01-Jan-2016

228 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 110/10/06 Panos.Christakoglou@cern.ch - AliEn TutorialPanos.Christakoglou@cern.ch AliEn Tutorial Solutions Panos Christakoglou University of Athens - CERN

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

AliEn Tutorial

Solutions

Panos ChristakoglouUniversity of Athens - CERN

Page 2: 110/10/06 Panos.Christakoglou@cern.ch - AliEn TutorialPanos.Christakoglou@cern.ch AliEn Tutorial Solutions Panos Christakoglou University of Athens - CERN

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

Installation of AliEn software

Try it out

Download the installer from the web

[bash]$ wget http://alien.cern.ch/alien-installer

Make the file executable

[bash]$ chmod a+x alien-installer

Run the installer

[bash]$ ./alien-installer

For the solutions, we assume that the user name is trn2301 with the following attributes:● Local home directory: /home/trn2301● Alien home directory: /alice/cern.ch/user/t/trn2301

change the names accordingly to match your case!!!

Page 3: 110/10/06 Panos.Christakoglou@cern.ch - AliEn TutorialPanos.Christakoglou@cern.ch AliEn Tutorial Solutions Panos Christakoglou University of Athens - CERN

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

Authentication Try it out

Get a valid proxy

[bash]$ grid-proxy-init//provide the password when asked

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 info

[bash]$ grid-proxy-info

Get your token info

[bash]$ alien-token-info

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

Page 4: 110/10/06 Panos.Christakoglou@cern.ch - AliEn TutorialPanos.Christakoglou@cern.ch AliEn Tutorial Solutions Panos Christakoglou University of Athens - CERN

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

General description of the shell

Try it out (1)

Access the shell

[bash]$ aliensh

List the contents of your alien directory

[aliensh]$ whoami

Check your user name

[aliensh]$ whoami

Check the alien working direcory

[aliensh]$ pwd

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

Page 5: 110/10/06 Panos.Christakoglou@cern.ch - AliEn TutorialPanos.Christakoglou@cern.ch AliEn Tutorial Solutions Panos Christakoglou University of Athens - CERN

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

General description of the shell

Try it out (2)

Create the following directory structure in your alien $HOME directory:

Tutorial/XML/jdl

[aliensh]$ mkdir Tutorial

[aliensh]$ mkdir Tutorial/XML

[aliensh]$ mkdir Tutorial/XML/jdl

Tutorial/XML/par

[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

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

Page 6: 110/10/06 Panos.Christakoglou@cern.ch - AliEn TutorialPanos.Christakoglou@cern.ch AliEn Tutorial Solutions Panos Christakoglou University of Athens - CERN

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

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]$ whereis /alice/cern.ch/user/p/pchrist/Tutorial/XML/selectors/esdPt.C

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

Page 7: 110/10/06 Panos.Christakoglou@cern.ch - AliEn TutorialPanos.Christakoglou@cern.ch AliEn Tutorial Solutions Panos Christakoglou University of Athens - CERN

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

Working with the file catalog

Try it out (1)

Exit the shell

[aliensh]$ exit

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

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

Page 8: 110/10/06 Panos.Christakoglou@cern.ch - AliEn TutorialPanos.Christakoglou@cern.ch AliEn Tutorial Solutions Panos Christakoglou University of Athens - CERN

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

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]$ cp /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 shellNo notation --> inside a file

Page 9: 110/10/06 Panos.Christakoglou@cern.ch - AliEn TutorialPanos.Christakoglou@cern.ch AliEn Tutorial Solutions Panos Christakoglou University of Athens - CERN

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

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 shellNo notation --> inside a file

Page 10: 110/10/06 Panos.Christakoglou@cern.ch - AliEn TutorialPanos.Christakoglou@cern.ch AliEn Tutorial Solutions Panos Christakoglou University of Athens - CERN

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

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.root

[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.root

[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 shellNo notation --> inside a file

Page 11: 110/10/06 Panos.Christakoglou@cern.ch - AliEn TutorialPanos.Christakoglou@cern.ch AliEn Tutorial Solutions Panos Christakoglou University of Athens - CERN

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

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]$ find -x tag100 alice/cern.ch/user/a/aliprod/prod2006_2/output_pp/100/* tag.root > tag100.xml

Repeat the previous exercise, limiting this time 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]$ mv tag100.xml /home/trn2301/AliEn/Interactive/[bash]$ --> Your local bash shell[aliensh]$ --> Your alien bash shellNo notation --> inside a file

Page 12: 110/10/06 Panos.Christakoglou@cern.ch - AliEn TutorialPanos.Christakoglou@cern.ch AliEn Tutorial Solutions Panos Christakoglou University of Athens - CERN

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

Local analysis Try it out

Open your local $HOME/AliEn/Tags/CreateTags.C file and modify it accordingly

t->ReadLocalCollection("/home/trn2301/AliEn/PDC06");Run it to create the tag files.

[bash]$ root.exe -b -q CreateTags.C

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

[bash]$ rm 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.CImpose some selection criteria inside the macro and rerun the example.

EvCuts->SetMultiplicityRange(10,15);

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

Page 13: 110/10/06 Panos.Christakoglou@cern.ch - AliEn TutorialPanos.Christakoglou@cern.ch AliEn Tutorial Solutions Panos Christakoglou University of Athens - CERN

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

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/

Page 14: 110/10/06 Panos.Christakoglou@cern.ch - AliEn TutorialPanos.Christakoglou@cern.ch AliEn Tutorial Solutions Panos Christakoglou University of Athens - CERN

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

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 shellNo notation --> inside a file

Page 15: 110/10/06 Panos.Christakoglou@cern.ch - AliEn TutorialPanos.Christakoglou@cern.ch AliEn Tutorial Solutions Panos Christakoglou University of Athens - CERN

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

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/

Page 16: 110/10/06 Panos.Christakoglou@cern.ch - AliEn TutorialPanos.Christakoglou@cern.ch AliEn Tutorial Solutions Panos Christakoglou University of Athens - CERN

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

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 shellNo notation --> inside a file

Page 17: 110/10/06 Panos.Christakoglou@cern.ch - AliEn TutorialPanos.Christakoglou@cern.ch AliEn Tutorial Solutions Panos Christakoglou University of Athens - CERN

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

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,nodownload";

OutputDir="/alice/cern.ch/user/t/trn2301/Tutorial/XML/output";[bash]$ --> Your local bash shell[aliensh]$ --> Your alien bash shellNo notation --> inside a file

Page 18: 110/10/06 Panos.Christakoglou@cern.ch - AliEn TutorialPanos.Christakoglou@cern.ch AliEn Tutorial Solutions Panos Christakoglou University of Athens - CERN

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

Batch analysis Try it out (4)

Enter the shell and go to your AliEn $HOME directory.

[bash]$ aliensh

[aliensh]$ cd

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

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

Page 19: 110/10/06 Panos.Christakoglou@cern.ch - AliEn TutorialPanos.Christakoglou@cern.ch AliEn Tutorial Solutions Panos Christakoglou University of Athens - CERN

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

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

[aliensh]$ submit analysis.jdl[bash]$ --> Your local bash shell[aliensh]$ --> Your alien bash shellNo notation --> inside a file

Page 20: 110/10/06 Panos.Christakoglou@cern.ch - AliEn TutorialPanos.Christakoglou@cern.ch AliEn Tutorial Solutions Panos Christakoglou University of Athens - CERN

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

Batch analysis Try it out (6)

Check your job priority.

[aliensh]$ check priority jobs trn2301

Display all your active jobs.

[aliensh]$ top -user trn2301

Display the jdl of your job:

[aliensh]$ ps -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)

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

Page 21: 110/10/06 Panos.Christakoglou@cern.ch - AliEn TutorialPanos.Christakoglou@cern.ch AliEn Tutorial Solutions Panos Christakoglou University of Athens - CERN

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

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 shellNo notation --> inside a file