From Documentation
Jump to: navigation, search
 
(31 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Template:Outdated}}
+
{{Template:CCMissing}}
 
{{Software
 
{{Software
 
|package_name=GEANT4
 
|package_name=GEANT4
Line 5: Line 5:
 
|package_idnumber=59
 
|package_idnumber=59
 
}}
 
}}
The latest version of geant4 (9.6.1) is installed on CentOS clusters under /opt/sharcnet/geant4/9.6.1/gcc .
 
  
Geant4 comes with many examples useful for testing purposes. You can start with a simple test. For instance, here are the steps to compile and run an analysis example A01 in ~/testing directory inside your home directory:
+
=Introduction=
  
  module unload intel
+
Geant4 is a toolkit for the simulation of the passage of particles through matter. Its areas of application include high energy, nuclear and accelerator physics, as well as studies in medical and space science.
  module load gcc/4.5.3
+
 
module load geant4/gcc/9.6.1
+
=Usage on graham and cedar=
  export G4WORKDIR=~/testing
+
 
  cp -a /opt/sharcnet/geant4/9.6.1/gcc/examples/extended/analysis/A01 $G4WORKDIR/A01
+
Geant4 is installed as a module on cedar and graham.
  source /opt/sharcnet/geant4/9.6.1/gcc/share/Geant4-9.6.1/geant4make/geant4make.sh
+
 
  export CXX=g++
+
To see which versions are available, execute:
  cd $G4WORKDIR/A01
+
 
 +
  module avail geant4
 +
 
 +
To then use a particular version, execute for example:
 +
 
 +
  module load geant4/10.02.p03
 +
 
 +
After you load the module, you can see where the software is installed by executing:
 +
 
 +
echo $EBROOTGEANT4
 +
 
 +
To see the useful examples included with the version we have loaded, execute:
 +
 
 +
ls $EBROOTGEANT4/share/Geant4-10.2.3/examples
 +
 
 +
Consider the AnaEx01 example as follows:
 +
 
 +
  mkdir -p ~/samples/geant4/test-100202
 +
  cd ~/samples/geant4/test-100202
 +
module load geant4/10.02.p03
 +
cp -r $EBROOTGEANT4/share/Geant4-10.2.3/examples/extended/analysis/AnaEx01 .
 +
  source $EBROOTGEANT4/share/Geant4-10.2.3/geant4make/geant4make.sh
 +
  cd AnaEx01
 +
mkdir build
 +
  cd build
 +
cmake ..
 
  make
 
  make
sqsub -q serial -r 5m -o output.log ../bin/Linux-g++/A01app
 
  
 +
This creates the executable ''AnaEx01'' in the current (build) folder. You can run it by:
 +
 +
./AnaEx01
 +
 +
You run this executable and enter "help" for the available actions.
 +
 +
Once the binary runs interactively as desired you can submit it as a job. (see [https://docs.computecanada.ca/wiki/Running_jobs Running jobs] page).
 +
 +
=Usage on older SHARCNET systems=
 +
 +
SHARCNET provides a build of geant4 on sharcnet CentOS clusters .
 +
 +
Geant4 comes with many examples useful for testing purposes:
 +
 +
[roberpj@vdi-centos6:/opt/sharcnet/geant4/10.02.02/share/Geant4-10.2.2/examples/extended/analysis] ls
 +
AnaEx01  AnaEx02  AnaEx03  B1Con  CMakeLists.txt  History  README  shared
 +
 +
==Interactive==
 +
 +
Consider the AnaEx01 example as follows:
 +
 +
mkdir -p ~/samples/geant4/test-100202
 +
cd ~/samples/geant4/test-100202
 +
module unload intel
 +
module load ldwrapper gcc/4.9.3 geant4/10.02.02
 +
cp -r /opt/sharcnet/geant4/10.02.02/share/Geant4-10.2.2/examples/extended/analysis/AnaEx01 .
 +
source geant4make.sh
 +
cd AnaEx01
 +
gmake clean_setup
 +
gmake setup
 +
gmake
 +
 +
where ...
 +
[roberpj@vdi-centos6:~/samples/geant4/test-100202/AnaEx01] which AnaEx01
 +
~/geant4_workdir/bin/Linux-g++/AnaEx01
 +
 +
To run the binary do:
 +
 +
[roberpj@vdi-centos6:~/samples/geant4/test-100202/AnaEx01] AnaEx01
 +
Idle> help
 +
Command directory path : /
 +
Sub-directories :
 +
1) /control/  UI control commands.
 +
2) /units/  Available units.
 +
3) /process/  Process Table control commands.
 +
4) /analysis/  ...Title not available...
 +
5) /particle/  Particle control commands.
 +
6) /geometry/  Geometry control commands.
 +
7) /tracking/  TrackingManager and SteppingManager control commands.
 +
8) /event/  EventManager control commands.
 +
9) /cuts/  Commands for G4VUserPhysicsList.
 +
10) /run/  Run control commands.
 +
11) /random/  Random number status control commands.
 +
12) /material/  Commands for materials
 +
13) /N03/  UI commands of this example
 +
14) /physics_lists/  commands related to the physics simulation engine.
 +
15) /gun/  Particle Gun control commands.
 +
16) /heptst/  Controls for the hadronic energy/momentum test
 +
17) /physics_engine/  ...Title not available...
 +
18) /vis/  Visualization commands.
 +
Commands :
 +
Type the number ( 0:end, -n:n level back ) :
 +
 +
==Cluster==
 +
 +
Once the binary runs interactively as desired submit it to the serial queue:
 +
 +
sqsub -q serial -r 5m -o file.%J ~/geant4_workdir/bin/Linux-g++/AnaEx01
 +
 +
==Graphical==
 +
 +
None at this time.
 +
 +
=Notes=
  
Note that geant4 makefiles will omit the environment variable $LD_RUN_PATH which has a path to gcc libraries, instead encoding only its own path to the application library you are building ($G4WORKDIR/tmp/Linux-g++/A01app in our example), so we need to set LD_LIBRARY_PATH by hand before running geant4 as illustrated by the example above.
+
None at this time.
  
==References==
+
=References=
  
 
o Geant4 Homepage<br>
 
o Geant4 Homepage<br>

Latest revision as of 10:11, 6 June 2019

This page is will be deleted pending it's creation on the CC wiki.
GEANT4
Description: Suite of programs for the simulation of the passage of particles through matter
SHARCNET Package information: see GEANT4 software page in web portal
Full list of SHARCNET supported software


Introduction

Geant4 is a toolkit for the simulation of the passage of particles through matter. Its areas of application include high energy, nuclear and accelerator physics, as well as studies in medical and space science.

Usage on graham and cedar

Geant4 is installed as a module on cedar and graham.

To see which versions are available, execute:

module avail geant4

To then use a particular version, execute for example:

module load geant4/10.02.p03

After you load the module, you can see where the software is installed by executing:

echo $EBROOTGEANT4

To see the useful examples included with the version we have loaded, execute:

ls $EBROOTGEANT4/share/Geant4-10.2.3/examples

Consider the AnaEx01 example as follows:

mkdir -p ~/samples/geant4/test-100202
cd ~/samples/geant4/test-100202
module load geant4/10.02.p03
cp -r $EBROOTGEANT4/share/Geant4-10.2.3/examples/extended/analysis/AnaEx01 .
source $EBROOTGEANT4/share/Geant4-10.2.3/geant4make/geant4make.sh
cd AnaEx01
mkdir build
cd build
cmake ..
make

This creates the executable AnaEx01 in the current (build) folder. You can run it by:

./AnaEx01

You run this executable and enter "help" for the available actions.

Once the binary runs interactively as desired you can submit it as a job. (see Running jobs page).

Usage on older SHARCNET systems

SHARCNET provides a build of geant4 on sharcnet CentOS clusters .

Geant4 comes with many examples useful for testing purposes:

[roberpj@vdi-centos6:/opt/sharcnet/geant4/10.02.02/share/Geant4-10.2.2/examples/extended/analysis] ls 
AnaEx01  AnaEx02  AnaEx03  B1Con  CMakeLists.txt  History  README  shared

Interactive

Consider the AnaEx01 example as follows:

mkdir -p ~/samples/geant4/test-100202
cd ~/samples/geant4/test-100202
module unload intel
module load ldwrapper gcc/4.9.3 geant4/10.02.02
cp -r /opt/sharcnet/geant4/10.02.02/share/Geant4-10.2.2/examples/extended/analysis/AnaEx01 .
source geant4make.sh
cd AnaEx01
gmake clean_setup
gmake setup
gmake

where ...

[roberpj@vdi-centos6:~/samples/geant4/test-100202/AnaEx01] which AnaEx01 
~/geant4_workdir/bin/Linux-g++/AnaEx01

To run the binary do:

[roberpj@vdi-centos6:~/samples/geant4/test-100202/AnaEx01] AnaEx01
Idle> help
Command directory path : /
Sub-directories : 
1) /control/   UI control commands.
2) /units/   Available units.
3) /process/   Process Table control commands.
4) /analysis/   ...Title not available...
5) /particle/   Particle control commands.
6) /geometry/   Geometry control commands.
7) /tracking/   TrackingManager and SteppingManager control commands.
8) /event/   EventManager control commands.
9) /cuts/   Commands for G4VUserPhysicsList.
10) /run/   Run control commands.
11) /random/   Random number status control commands.
12) /material/   Commands for materials
13) /N03/   UI commands of this example
14) /physics_lists/   commands related to the physics simulation engine.
15) /gun/   Particle Gun control commands.
16) /heptst/   Controls for the hadronic energy/momentum test
17) /physics_engine/   ...Title not available...
18) /vis/   Visualization commands.
Commands : 
Type the number ( 0:end, -n:n level back ) :

Cluster

Once the binary runs interactively as desired submit it to the serial queue:

sqsub -q serial -r 5m -o file.%J ~/geant4_workdir/bin/Linux-g++/AnaEx01

Graphical

None at this time.

Notes

None at this time.

References

o Geant4 Homepage
http://geant4.web.cern.ch/geant4/

o Online User Documentation
http://geant4.web.cern.ch/geant4/support/userdocuments.shtml