Name Last Update
..
inc Loading commit data...
src Loading commit data...
test Loading commit data...
validation Loading commit data...
CMakeLists.txt Loading commit data...
README Loading commit data...
VecPhysConfig.cmake.in Loading commit data...
history Loading commit data...
+--------------------------------------------------+
| How to build and run vecphys with/without GeantV |
+--------------------------------------------------+

1. setup 

   #gcc (if 4.8+ is not a default)
   export CXX=/usr/local/gcc-4.8.2/bin/g++
   export CC=/usr/local/gcc-4.8.2/bin/gcc
   export LD_LIBRARY_PATH=/usr/local/gcc-4.8.2/lib64:${LD_LIBRARY_PATH}
   
2. How to build and run vecphys with GeantV

   2.1 build GeantV with additional cmake switches

   -DUSE_VECPHYS=ON 
   -DGUBENCHMARK=[Model|Process] (build benchmarker executables. see 3.3 how to run it)

   2.2 run one of example macros under vecprot_v2: for example,

   - load libs inside run.C 

     R__LOAD_LIBRARY(libGeant_v)
     R__LOAD_LIBRARY(libVphysproc)

   - activate vector physics process

     prop->fVectorPhysicsProcess = new GVectorPhysicsProcess(prop->fEmin, nthreads);

   - run the macro

    export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:<path_to_geantV_install/lib>
    root.exe -b -l -q 'run.C(4)'

3. How to build and run standalone vecphys without GeantV

   3.1 setup

   #cmake required: Vc and VecGeom (include path to VecCore)
   export Vc_DIR=${VC_INSTALL_DIR}
   export VecGeom_DIR=${VECGEOM_INSTALL_DIR}

   #root (if ROOT=ON) (turn on histogramming with GUBENCHMARK=ON)
   source ${ROOT_INSTALL_DIR}/bin/thisroot.sh

   #cuda (if CUDA=ON)
   require VecGeom built with CUDA=ON

   3.2 how to build 

   cd vecphys ; mkdir build ; cd build
   cmake -DVc_DIR=${Vc_DIR} -DVecGeom_DIR=${VecGeom_DIR} -DVecGeom_SRC=${VecGeom_SRC} \
         -DROOT=ON -DCUDA=ON -DGUBENCHMARK=[Model|Process] ..

   3.3 how to run benchmarker 

   ./GUModelBenchmark [ntracks] [nrepetitions] [minEnergy] [maxEnergy] [samplingType] [model] [materialMode]
   ./ProcessBenchmark [ntracks] [nrepetitions] [minEnergy] [maxEnergy] [ProcessType] [runmode] [materialMode]

   where the valid argument for 
   samplingType: [0=kAlias, 1=kRejection, 2=kUnpack]      
   model: [-1=AllModels, 0=KleinNishina, 1= BetheHeitler, 2=SauterGavrila, 3=MollerBhabha, 4=SeltzerBerger]
   materialMode: [0=Multiple elements from a table, 1=One Material] 

   3.4 data file
   Download required data files for testing the SeltzerBerger model
   wget http://geant4.cern.ch/support/source/G4EMLOW.6.42.tar.gz 
   tar xzf G4EMLOW.6.42.tar.gz brem_SB
   mkdir data ; cp -r G4EMLOW6.42/brem_SB data/brem_SB
   (will introduce the env for the target data directory and put an option
   to get the file through cmake configuration)

4. Other important options

   # set the build type to Release, especially for testing the CUDA backend
   -DCMAKE_BUILD_TYPE=Release

   # set a vector instruction set
   -DVECPHYS_VECTOR=sse

   # set the Vc lib for KNC (Xeon Phi)
   -DBACKEND=Vc -DKNC=ON

5. How to build and run the benchmaker (GUModelBenchmark) on Intel Xeon Phi
   
export COMP_FLAGS="-DBENCHMARK=ON -DROOT=OFF -DVc_DIR=path_to_icc_Vc"
export CXX_FLAGS="-mmic"
export C_FLAGS="$CXX_FLAGS"

cmake ../ -DCMAKE_C_COMPILER=icc -DCMAKE_CXX_COMPILER=icpc \
          -DCMAKE_C_FLAGS="$C_FLAGS" -DCMAKE_CXX_FLAGS="$CXX_FLAGS" $COMP_FLAGS