asc:tutorials:2014october_connect
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
asc:tutorials:2014october_connect [2014/10/09 18:49] – [Lesson 3: Analysis program to read xAOD] asc | asc:tutorials:2014october_connect [2014/10/10 15:28] (current) – [Lesson 6: Using HTCondor and Tier2] asc | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== xAOD tutorial at ANL using ATLAS connect | ====== xAOD tutorial at ANL using ATLAS connect | ||
- | These tutorial are based on CERN | + | |
- | [[https:// | + | |
**This tutorial uses [[http:// | **This tutorial uses [[http:// | ||
+ | |||
+ | Please also look at the CERN tutorial [[https:// | ||
Line 55: | Line 56: | ||
<code bash> | <code bash> | ||
source setup.sh | source setup.sh | ||
- | rcSetup -u; rcSetup Base,2.1.11 | + | rcSetup -u; rcSetup Base,2.1.12 |
</ | </ | ||
Line 141: | Line 142: | ||
go to the program starting directory and recreate an input files list (Since this dataset is rather large we suggest to remove all but a few files from the inputdata.txt.): | go to the program starting directory and recreate an input files list (Since this dataset is rather large we suggest to remove all but a few files from the inputdata.txt.): | ||
- | < | + | < |
cd MyAnalysis/ | cd MyAnalysis/ | ||
fax-get-gLFNs valid2.117050.PowhegPythia_P2011C_ttbar.digit.AOD.e2657_s1933_s1964_r5534_tid01482225_00 > inputdata.txt | fax-get-gLFNs valid2.117050.PowhegPythia_P2011C_ttbar.digit.AOD.e2657_s1933_s1964_r5534_tid01482225_00 > inputdata.txt | ||
Line 148: | Line 149: | ||
Your analysis is started using testRun.cxx. We pass “submitDir” which will be the output directory with ROOT file. You must delete it every time you run the code (or use different output). The code runs over a list of files inputdata.txt. | Your analysis is started using testRun.cxx. We pass “submitDir” which will be the output directory with ROOT file. You must delete it every time you run the code (or use different output). The code runs over a list of files inputdata.txt. | ||
- | < | + | < |
testRun submitDir | testRun submitDir | ||
</ | </ | ||
Line 159: | Line 160: | ||
Now we will make a number of changes to the above program. We will fill histograms with pT of jets and muons. | Now we will make a number of changes to the above program. We will fill histograms with pT of jets and muons. | ||
- | To do this, added the following changes: | + | To do this, added the following changes: |
- | + | ||
- | In : cmt/ | + | |
< | < | ||
Line 167: | Line 166: | ||
</ | </ | ||
- | Then we have modified: | + | in " |
<code python> | <code python> | ||
Line 174: | Line 173: | ||
</ | </ | ||
- | Now we will create a C++/ROOT analysis program and run over this input xAOD file. Do not forget to run "kinit [email protected]" | + | Now we will create a C++/ROOT analysis program and run over this input xAOD file. |
- | Use the same setup file as above. | + | |
- | < | + | < |
- | source setup.sh | + | |
mkdir lesson_4; cd lesson_4 | mkdir lesson_4; cd lesson_4 | ||
+ | rcSetup -u; rcSetup Base,2.0.12 | ||
+ | rc find_packages | ||
+ | rc compile | ||
</ | </ | ||
<code bash> | <code bash> | ||
- | mkdir ANLanalysisHisto | + | wget https://ci-connect.atlassian.net/wiki/download/attachments/10780723/MyAnalysis4.zip |
- | cd ANLanalysisHisto | + | unzip MyAnalysis4.zip |
- | rcSetup | + | |
- | rc find_packages | + | |
- | rc compile | + | |
- | </code> | + | |
- | + | ||
- | This takes some time to compile. Next we will us a simple example code that runs over multiple files located in some directory | + | |
- | + | ||
- | <code bash> | + | |
- | cp -r /users/chakanau/public/2014_tutorial_october_anl/ | + | |
rc find_packages | rc find_packages | ||
rc compile | rc compile | ||
- | cd MyAnalysis/ | ||
- | testRun submitDir | ||
</ | </ | ||
- | How does this work? Your analysis code is testRun.cxx. We pass " | ||
- | You must delete it every time you run the code (or use different output). The code runs over a list of files inputdata.txt. | ||
- | You can create a new list using the script: | ||
- | <code bash> | + | The actual analysis should |
- | python Make_input < | + | |
- | </ | + | |
- | + | ||
- | The actual analysis should | + | |
<note tip>Read more: [[https:// | <note tip>Read more: [[https:// | ||
- | ====== Lesson 5: Running a job on multiple cores ====== | ||
+ | Run it as: | ||
- | Now we run the above job on multiple codes of same computer and merge histogram outputs at the end. | ||
- | |||
- | Prepare a fresh directory: | ||
- | < | ||
- | source setup.sh | ||
- | mkdir lesson_5; cd lesson_5 | ||
- | </ | ||
- | |||
- | And setup the package: | ||
<code bash> | <code bash> | ||
- | mkdir ANLanalysisHisto_threads | ||
- | cd ANLanalysisHisto_threads | ||
- | rcSetup -u; rcSetup Base,2.1.11 | ||
- | rc find_packages | ||
- | rc compile | ||
- | </ | ||
- | |||
- | This takes some time to compile. Next we will us a simple example code that runs over multiple files located in some directory | ||
- | |||
- | <code bash> | ||
- | cp -r / | ||
- | rc find_packages | ||
- | rc compile | ||
cd MyAnalysis/ | cd MyAnalysis/ | ||
+ | fax-get-gLFNs valid2.117050.PowhegPythia_P2011C_ttbar.digit.AOD.e2657_s1933_s1964_r5534_tid01482225_00 > inputdata.txt | ||
+ | testRun submitDir | ||
</ | </ | ||
- | This example has a modified. " | ||
- | small script " | ||
- | * Generates input list " | + | ====== Lesson 5: Running on multiple cores ====== |
- | * Splits it using a given number of threads (2 is default) and put them to **inputs/** directory | + | |
- | * launches 2 jobs using input files from **inputs/ | + | |
- | * Output files will go to **outputs/ | + | |
- | The output will go to the directory " | + | This example is not needed for ATLAS connect. If you still want to know how to run an ATLAS analysis job on several cores of your desktop, |
+ | look at [[asc: | ||
- | To run the job, run " | + | ====== Lesson 6: Using HTCondor and Tier2 ====== |
- | <code bash> | + | Lesson 5: Working on a Tier3 farm (Condor queue) |
- | ps rux | grep -e " | + | |
- | </ | + | |
- | Ones the jobs are done, you can merge the output files to " | + | In this example we will use HTCondor workload management system to send the job to be executed in a queue at a Tier3 farm. For this example we will start from the directory lesson 4, so if you did not do the lesson 4 please do that one first and verify that your code runs locally. |
- | <code bash> | + | Start from the new shell and set up environment, |
- | hadd -f hist.root outputs/ | + | |
- | </ | + | |
- | ====== Lesson 6: Working on the ANL farm ====== | + | <file bash startJob.sh> |
+ | # | ||
+ | export RUCIO_ACCOUNT=YOUR_CERN_USERNAME | ||
+ | export ATLAS_LOCAL_ROOT_BASE=/ | ||
+ | source ${ATLAS_LOCAL_ROOT_BASE}/ | ||
+ | localSetupFAX | ||
+ | source $AtlasSetup/ | ||
+ | export X509_USER_PROXY=x509up_u21183 | ||
+ | unzip payload.zip | ||
+ | ls | ||
+ | rcSetup -u; rcSetup Base, | ||
+ | rc find_packages | ||
+ | rc compile | ||
+ | cd MyAnalysis/ | ||
+ | rm submitDir | ||
+ | |||
+ | echo $1 | ||
+ | sed -n $1, | ||
+ | cp Inp_$1.txt inputdata.txt | ||
+ | cat inputdata.txt | ||
+ | echo " | ||
+ | testRun submitDir | ||
+ | echo " | ||
+ | </ | ||
- | This example | + | Make sure the RUCIO_ACCOUNT variable |
- | <note important>This example works on the ANL Tier3 where Arcond/Condor is installed</note> | + | <file bash job.sub> |
+ | Jobs=10 | ||
+ | getenv | ||
+ | executable | ||
+ | output | ||
+ | error = MyAnal_$(Jobs).$(Process).error | ||
+ | log = MyAnal_$(Jobs).$(Process).log | ||
+ | arguments = $(Process) $(Jobs) | ||
+ | environment = " | ||
+ | transfer_input_files = payload.zip, | ||
+ | universe | ||
+ | # | ||
+ | queue $(Jobs) | ||
+ | </file> | ||
- | First, create | + | To access files using FAX the jobs need a valid grid proxy. That's why we send it with each job. Proxy is the file starting with " |
- | Prepare a fresh directory: | + | You need to pack all of the working |
- | < | + | |
- | mkdir lesson_6 | + | |
- | </ | + | |
- | Copy the needed directories with RootCore example: | + | <file bash startJob.sh> |
+ | startJob.sh | ||
+ | rc clean | ||
+ | rm -rf RootCoreBin | ||
+ | zip -r payload.zip * | ||
+ | </ | ||
- | <code bash> | + | Now you may submit your task for the execution and follow its status in this way: |
- | cp -r / | + | |
- | </ | + | |
- | Then check that you can compile the analysis example using RootCore: | ||
- | |||
- | <code bash> | ||
- | cd lesson_6/ | ||
- | source setup.sh | ||
- | </ | ||
- | |||
- | As usual, our analysis is in " | ||
- | |||
- | Now we want to submit jobs to the data distributed on several computers of the farm. Go to the upper directory and setup the farm: | ||
- | |||
- | <code bash> | ||
- | cd ../; source s_asc; | ||
- | </ | ||
- | |||
- | We will send jobs using the directory " | ||
- | |||
- | <code bash> | ||
- | cd submit | ||
- | arc_ls -s / | ||
- | arc_ls | ||
- | </ | ||
- | |||
- | The first command shows the summary of distributed data (12 files per server), while the second lists all available data on each node. | ||
- | Now we will send the job to the farm. | ||
- | Change the line: | ||
< | < | ||
- | package_dir=/users/chakanau/ | + | chmod 755 ./startJob.sh; |
</ | </ | ||
- | inside " | ||
- | This sends jobs to the farm (2 jobs per server). Check the status as: | ||
<code bash> | <code bash> | ||
- | condor_q | + | ~> condor_submit job.sub |
+ | Submitting job(s).......... | ||
+ | 10 job(s) submitted to cluster 49677. | ||
+ | |||
+ | ~> condor_q | ||
+ | -- Submitter: login.atlas.ci-connect.net : < | ||
+ | | ||
+ | 49677.0 | ||
+ | 49677.1 | ||
+ | 49677.2 | ||
+ | 49677.3 | ||
+ | 49677.4 | ||
+ | 49677.5 | ||
+ | 49677.6 | ||
+ | 49677.7 | ||
+ | 49677.8 | ||
+ | 49677.9 | ||
+ | |||
+ | 10 jobs; 0 completed, 0 removed, 0 idle, 10 running, 0 held, 0 suspended | ||
</ | </ | ||
- | |||
- | When the jobs are done, the output files will be inside " | ||
- | |||
- | <code bash> | ||
- | arc_add | ||
- | </ | ||
- | This will create the final output file " | ||
- | |||
- | |||
- |
asc/tutorials/2014october_connect.1412880595.txt.gz · Last modified: 2014/10/09 18:49 by asc