How to run Athena with Geant4 in debug mode

This page explains how to run Athena with Geant4 in debug mode. This can be done interactively, or with a script which is provided.

The main recipe was provided by Andy Buckley, and I have validated it and packaged it into a script.

The following script can be used on lxplus nodes. It checks out a version of Athena in a /tmp directory. Things to note:

  • the version of Athena must be changed in the script.

runId=${1:-1}; shift
echo  "To run number $runId "
if [[ $runId == -1 ]]; then
    echo "Must supply runId as argument_1"; 
    exit ; 

##  From the 'current' directory several files needed for a run will be copied.
#   Below you must list all the files you need in order to run into the run directory
#   These will be copied from the current directory into the run directory

## CHANGE HERE  - Version of Athena to use
##  Identification of run
athVer="16.6.X-r4"                              ## Shorthand id for runs
athFull="here,16.6.X,r4,runtime,32"    ## Full description string for 'asetup'
                                                            ## <<<---- Must have "32" for use with i686 G4 libs

# Set up Atlas environment
echo "Setting new Atlas environment $athVer  --- with full= $athFull **"

# Check the files
for file in $files
  if [[ ! -f $file ]]; then
     echo "Fatal Error in " $0 " : cannot find file" $file
     exit 1

cd   /tmp/japostzp
if [[ ! -d  $DirAthena ]]; then
   mkdir  $DirAthena
   cd     $DirAthena
   # asetup $athVer,here,32
   echo   "**> calling asetup with argument " $athFull
   source /afs/ $athFull
   cmt co External/Geant4
   cd External/Geant4/cmt 
   mv requirements requirements.orig
   cp ~abuckley/public/g4-requirements.i686-slc5-gcc43-dbg .
   ##  CHANGE - here  ==> the above file must correspond to the RELEASE
   #    e.g. I created a local version for the latest release (simple changes)
   #cp $originalDir/g4-requirements.i686-slc5-gcc43-dbg  .
   ln -s           g4-requirements.i686-slc5-gcc43-dbg  requirements 
   cmt config
   echo "Using existing installation" in `pwd`/AthenaSetupDir-$athVer
   cd     $DirAthena
   echo   "**> calling asetup with argument " $athFull
   source /afs/ $athFull

# cd -
cd $originalDir

echo "Let us check that we can find Athena"

##  Useful variables
hostNm=`hostname | sed 's/' `

if [[ -d $RUNDIR ]]; then
   mv $RUNDIR/{,-bak-$$}
   mkdir -p $RUNDIR

cp $files $RUNDIR

if [[ ! -f am-running-$runId ]]; then 
   ln -s $RUNDIR running-on-$hostNm-$runId 
   ## ln -s running-on-$hostNm-$runId  am-running-$runId 

   cd $RUNDIR
   cp  test_G4Atlas.py_ran_$$

# Options for running
#  1.) Running with a log file in a gzip-ed file 
# -c "RTTRunNumber=$runId" 2>&1 | gzip -3 > log.ath$athVer.rtt$runId.gz

#  2.) Running with gdb -c "RTTRunNumber=$runId" 2>&1 | gzip -8 > log.ath$athVer.rtt$runId.gz

# Adapted way to run debug from debug 
# A simple way to run gdb  -- see 
#  -d exec  -c "RTTRunNumber=$runId" 2>&1 | tee log.ath$athVer.rtt$runId
# --debug exec -c "RTTRunNumber=$runId" 

   exit 0
   echo "ERROR - the job with run Id=$runId is running or already ran."
   echo " Check the file running-$runId for the host running the job."
   echo " >> Exiting."
   exit 10

-- JohnApostolakis - 26-Oct-2011

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r3 - 2020-08-18 - TWikiAdminUser
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Sandbox/SandboxArchive 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