Geant4.10
|
Author: Koichi Murakami (KEK) / Koich i.Mu rakam i@ke k.jp
G4MPI is a native interface with MPI libraries. The directory contains a Geant4 UI library and a couple of parallelized examples. Using this interface, users applications can be parallelized with different MPI compliant libraries, such as OpenMPI, LAM/MPI, MPICH2 and so on.
The MPI interface can work with MPI-compliant libraries, such as Open MPI, LAM/MPI, Intel MPI etc.
For example, the information about Open MPI can be obtained from http://www.open-mpi.org/
CMake is used to build G4MPI library, that co-works with Geant4 build system.
ROOT for histogramming/analysis
To build G4MPI library, use CMake on Geant4 library installed with CMake build.
Check CMakeList.txt
, especially the following two variables should be taken care to match your MPI library
eg. set(CMAKE_CXX_COMPILER mpicxx) #set(CMAKE_CXX_INCLUDE_PATH ) set if necessary
Follow these commands,
> cd source > mkdir build > cd build > cmake -DGeant4_DIR=<your Geant4 install path>/lib64/Geant4-V.m.n .. (V.m.n is the version of Geant4, eg. Geant4-9.6.0) > make > make install
The library and header files will be installed on the installation directory of Geant4.
An example of a main program:
LAM/MPI users can use "G4tcsh" as an interactive session shell. For other users (Open MPI/MPICH2), plesae use G4csh (default).
In case of OpenMPI, LD_LIBRARY_PATH for OpenMPI runtime libraries should be set at run time. Alternatively, you can add this path to the dynamic linker configuration using ldconfig
. (needs sys-admin authorization)
lamboot
(LAM) / mpdboot
(MPICH2) / mpd
(Intel).For example,
> mpiexec -n # <your application>
Instead, mpirun
command is more convenient for LAM users.
G4UI commands handling the G4MPI interface are placed in /mpi/.
While "/run/beamOn" and "/mpi/beamOn" commands invoke beam-on in background, so you can input UI commands even while event processing. Note that drawing tracks in OpenGL with these commands causes a crash. Please use /mpi/.beamOn command instead.
The original "/control/execute" and "/run/beamOn" are overwritten with "/mpi/execute" and "/mpi/beamOn" commands respectively, that are customized for the MPI interface.
There are a couple of examples for Geant4 MPI applications.
In some cases, you need to set some additional environment variables for running examples:
For using ROOT libraries
A simple application.
Configuration:
Features:
An example of dosimetry in a water phantom.
Configuration:
Features: