~/.gangarc
file. There are two (commented) lines in this file that start with "#NumWorkerThreads"
- ---- After both of the commented lines [I am not sure how Ganga picks up the right one] please add this line (uncommented):
NumWorkerThreads = 9 # you could even go higher (I use 12), but at some point Ganga will complain- ---- Consider changing/moving your default "gangadir" from your home area to your work area (hopefully you have a work area, if not ask about how you can get one). For example:
#gangadir = /afs/cern.ch/user/p/pnaik/gangadir gangadir = /afs/cern.ch/work/p/pnaik/gangadir- - Instructions below are provided for
csh
type shells. (For sh
type shells, change the alias command appropriately)
- - NOTE: You may be working with the nightly builds. In the early hours of the morning CERN time the builds break because they are being rebuilt. Always specify the day of a nightly build if you plan to run the code, e.g. if your code will run overnight CERN time into Wednesday, then instead of "-nightly lhcb-head" use "-nightly lhcb-head Tue".
- ---- Open four clean shells using ssh -Y lxplus.cern.ch
. The following is assuming you want to work with the HEAD version. If not, change "HEAD --nightly lhcb-head" to a stable version, like "v5r5" for example, and edit your settings file (explained later) accordingly.
- ------- One of these is to be the "development (DEV) shell." You only need this one if you plan to edit the code. In a csh
shell:
alias PanoptesDev 'SetupProject Panoptes HEAD --build-env --nightly lhcb-head'; PanoptesDev- ---------- This will move you into your
Panoptes_HEAD
cmtuser directory. From here you can getpack any code if you need to modify any of it. Otherwise it will use the precompiled code from the nightly build.
- ------------- NOTE, Jeremy discovered that the precompiled code is not being picked up from the nightlies. We expect precompiled code to be in $RICHMIRRCOMBINFIT/$CMTCONFIG/ and $RICHMIRRALIGN/$CMTCONFIG, but it was not (or maybe this is only true for production versions, not HEAD). Anyway, this has to be fixed, but for now please getpack the main code packages locally. From inside your Panoptes_HEAD
cmtuser directory, run these two lines:
getpack Rich/RichMirrCombinFit; cd Rich/RichMirrCombinFit/cmt; cmt br cmt config; cmt br cmt make; cd - getpack Rich/RichMirrAlign; cd Rich/RichMirrAlign/cmt; cmt br cmt config; cmt br cmt make; cd -- ------------- Then if need be you can edit the code and recompile as much as you need to locally, keep it updated locally, and commit changes (FOLLOW THE LHCB SOFTWARE RULES PLEASE). - ------- One of these is to be the "runtime (RUN) shell." In a
csh
shell:
alias PanoptesRun 'SetupProject Panoptes HEAD --nightly lhcb-head'; PanoptesRun- ---------- create a working directory (if it does not exist yet) and
cd
to it, e.g. for 2015 Rich2 Magnet Down, but of course use and choose your own directory:
mkdir -p /afs/cern.ch/user/p/pnaik/RichAlignment/2015/2015Down_R2; cd /afs/cern.ch/user/p/pnaik/RichAlignment/2015/2015Down_R2- ---------- you will also a need a settings file, e.g. for 2015 Rich 2 MagDown:
cp /afs/cern.ch/user/p/pnaik/RichAlignment/2015/2015_R2_EM_Down_1250k_ev/RichMirrorAlignmentGanga_Collision15_settings_R2.py .- ----------- e.g. for 2015 Rich 1 MagDown:
cp /afs/cern.ch/user/p/pnaik/RichAlignment/2015/2015_R1_EM_Down_1250k_ev/RichMirrorAlignmentGanga_Collision15_settings_R1.py .You should not need the runtime shell, but good to know how to do this if you ever need to run/test pieces of code manually - ------- One of these is to be the "Ganga shell." Please ideally open this only on a computer that you do not have to disconnect from the internet. (you could use a screen session, though we don't know how you would save the output, maybe Claire knows)
alias GangaRun 'SetupProject Ganga v600r43 pytools'; GangaRun- ----------
cd
to your working directory and create a 7-day renewable AFS token, e.g. for 2015 Magnet Down:
cd /afs/cern.ch/user/p/pnaik/RichAlignment/2015/2015Down_R2 kinit -r 7d- ---- Note that if you plan to do any work or run any scripts which will operate after 23:59 CERN time, then the nightlies will be broken until they are rebuilt. To prevent broken code, make sure to specify which day's nightly build you would like to use before you run code or a script, i.e. if you want to make sure you use Tuesdays's nightly build, change "lhcb-head" to "lhcb-head Tue". - ---- Now edit your RichMirrorAlignmentGanga _Collision15_settings_R2.py file. The five lines you need to change (to what you think is appropriate) look like:
home = "/afs/cern.ch/user/p/pnaik" # Point this to *your home directory*
setupProjectPanoptesOptions = "--nightly lhcb-head Sat" # Safest to specify a day that you know is working; try the previous day in general
workDir = "/afs/cern.ch/user/p/pnaik/RichAlignment/2015/2015Down_R2" # Point this to *the full path name of **your** working directory*
thisCase = "2015Down_R2" # A label for this particular alignment
<!-- AddedDB = ["Alignment2015.db", "MDCS-RICH1-SecondScans-26052015.db", "ResetHPDAlign-13062015.db", "2015RootFiles-RunAligned-Sobel-Smoothed1.0hours-HPDAlign-22062015.db"] # Database slices to add -->- ---- Before you run Ganga, if you wish to log all of the lines that show up on the screen in your Ganga session do the following: (PLEASE NOTE, AFTER you exit Ganga, end the logging by typing exit or CTRL-D; otherwise the script command will continue logging)
script YYYYMMDD-HHMM.log- ---- Also, make a long grid proxy (and don't renew it until you have to) [ if and only if you have special rich calibration privileges (Paras, Claire), use
lhcb-proxy-init -g lhcb_calibration -v 120:00
instead ]
lhcb-proxy-init -v 96:00- ---- Run
ganga
. In the Ganga shell, start the engine:
RichInfoName = ( './RichMirrorAlignmentGanga_Collision15_settings_R2.py' ) # e.g. for 2015 Mag Down *NOTE: you must give the full path name to the settings if you are starting outside your working directory* execfile( '/afs/cern.ch/user/p/pnaik/cmtuser/Panoptes_HEAD/Rich/RichMirrorAlignmentGanga/job/RichMirrorAlignment.py' )- ---- Ganga should then perform the alignment. Note that the file RichMirrorAlignment.py is the Offline alignment driver script, which reads in the _settings_.py file and performs the alignment. Paras tries very hard to keep his local version of the script in sync with the one in the HEAD version of
Rich/RichMirrorAlignmentGanga
.
- ---- NOTE: Whether the alignment finishes properly or it crashes, do not continue in the same Ganga session! Exit ganga using exit() or CTRL-D. Then start ganga
again.
Always remember to end the script command if you have run it and exited Ganga, or it will continue to store everything that shows up on the screen in your file until you exit your shell.
~/.gangarc
file. There are two (commented) lines in this file that start with "#NumWorkerThreads"
NumWorkerThreads = 9 # you could even go higher (I use 12), but at some point Ganga will complain--- Instructions below are provided for
csh
type shells. (For sh
type shells, change the alias command appropriately)
ssh -Y lxplus.cern.ch
. The following is assuming you want to work with the HEAD version. If not, change "HEAD --nightly lhcb-head" to a stable version, like "v5r5" for example.
csh
shell:
alias PanoptesDev 'SetupProject Panoptes HEAD --build-env --nightly lhcb-head'; PanoptesDev------------ This will move you into your
Panoptes_HEAD
cmtuser directory. From here you can getpack any code if you need to modify any of it. Otherwise it will use the precompiled code from the nightly build.
Panoptes_HEAD
cmtuser directory, run these two lines:
getpack Rich/RichMirrCombinFit; cd Rich/RichMirrCombinFit/cmt; cmt br cmt config; cmt br cmt make; cd - getpack Rich/RichMirrAlign; cd Rich/RichMirrAlign/cmt; cmt br cmt config; cmt br cmt make; cd ---------------- Then if need be you can edit the code and recompile as much as you need to locally, keep it updated locally, and commit changes (FOLLOW THE LHCB SOFTWARE RULES PLEASE).
csh
shell:
alias PanoptesRun 'SetupProject Panoptes HEAD --nightly lhcb-head'; PanoptesRun------------ create a working directory (if it does not exist yet) and
cd
to it, e.g. for 2010 Magnet Down:
mkdir -p ~/RichAlignment/2010/R2MD; cd ~/RichAlignment/2010/R2MD------------ you will also a settings file, e.g. for 2010 Magnet Down:
cp /afs/cern.ch/user/p/pnaik/cmtuser/Panoptes_HEAD/Rich/RichMirrorAlignmentGanga/job/settings/RichMirrorAlignmentGanga_Collision10_settings_R2MD.py .------------ Please note that this file is in Paras's cmtuser area. He tries to keep this in sync with the HEAD version of
Rich/RichMirrorAlignmentGanga
.
alias GangaRun 'SetupProject Ganga v600r43 pytools'; GangaRun------------
cd
to your working directory and create a 7-day renewable AFS token, e.g. for 2010 Magnet Down:
cd ~/RichAlignment/2010/R2MD; kinit -r 7d------ Note that if you plan to do any work or run any scripts which will operate after 23:59 CERN time, then the nightlies will be broken until they are rebuilt. To prevent broken code, make sure to specify which day's nightly build you would like to use before you run code or a script, i.e. if you want to make sure you use Tuesdays's nightly build, change "lhcb-head" to "lhcb-head Tue".
home = "/afs/cern.ch/user/p/pnaik" # Point this to *your home directory*
setupProjectPanoptesOptions = "--nightly lhcb-head Sat" # Safest to specify a day that you know is working; try the previous day in general
workDir = "/afs/cern.ch/user/p/pnaik/RichAlignment/2010/ParasR2MD" # Point this to *the full path name of **your** working directory*
thisCase = "R2MD" # A label for this particular alignment------ Before you run Ganga, if you wish to log all of the lines that show up on the screen in your Ganga session do the following: (PLEASE NOTE, AFTER you exit Ganga, end the logging by typing exit or CTRL-D; otherwise the script command will continue logging)
script YYYYMMDDHHMM.log------ Also, make a 96 hour grid proxy (just to be safe)
lhcb-proxy-init -v 96:00------ Run
ganga
. In the Ganga shell, start the engine:
gridProxy.renew() # Always do this right after you start Ganga! RichInfoName = ( './RichMirrorAlignmentGanga_Collision10_settings_R2MD.py' ) # e.g. for 2010 Mag Down *NOTE: you must give the full path name to the settings if you are starting outside your working directory* execfile( '/afs/cern.ch/user/p/pnaik/cmtuser/Panoptes_HEAD/Rich/RichMirrorAlignmentGanga/job/RichMirrorAlignmentGanga.py' )------ Ganga should then perform the alignment. Note that the file RichMirrorAlignmentGanga.py is the Offline alignment driver script, which reads in the _settings_.py file and performs the alignment. Paras tries to keep this script in sync with the one in the HEAD version of
Rich/RichMirrorAlignmentGanga
.
ganga
again.
Always remember to end the script command if you have run it and exited Ganga, or it will continue to store everything that shows up on the screen in your file until you exit your shell.
tcsh
, please convert accordingly if you use another shell (sorry):
Add the following to your .login file:
setenv X509_USER_PROXY /afs/cern.ch/user/p/pnaik/private/.grid.proxywhere
p/pnaik
should be changed to your username intitial and username, of course.
This forces your grid proxy to be stored in your AFS area instead of on /tmp. This is necessary for the LSF machines to see your grid proxy. Why this is not default, we don't know.
After this you will need a new shell, or just continue by setting manually setenv X509_USER_PROXY $HOME/private/grid.proxy
Then cd
into your working directory
mkdir Ganga_LSF
cd Ganga_LSF
Then make the following submit.csh
shell script:
#!/bin/tcsh setenv X509_USER_PROXY /afs/cern.ch/user/p/pnaik/private/.grid.proxy setenv MIRRWORKDIR /afs/cern.ch/user/p/pnaik/RichAlignment/2010/ParasR2MD_TestLSF cd $MIRRWORKDIR source `which SetupProject.csh` Ganga v600r43 pytools ganga $MIRRWORKDIR/Ganga_LSF/ganga.py >&! $MIRRWORKDIR/Ganga_LSF/output.logWhere output.log should then store all of the output you would typically see on the screen, and of course you substitute your grid proxy location AND your workDir for
/afs/cern.ch/user/p/pnaik/RichAlignment/2010/ParasR2MD_TestLSF/
.
Also make a new simple python script ganga.py
that has only the RichInfoName and execfile lines that you are used to entering interactively to run an alignment. For example the file would just have:
import os print "renewing grid proxy (this will not ask for a password, if you renewed your grid proxy *before* submitting submit.csh)" gridProxy.renew() print "I am now going to give the command runMonitoring() [if we run this as a script and not from an interactive Ganga session, we have to do this]." print "If the monitoring loop is already running, the runMonitoring() command will give an ERROR. However this script should continue to run." runMonitoring() print "running the Offline RICH mirror alignment" RichInfoName = ( os.getenv('MIRRWORKDIR') + os.path.sep + 'RichMirrorAlignmentGanga_Collision10_settings_R2MD.py' ) execfile( '/afs/cern.ch/user/p/pnaik/cmtuser/Panoptes_HEAD/Rich/RichMirrorAlignmentGanga/job/RichMirrorAlignment.py' )where RichMirrorAlignmentGanga _Collision10_settings_R2MD.py is instead the name of your settings file Then to you can submit the above
submit.csh
script to the batch queues, making sure of course that you write your grid proxy onto AFS:
chmod 755 submit.csh lhcb-proxy-init -v 96:00 kinit -fp -r 7d bsub -q2nd -n10 $PWD/submit.cshThe first line above changes the file to executable The second line above creates a grid proxy valid for 96 hours The third line creates an AFS ticket valid 7 days that is forwardable. We are not sure if it actually gets forwarded, but the ticket is valid for 7 days on the LSF machine (Paras checked) The fourth line above submits the script to LSF. Note that we picked the 2 nominal days queue. This should give 2 days of CPU time which hopefully is enough to perform the 2012 alignments. -n10 means use 10 cores It looks like you can't view any output until the whole job is done, but you can check your workDir to see if new iterations are being made every few hours or so. Also there are now Mirrors_*_touch.txt files that will show up while submitting grid jobs, while waiting for grid jobs, and when grid jobs are completed. They are empty, but if you
ls -al
them you will see the time stamp when they were created... if they aren't being created and updated fairly often (under every 30 minutes) during the Brunel stage of the alignment, then you know something is wrong with the alignment.
bjobs
is the command to check your job status
bqueues -u
gives the status of all the queues
bkill
can be used to kill jobs if need be
You should get an email when your job has completed or failed.
cd
to it, e.g.:
mkdir -p ~/public/rich_align/workdir; cd ~/public/rich_align/workdir
v3r3
):
cp $LHCBRELEASES/PANOPTES/PANOPTES_v4r1/Rich/RichMirrorAlignmentGanga/files/Rich2MirrCombinList_48m85c_p12p43fix.txt . cp $LHCBRELEASES/PANOPTES/PANOPTES_v4r1/Rich/RichMirrorAlignmentGanga/files/Rich1MirrCombinList_10m12c_p0p2fix.txt . cp $LHCBRELEASES/PANOPTES/PANOPTES_v4r1/Rich/RichMirrorAlignmentGanga/job/RichMirrorAlignmentGanga_Collision11_settings.py . cp $LHCBRELEASES/PANOPTES/PANOPTES_v4r1/Rich/RichMirrorAlignmentGanga/scripts/getDataSet.py .(nb some files will be added to the next release of
Panoptes
v4r2
and may not be available in this current version. If the files are not available download them from the head version)
Compile the Panoptes
projects in the usual LHCb way (cmt make).
Then set environments in your work directory
setenv HOME /afs/cern.ch/user/a/auser setenv User_release_area $HOME/cmtuser source `which SetupProject.csh` =Panoptes v4r1= source `which SetupProject.csh` =LHCb= rm -f env_var_settings.txt echo $RICHMIRRORALIGNMENTGANGAROOT > env_var_settings.txt
groupSlices = 1 groupBins = 1 minAverageBinPop = 9 deltaThetaWindow = 4 coeffCalibrTilt = 0.3 #useOffsetsFromMC = "true" useOffsetsFromMC = "false" #verOffsetsFromMC = "129kMC10" verOffsetsFromMC = "" usePremisaligned = "false" combinFitVariant = "slices" maximumNumberOfIterations = 8 startFromIteration = 0 richDetector = 2 # 1: RICH1, 2: RICH2 magnifCoeffMode = 0 # 2: individual for each pair solutionMethod = 1 # 1: algebraic, 2:Minuit
In [2]:execfile( 'RichMirrorAlignmentGanga_Collision11_settings.py' ) In [2]:execfile( scriptOfEverything )
Ganga
says.
code | calendar dates | run numbers | polarity | info |
---|---|---|---|---|
01 | 2012-04-01 / 2012-04-17 | 111183-112916 | Down | resumed data-taking |
02 | 2012-04-17 / 2012-05-01 | 113013-113146 | Down | after VdM scan |
03 | 2012-05-01 / 2012-05-02 | 114205-114287 | Up | after technical stop, polarity change |
04 | 2012-05-02 / 2012-05-16 | 114316-115464 | Down | polarity change |
05 | 2012-05-16 / 2012-05-31 | 115518-117103 | Up | polarity change |
06 | 2012-05-31 / 2012-06-11 | 117192-118286 | Down | polarity change |
07 | 2012-06-11 / 2012-07-02 | 118326-118880 | Up | polarity change |
08 | 2012-07-02 / 2012-07-20 | 119956-122520 | Up | after technical stop |
09 | 2012-07-20 / 2012-07-25 | 122540-123803 | Up | after VdM scan |
10 | 2012-07-25 / 2012-08-10 | 123910-125115 | Down | polarity change |
11 | 2012-08-10 / 2012-08-28 | 125566-126680 | Up | polarity change |
12 | 2012-08-28 / 2012-09-15 | 126824-128268 | Down | polarity change |
13 | 2012-09-15 / 2012-10-12 | 128411-129978 | Up | polarity change, after technical stop |
14 | 2012-10-12 / 2012-10-24 | 130316-130861 | Down | polarity change |
15 | 2012-10-24 / 2012-11-08 | 130911-131940 | Up | polarity change |
16 | 2012-11-08 / 2012-12-03 | 131973-133587 | Down | polarity change |
17 | 2012-12-03 / inf | 133624-133785 | Up | polarity change |
code | "date" timestamp |
---|---|
01 | 1333411200000000000 |
02 | 1334793600000000000 |
03 | 1335916800000000000 |
04 | 1336089600000000000 |
05 | 1337299200000000000 |
06 | 1338595200000000000 |
07 | 1339545600000000000 |
08 | 1341360000000000000 |
09 | 1342915200000000000 |
10 | 1343347200000000000 |
11 | 1344729600000000000 |
12 | 1346284800000000000 |
13 | 1347840000000000000 |
14 | 1350172800000000000 |
15 | 1351209600000000000 |
16 | 1352505600000000000 |
17 | 1354665600000000000 |
Rich/RichMirrorAlignmentOnline
within project Panoptes
Rich/RichMirrorAlignmentOnline
.
MirrAlignmentOnline
has already been deprecated. OnlPanoptesSys
should be deprecated as well.
Rich/RichMirrorAlignmentOnline
, which is now being filled with pieces from the Ganga script.
ssh -Y lxplus.cern.ch ssh -Y lbgw ssh -Y plus
SetupProject --build-env Panoptes v5r5 getpack Rich/RichMirrorAlignmentOnline head getpack PRConfig head getpack Muon/MuonPIDChecker head getpack Rich/RichMirrorAlignmentGanga head getpack Rich/RichMirrAlign head getpack Rich/RichMirrCombinFit head getpack Rec/Brunel v47r7
set PRCONFIGOPTS $(PRConfig_root)/options # Add the scripts to the python path path_prepend PYTHONPATH "$(PRConfig_root)/python"to
# Paras added this use GaudiPolicy v* #============================================================================ # Install python modules #============================================================================ apply_pattern install_python_modules # Paras commented these out ###set PRCONFIGOPTS $(PRConfig_root)/options #### Add the scripts to the python path ###path_prepend PYTHONPATH "$(PRConfig_root)/python"
SetupProject --build-env Panoptes v5r5 cd $User_release_area/Panoptes_v5r5 make -j 8
/group/online/dataflow/scripts/farmStatus &
ssh -Y hlte0902
SetupProject Panoptes v5r5 --use PRConfig --use Rec/Brunel --use Muon/MuonPIDChecker export PYTHONPATH=/home/raaij/pydim/lib/python2.7/site-packages:/scratch/jenkins/benchmark/python:$PYTHONPATH cd $User_release_area/Panoptes_v5r5/PRConfig/scripts python AlignOnlineTest.py --help killall GaudiOnlineExe.exe python AlignOnlineTest.py --numa --nodes=1 --workers=1 --task-log=log/PythonMirrAlignOnline.log --directory=/group/rich/2015-MirrorAlignData/20GeV/MagDown --viewers PythonMirrAlignOnlineNote that the directory (in this case /group/rich/2015-MirrorAlignData/20GeV/MagDown) must exist, and have RAW or MDF data files in it. Once things are working increase
--nodes=1 --workers=1
to have more nodes and workers.
killall GaudiOnlineExe.exe
should always be used before running the Online Alignment Tests
[Not sure about this yet:] A new temporary directory is created for each test and printed in the log that goes to the test log file and stdout. This directory should contain all intermediate files, results and conditions.