This is a personal logbook, in this page I annotate stuff which may become useful in my day-to-day work. Please feel free to peruse what you find here but do not pretend to find any logic or order here... and of course I can not be held responsible for any mistake, omission,

Setting up for working in ATLAS

at the beginning of each session (it can also go in e.g. .profile if no clash with other activities):

lsetup git

Git stuff

link to the ATLAS Git tutorial here

there is a lot of gibbering in the tutorial, basically it boils down to:

to be done once to set up git to use the ATLAS definitions:

git config --global "Your Name"
git config --global ""

ATLAS suggested settings:

git config --global push.default simple
git config --global http.postBuffer 1048576000
git config --global http.emptyAuth true # Required on CC7

the push.default setting will only work after lsetup git, an error will be printed otherwise.

Forking and cloning athena

Fork the athena project in GitLab first (more gibberish in the tutorial).

At this point, the athena project can be cloned in a working directory:

mkdir WorkDir; cd WorkDir
git atlas init-workdir

this command performs what they call a "sparse checkout", which allows one to check out and build separate packages istead of the whole behemoth. The athena project will be cloned in a directory /athena under WorkDir where separate packages can be checked out:

cd athena
git atlas addpkg G4AtlasAlg

to scratch a package use git atlas rmpkg package_name.

to ensure that the local repository is up-to-date, latest changes must be fetched:

git fetch upstream

Best is to create a branch and work from that branch:

git checkout -b my_branch_name upstream/master --no-track

it is suggested to use meaning branch names as this will provide additional hints during the merge process, eventually. That means "Mickey Mouse" as branch name won't cut it!

Code development

Code development in the WorkDir directory can now begin. to the scope, a specific CMakeLists.txt file must be added, which will configure CMake to run with the ATLAS settings:

cd WorkDir
touch CMakeLists.txt 

The CMakeLists.txt file to be created is available here.

An installation directory (historically called

in CMake jargon) must be created in which compilation/linking/configuring operations will be performed. Note that the CMakeLists.txt file will automatically take care to pick all packages (both in athena and locally developed) up and configure them properly:

cd WorkDir
mkdir build && cd build
asetup master,latest,Athena,here

the asetup command must be tailored to reflect which release/nightly/project combination one wants to use (this will not be discussed here): for simulation projects one might consider replacing Athena with AthSimulation (to be figured out)

Last piece to be added is a package filter, to decide which packages must be compiled or not. An example file is kept in the athena/Projects/WorkDir directory:

cp ../athena/Projects/WorkDir/package_filters_example.txt ../package_filters.txt

The file can be edited to add more packages to be compiled. Once that is done, one can run the usual cmake/make machinery by taking the filter into account.

cmake -DATLAS_PACKAGE_FILTER_FILE=../package_filters.txt ../athena/Projects/WorkDir
make -j4

A configuration script is automagically created in the x86.... directory which is used to set all environment variables and paths. This file has to be re-sourced when a new session is started (or when cmake is re-run).

mkdir ../run && cd ../run
source ../build/x86_64-slc6-gcc49-opt/

At this point one should be ready to run any kind of application within athena

How to rebase against modified master

example from John Chapman:

git checkout SimulationSelectorRefactor_master
git fetch upstream
git rebase upstream/master
# fix conflicts
# git add fixed_files
# git rebase --continue
# repeat until rebase completed
git push -f

Examples of simulation job (from J. Chapman)

Barebones AthenaMT/Geant4MT job which runs in the master nightlies:

athena --threads=4 -c "jp.AthenaCommonFlags.EvtMax.set_Value_and_Lock(50)" G4AtlasApps/

Same thing, but inside a transform --threads 4 --inputEVNTFile '/cvmfs/' --outputHITSFile 'test.HITS.pool.root' --maxEvents '50' --skipEvents '0' --truthStrategy 'MC15aPlus' --geometryVersion 'ATLAS-R2-2016-01-00-01' --conditionsTag 'OFLCOND-MC16-SDR-14' --DataRunNumber '284500' --physicsList 'FTFP_BERT_ATL'  --postInclude ' AtlasG4Tf: PyJobTransforms/' --preInclude 'AtlasG4Tf:SimulationJobOptions/,SimulationJobOptions/' --preExec 'AtlasG4Tf:simFlags.TightMuonStepping=True'

Basic Geant4 simulation job within ISF using MC16 configuration: --AMIConfig s3126 --inputEVNTFile /cvmfs/ --outputHITSFile myHITS.pool.root --maxEvents=10

-- ADA - 2018-11-01

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r3 - 2019-01-10 - AndreaDellAcqua
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Sandbox All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2023 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback