Import Geant4 11.0.0 source tree
This commit is contained in:
@@ -0,0 +1,238 @@
|
||||
/// @file "parallel/MPI/.README.txt"
|
||||
/// @brief Examples MPI README
|
||||
|
||||
/*! \page Examples_MPI Category : parallel/MPI
|
||||
|
||||
|
||||
About the interface
|
||||
===================
|
||||
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, MPICH2 and so on.
|
||||
|
||||
System Requirements:
|
||||
--------------------
|
||||
|
||||
### MPI Library
|
||||
|
||||
The MPI interface can work with MPI-compliant libraries,
|
||||
such as Open MPI, MPICH, Intel MPI etc.
|
||||
|
||||
For example, the information about Open MPI can be obtained from
|
||||
http://www.open-mpi.org/
|
||||
|
||||
MPI support:
|
||||
------------
|
||||
G4mpi has been tested with the following MPI flavors:
|
||||
* OpenMPI 1.8.1
|
||||
* MPICH 3.2
|
||||
* Intel MPI 5.0.1
|
||||
|
||||
### CMake
|
||||
|
||||
CMake is used to build <a href="./group__extended__parallel__MPI__libG4mpi.html"> G4MPI </a> library, that co-works with Geant4 build system.
|
||||
|
||||
### Optional (for exMPI02)
|
||||
|
||||
ROOT for histogramming/analysis
|
||||
|
||||
How to build G4MPI
|
||||
==================
|
||||
To build G4MPI library, use CMake on Geant4 library installed with CMake build.
|
||||
|
||||
Follow these commands,
|
||||
|
||||
> mkdir build
|
||||
> cd build
|
||||
> cmake -DGeant4_DIR=<your Geant4 install path>/lib[64]/Geant4-V.m.n \
|
||||
-DCMAKE_INSTALL_PREFIX=<where-G4mpi-lib-will-be-installed> \
|
||||
<g4source>/examples/extended/parallel/MPI/source
|
||||
> make
|
||||
> make install
|
||||
|
||||
The cmake step will try to guess where MPI is installed, mpi executables should
|
||||
be in PATH. You can specify CXX and CC environment variables to your specific
|
||||
mpi wrappers if needed.
|
||||
|
||||
The library and header files will be installed on the installation directory
|
||||
specified in CMAKE_INSTALL_PREFIX
|
||||
a CMake configuration file will also be installed
|
||||
(see examples on how to compile an application using G4mpi)
|
||||
|
||||
How to use
|
||||
==========
|
||||
|
||||
How to make parallel applications
|
||||
---------------------------------
|
||||
|
||||
An example of a main program:
|
||||
|
||||
\verbatim
|
||||
#include "G4MPImanager.hh"
|
||||
#include "G4MPIsession.hh"
|
||||
|
||||
int main(int argc,char** argv)
|
||||
{
|
||||
// At first, G4MPImanager/G4MPIsession should be created.
|
||||
G4MPImanager* g4MPI= new G4MPImanager(argc,argv);
|
||||
|
||||
// MPI session (G4MPIsession) instead of G4UIterminal
|
||||
G4MPIsession* session= g4MPI-> GetMPIsession();
|
||||
|
||||
// user application setting
|
||||
G4RunManager* runManager= new G4RunManager();
|
||||
|
||||
....
|
||||
|
||||
// After user application setting, just start a MPI session.
|
||||
MPIsession treats both interactive and batch modes.
|
||||
session-> SessionStart();
|
||||
|
||||
// Finally, terminate the program
|
||||
delete g4MPI;
|
||||
delete runManager;
|
||||
}
|
||||
```
|
||||
\endverbatim
|
||||
|
||||
How to compile
|
||||
---------------
|
||||
|
||||
Using cmake, assuming G4mpi library is installed in path _g4mpi-path_ and
|
||||
Geant4 is installed in _g4-path_:
|
||||
|
||||
> mkdir build
|
||||
> cd build
|
||||
> cmake -DGeant4_DIR=<g4-path>/lib[64]/Geant4-V.m.n \
|
||||
-DG4mpi_DIR=<g4mpi-path>/lib[64]/G4mpi-V.m.n \
|
||||
<source>
|
||||
> make
|
||||
|
||||
Check provided examples: under examples/extended/parallel/MPI/examples for an
|
||||
example of CMakeLists.txt file to be used.
|
||||
|
||||
### Notes about session shell
|
||||
|
||||
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)
|
||||
|
||||
|
||||
MPI runtime Environment
|
||||
-----------------------
|
||||
1. Make hosts/cluster configuration of your MPI environment.
|
||||
2. Launch MPI runtime environment, typically executing
|
||||
`lamboot` (LAM) / `mpdboot` (MPICH2) / `mpd` (Intel).
|
||||
|
||||
How to run
|
||||
----------
|
||||
For example,
|
||||
|
||||
> mpiexec -n # <your application>
|
||||
<p>Replace mpicxx with your MPI compiler wrapper if you need to specify which one to use.</p>
|
||||
|
||||
Instead, `mpirun` command is more convenient for LAM users.
|
||||
|
||||
|
||||
MPI G4UI commands
|
||||
-----------------
|
||||
G4UI commands handling the G4MPI interface are placed in /mpi/.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Command directory path : /mpi/
|
||||
|
||||
Guidance :
|
||||
MPI control commands
|
||||
|
||||
Sub-directories :
|
||||
Commands :
|
||||
verbose * Set verbose level.
|
||||
status * Show mpi status.
|
||||
execute * Execute a macro file. (=/control/execute)
|
||||
beamOn * Start a parallel run w/ thread.
|
||||
.beamOn * Start a parallel run w/o thread.
|
||||
masterWeight * Set weight for master node.
|
||||
showSeeds * Show seeds of MPI nodes.
|
||||
setMasterSeed * Set a master seed for the seed generator.
|
||||
setSeed * Set a seed for a specified node.
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
### Notes:
|
||||
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.
|
||||
|
||||
Examples
|
||||
========
|
||||
There are a couple of examples for Geant4 MPI applications.
|
||||
|
||||
For using ROOT libraries (exMPI02)
|
||||
|
||||
- *ROOTSYS* : root path of the ROOT package
|
||||
|
||||
\link exMPI01 exMPI01 \endlink
|
||||
|
||||
A simple application.
|
||||
|
||||
**Configuration:**
|
||||
|
||||
- Geometry : chamber / calorimeter
|
||||
- Primary : particle gun (200 MeV electron as default)
|
||||
- Physics List : FTFP_BERT
|
||||
|
||||
**Features:**
|
||||
- Particles are transported in a geometry without any scoring.
|
||||
- Learn how to parallelized your G4 session.
|
||||
|
||||
\link exMPI02 exMPI02 (ROOT application) \endlink
|
||||
|
||||
An example of dosimetry in a water phantom.
|
||||
Note: due to limited MT support in ROOT, in this example
|
||||
MT is disabled, but the code is migrated to MT, ready
|
||||
for MT when ROOT will support MT.
|
||||
For an example of MT+MPI take a look at exMPI03
|
||||
|
||||
**Configuration:**
|
||||
- Geometry : water phantom
|
||||
- Primary : broad beam (200 MeV proton)
|
||||
- Physics List : FTFP_BERT
|
||||
- Analysis : ROOT histogramming
|
||||
|
||||
**Features:**
|
||||
- Score dose distribution in a water phantom.
|
||||
- Learn how to parallelized your applications.
|
||||
- Create a ROOT file containing histograms/trees in each node.
|
||||
|
||||
\link exMPI03 exMPI03 (merging of histograms via MPI) \endlink
|
||||
|
||||
This example is the same as exMPI02 with the following
|
||||
differences:
|
||||
- It uses g4tools instead of ROOT for histogramming
|
||||
- It shows how to merge, using g4tools, histograms via MPI
|
||||
so that the entire statistics is accumulated in a single output file
|
||||
- It also shows how to merge G4Run objects from different ranks and
|
||||
how to merge scorers
|
||||
- MT is enabled.
|
||||
|
||||
\link exMPI04 exMPI04 (merging of ntuples via MPI) \endlink
|
||||
|
||||
This example is the same as exMPI03 with added ntuple.
|
||||
- It uses g4tools for histogramming and ntuples.
|
||||
- It shows how to merge, using g4tools, ntuples via MPI in sequential mode,
|
||||
so that the entire statistics is accumulated in a single output file.
|
||||
- If MT is enabled, the ntuples are merged from threads to
|
||||
files per ranks.
|
||||
- Combined MT + MPI merging is not yet supported.
|
||||
- Merging ntuples is actually supported only with Root output format.
|
||||
|
||||
*/
|
||||
@@ -0,0 +1,253 @@
|
||||
Geant4 MPI Interface
|
||||
====================
|
||||
|
||||
Author:
|
||||
Koichi Murakami (KEK) / Koichi.Murakami@kek.jp
|
||||
Andrea Dotti (SLAC) / adotti@slac.stanford.edu
|
||||
|
||||
|
||||
About the interface
|
||||
===================
|
||||
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, MPICH2 and so on.
|
||||
|
||||
System Requirements:
|
||||
--------------------
|
||||
|
||||
### MPI Library
|
||||
|
||||
The MPI interface can work with MPI-compliant libraries,
|
||||
such as Open MPI, MPICH, Intel MPI etc.
|
||||
|
||||
For example, the information about Open MPI can be obtained from
|
||||
http://www.open-mpi.org/
|
||||
|
||||
MPI support:
|
||||
------------
|
||||
G4mpi has been tested with the following MPI flavors:
|
||||
* OpenMPI 1.8.1
|
||||
* MPICH 3.2
|
||||
* Intel MPI 5.0.1
|
||||
|
||||
### CMake
|
||||
|
||||
CMake is used to build G4MPI library, that co-works with Geant4 build system.
|
||||
|
||||
### Optional (for exMPI02)
|
||||
|
||||
ROOT for histogramming/analysis
|
||||
|
||||
How to build G4MPI
|
||||
==================
|
||||
To build G4MPI library, use CMake on Geant4 library installed with CMake build.
|
||||
|
||||
Follow these commands,
|
||||
|
||||
> mkdir build
|
||||
> cd build
|
||||
> cmake -DGeant4_DIR=<your Geant4 install path>/lib[64]/Geant4-V.m.n \
|
||||
-DCMAKE_INSTALL_PREFIX=<where-G4mpi-lib-will-be-installed> \
|
||||
<g4source>/examples/extended/parallel/MPI/source
|
||||
> make
|
||||
> make install
|
||||
|
||||
The cmake step will try to guess where MPI is installed, mpi executables should
|
||||
be in PATH. You can specify CXX and CC environment variables to your specific
|
||||
mpi wrappers if needed.
|
||||
|
||||
The library and header files will be installed on the installation directory
|
||||
specified in CMAKE_INSTALL_PREFIX
|
||||
a CMake configuration file will also be installed
|
||||
(see examples on how to compile an application using G4mpi)
|
||||
|
||||
How to use
|
||||
==========
|
||||
|
||||
How to make parallel applications
|
||||
---------------------------------
|
||||
|
||||
An example of a main program:
|
||||
|
||||
```c++
|
||||
#include "G4MPImanager.hh"
|
||||
#include "G4MPIsession.hh"
|
||||
|
||||
int main(int argc,char** argv)
|
||||
{
|
||||
// At first, G4MPImanager/G4MPIsession should be created.
|
||||
G4MPImanager* g4MPI= new G4MPImanager(argc,argv);
|
||||
|
||||
// MPI session (G4MPIsession) instead of G4UIterminal
|
||||
G4MPIsession* session= g4MPI-> GetMPIsession();
|
||||
|
||||
// user application setting
|
||||
G4RunManager* runManager= new G4RunManager();
|
||||
|
||||
....
|
||||
|
||||
// After user application setting, just start a MPI session.
|
||||
MPIsession treats both interactive and batch modes.
|
||||
session-> SessionStart();
|
||||
|
||||
// Finally, terminate the program
|
||||
delete g4MPI;
|
||||
delete runManager;
|
||||
}
|
||||
```
|
||||
|
||||
How to compile
|
||||
---------------
|
||||
|
||||
Using cmake, assuming G4mpi library is installed in path _g4mpi-path_ and
|
||||
Geant4 is installed in _g4-path_:
|
||||
|
||||
> mkdir build
|
||||
> cd build
|
||||
> cmake -DGeant4_DIR=<g4-path>/lib[64]/Geant4-V.m.n \
|
||||
-DG4mpi_DIR=<g4mpi-path>/lib[64]/G4mpi-V.m.n \
|
||||
<source>
|
||||
> make
|
||||
|
||||
Check provided examples: under examples/extended/parallel/MPI/examples for an
|
||||
example of CMakeLists.txt file to be used.
|
||||
|
||||
### Notes about session shell
|
||||
|
||||
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)
|
||||
|
||||
|
||||
MPI runtime Environment
|
||||
-----------------------
|
||||
1. Make hosts/cluster configuration of your MPI environment.
|
||||
2. Launch MPI runtime environment, typically executing
|
||||
`lamboot` (LAM) / `mpdboot` (MPICH2) / `mpd` (Intel).
|
||||
|
||||
How to run
|
||||
----------
|
||||
For example,
|
||||
|
||||
> mpiexec -n # <your application>
|
||||
<p>Replace mpicxx with your MPI compiler wrapper if you need to specify which one to use.</p>
|
||||
|
||||
Instead, `mpirun` command is more convenient for LAM users.
|
||||
|
||||
|
||||
MPI G4UI commands
|
||||
-----------------
|
||||
G4UI commands handling the G4MPI interface are placed in /mpi/.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Command directory path : /mpi/
|
||||
|
||||
Guidance :
|
||||
MPI control commands
|
||||
|
||||
Sub-directories :
|
||||
Commands :
|
||||
verbose * Set verbose level.
|
||||
status * Show mpi status.
|
||||
execute * Execute a macro file. (=/control/execute)
|
||||
beamOn * Start a parallel run w/ thread.
|
||||
.beamOn * Start a parallel run w/o thread.
|
||||
masterWeight * Set weight for master node.
|
||||
showSeeds * Show seeds of MPI nodes.
|
||||
setMasterSeed * Set a master seed for the seed generator.
|
||||
setSeed * Set a seed for a specified node.
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
### Notes:
|
||||
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.
|
||||
|
||||
Examples
|
||||
========
|
||||
There are a couple of examples for Geant4 MPI applications.
|
||||
|
||||
For using ROOT libraries (exMPI02)
|
||||
|
||||
- *ROOTSYS* : root path of the ROOT package
|
||||
|
||||
exMPI01
|
||||
-------
|
||||
A simple application.
|
||||
|
||||
**Configuration:**
|
||||
|
||||
- Geometry : chamber / calorimeter
|
||||
- Primary : particle gun (200 MeV electron as default)
|
||||
- Physics List : FTFP_BERT
|
||||
|
||||
**Features:**
|
||||
- Particles are transported in a geometry without any scoring.
|
||||
- Learn how to parallelized your G4 session.
|
||||
|
||||
exMPI02 (ROOT application)
|
||||
--------------------------
|
||||
An example of dosimetry in a water phantom.
|
||||
Note: due to limited MT support in ROOT, in this example
|
||||
MT is disabled, but the code is migrated to MT, ready
|
||||
for MT when ROOT will support MT.
|
||||
For an example of MT+MPI take a look at exMPI03
|
||||
|
||||
**Configuration:**
|
||||
- Geometry : water phantom
|
||||
- Primary : broad beam (200 MeV proton)
|
||||
- Physics List : FTFP_BERT
|
||||
- Analysis : ROOT histogramming
|
||||
|
||||
**Features:**
|
||||
- Score dose distribution in a water phantom.
|
||||
- Learn how to parallelized your applications.
|
||||
- Create a ROOT file containing histograms/trees in each node.
|
||||
|
||||
exMPI03 (merging of histograms via MPI)
|
||||
---------------------------------------
|
||||
This example is the same as exMPI02 with the following
|
||||
differences:
|
||||
- It uses Geant4 analysis instead of ROOT for histogramming
|
||||
- It shows how to merge, using g4tools, histograms via MPI
|
||||
so that the entire statistics is accumulated in a single output file
|
||||
- It also shows how to merge G4Run objects from different ranks and
|
||||
how to merge scorers
|
||||
- MT is enabled.
|
||||
- Root output files from application run with `mpiexec -n 3`
|
||||
- dose-merged.root - merged histograms
|
||||
- dose-rank0,1,2 - histograms data collected on rank 0, 1,2 before merge
|
||||
|
||||
exMPI04 (merging of ntuples via MPI)
|
||||
---------------------------------------
|
||||
This example is the same as exMPI03 with added ntuple.
|
||||
- It uses Geant4 analysis for histogramming and ntuples.
|
||||
- It shows how to merge, using g4tools, ntuples via MPI in sequential mode,
|
||||
so that the entire statistics is accumulated in a single output file.
|
||||
- If MT is enabled, the ntuples are merged from threads to
|
||||
files per ranks.
|
||||
- Combined MT + MPI merging is not yet supported.
|
||||
- Merging ntuples is actually supported only with Root output format.
|
||||
|
||||
- Root output files from application run with `mpiexec -n 4`
|
||||
- Sequential application:
|
||||
(3 working ranks, 1 rank dedicated for collecting ntuple data)
|
||||
- dose-merged.root - merged histograms
|
||||
- dose-rank0,1,2.root - histograms data collected on rank 0 before merge
|
||||
- dose-rank3 - ntuples merged from ranks 0, 1 and 2
|
||||
- MT application:
|
||||
(4 working ranks)
|
||||
- dose-merged.root - merged histograms
|
||||
- dose-rank0, 1, 2, 3.root - histograms data collected on rank N before merge;
|
||||
ntuples merged on rank N from rank threads
|
||||
|
||||
@@ -0,0 +1,134 @@
|
||||
#Workaround: rely on executables build by cmake since it does not compile
|
||||
#correctly because FindG4mpi.cmake is not found
|
||||
find_package(MPI QUIET)
|
||||
if(NOT MPI_CXX_FOUND)
|
||||
message(STATUS "G4 Examples: MPI not found --> mpi based tests disabled")
|
||||
return()
|
||||
endif()
|
||||
message(STATUS "G4 Examples: mpi examples will use mpi launcher: " ${MPIEXEC})
|
||||
|
||||
# Base output dir for MPI examples:
|
||||
set(G4MPI_CTESTS_BASE_OUTPUT_DIR "${CMAKE_BINARY_DIR}/examples/extended/parallel/MPI")
|
||||
|
||||
# Set G4mpi_DIR fo later pass-down to examples
|
||||
set(G4mpi_DIR "${G4MPI_CTESTS_BASE_OUTPUT_DIR}/G4mpi")
|
||||
|
||||
# - Build/Test G4mpi
|
||||
geant4_add_test(mpi-libg4mpi
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "G4mpi build complete"
|
||||
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/source
|
||||
BINARY_DIR ${G4mpi_DIR}
|
||||
PROJECT libG4mpi
|
||||
BUILD G4mpi
|
||||
ENVIRONMENT ${GEANT4_TEST_ENVIRONMENT}
|
||||
LABELS MPI
|
||||
)
|
||||
|
||||
# - Build/Test exMPI01
|
||||
# variable to simplify paths
|
||||
set(G4MPI_EX01_BINDIR ${G4MPI_CTESTS_BASE_OUTPUT_DIR}/exMPI01)
|
||||
|
||||
geant4_add_test(mpi-ex01-sequential
|
||||
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/examples/exMPI01
|
||||
BINARY_DIR ${G4MPI_EX01_BINDIR}
|
||||
PROJECT exMPI01
|
||||
BUILD exMPI01
|
||||
COMMAND ${G4MPI_EX01_BINDIR}/exMPI01 run.mac
|
||||
WORKING_DIRECTORY ${G4MPI_EX01_BINDIR}
|
||||
ENVIRONMENT ${GEANT4_TEST_ENVIRONMENT}
|
||||
DEPENDS mpi-libg4mpi
|
||||
LABELS MPI
|
||||
)
|
||||
# Needs G4mpi
|
||||
set_property(TEST mpi-ex01-sequential APPEND PROPERTY ENVIRONMENT G4mpi_DIR=${G4mpi_DIR})
|
||||
|
||||
geant4_add_test(mpi-ex01
|
||||
COMMAND ${MPIEXEC} -n 2 ${G4MPI_EX01_BINDIR}/exMPI01 run.mac
|
||||
WORKING_DIRECTORY ${G4MPI_EX01_BINDIR}
|
||||
ENVIRONMENT ${GEANT4_TEST_ENVIRONMENT}
|
||||
DEPENDS mpi-ex01-sequential
|
||||
LABELS MPI
|
||||
)
|
||||
|
||||
# - Build/Test exMPI02
|
||||
# Needs ROOT
|
||||
find_package(ROOT QUIET)
|
||||
if(ROOT_FOUND)
|
||||
set(G4MPI_EX02_BINDIR ${G4MPI_CTESTS_BASE_OUTPUT_DIR}/exMPI02)
|
||||
|
||||
geant4_add_test(mpi-ex02-sequential
|
||||
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/examples/exMPI02
|
||||
BINARY_DIR ${G4MPI_EX02_BINDIR}
|
||||
PROJECT exMPI02
|
||||
BUILD exMPI02
|
||||
COMMAND ${G4MPI_EX02_BINDIR}/exMPI02 run.mac
|
||||
WORKING_DIRECTORY ${G4MPI_EX02_BINDIR}
|
||||
ENVIRONMENT ${GEANT4_TEST_ENVIRONMENT}
|
||||
DEPENDS mpi-libg4mpi
|
||||
LABELS MPI
|
||||
)
|
||||
# Needs G4mpi
|
||||
set_property(TEST mpi-ex02-sequential APPEND PROPERTY ENVIRONMENT G4mpi_DIR=${G4mpi_DIR})
|
||||
|
||||
geant4_add_test(mpi-ex02
|
||||
COMMAND ${MPIEXEC} -n 2 ${G4MPI_EX02_BINDIR}/exMPI02 run.mac
|
||||
WORKING_DIRECTORY ${G4MPI_EX02_BINDIR}
|
||||
ENVIRONMENT ${GEANT4_TEST_ENVIRONMENT}
|
||||
DEPENDS mpi-ex02-sequential
|
||||
LABELS MPI
|
||||
)
|
||||
else()
|
||||
message(STATUS "G4 Examples: MPI example exMPI02 disabled: ROOT not found")
|
||||
endif()
|
||||
|
||||
# - Build/Test exMPI03
|
||||
# variable to simplify paths
|
||||
set(G4MPI_EX03_BINDIR ${G4MPI_CTESTS_BASE_OUTPUT_DIR}/exMPI03)
|
||||
|
||||
geant4_add_test(mpi-ex03-sequential
|
||||
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/examples/exMPI03
|
||||
BINARY_DIR ${G4MPI_EX03_BINDIR}
|
||||
PROJECT exMPI03
|
||||
BUILD exMPI03
|
||||
COMMAND ${G4MPI_EX03_BINDIR}/exMPI03 run.mac
|
||||
WORKING_DIRECTORY ${G4MPI_EX03_BINDIR}
|
||||
ENVIRONMENT ${GEANT4_TEST_ENVIRONMENT}
|
||||
DEPENDS mpi-libg4mpi
|
||||
LABELS MPI
|
||||
)
|
||||
# Needs G4mpi
|
||||
set_property(TEST mpi-ex03-sequential APPEND PROPERTY ENVIRONMENT G4mpi_DIR=${G4mpi_DIR})
|
||||
|
||||
geant4_add_test(mpi-ex03
|
||||
COMMAND ${MPIEXEC} -n 2 ${G4MPI_EX03_BINDIR}/exMPI03 run.mac
|
||||
WORKING_DIRECTORY ${G4MPI_EX03_BINDIR}
|
||||
ENVIRONMENT ${GEANT4_TEST_ENVIRONMENT}
|
||||
DEPENDS mpi-ex03-sequential
|
||||
LABELS MPI
|
||||
)
|
||||
|
||||
# - Build/Test exMPI04
|
||||
# variable to simplify paths
|
||||
set(G4MPI_EX04_BINDIR ${G4MPI_CTESTS_BASE_OUTPUT_DIR}/exMPI04)
|
||||
|
||||
geant4_add_test(mpi-ex04-sequential
|
||||
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/examples/exMPI04
|
||||
BINARY_DIR ${G4MPI_EX04_BINDIR}
|
||||
PROJECT exMPI04
|
||||
BUILD exMPI04
|
||||
COMMAND ${G4MPI_EX04_BINDIR}/exMPI04 run.mac
|
||||
WORKING_DIRECTORY ${G4MPI_EX04_BINDIR}
|
||||
ENVIRONMENT ${GEANT4_TEST_ENVIRONMENT}
|
||||
DEPENDS mpi-libg4mpi
|
||||
LABELS MPI
|
||||
)
|
||||
# Needs G4mpi
|
||||
set_property(TEST mpi-ex04-sequential APPEND PROPERTY ENVIRONMENT G4mpi_DIR=${G4mpi_DIR})
|
||||
|
||||
geant4_add_test(mpi-ex04
|
||||
COMMAND ${MPIEXEC} -n 3 ${G4MPI_EX04_BINDIR}/exMPI04 run.mac
|
||||
WORKING_DIRECTORY ${G4MPI_EX04_BINDIR}
|
||||
ENVIRONMENT ${GEANT4_TEST_ENVIRONMENT}
|
||||
DEPENDS mpi-ex04-sequential
|
||||
LABELS MPI
|
||||
)
|
||||
@@ -0,0 +1,46 @@
|
||||
/// @file "MPI/examples/exMPI01/.README.txt"
|
||||
/// @brief Example exMPI01 README
|
||||
|
||||
/*! \page exMPI01 Example : exMPI01
|
||||
|
||||
|
||||
Description
|
||||
===========
|
||||
A simple application
|
||||
|
||||
### Configuration:
|
||||
|
||||
- Geometry : chamber / calorimeter
|
||||
- Primary : particle gun (200 MeV electron as default)
|
||||
- Physics List : FTFP_BERT
|
||||
|
||||
The environment variable *G4LEDATA* for low energy EM data is required.
|
||||
|
||||
### Features:
|
||||
|
||||
- Particles are transported in a geometry without any scoring.
|
||||
- Learn how to parallelized your G4 session.
|
||||
|
||||
|
||||
- - -
|
||||
|
||||
How to build
|
||||
============
|
||||
Use CMake on Geant4 library installed with CMake build.
|
||||
|
||||
This example requires G4mpi library to be installed
|
||||
(see examples/extended/parallel/MPI/source/REDME.md)
|
||||
|
||||
Follow these commands,
|
||||
|
||||
> mkdir build
|
||||
> cd build
|
||||
> cmake -DG4mpi_DIR=<where-G4mpi-wasintalled>/lib[64]/G4mpi -DCMAKE_CXX_COMPILER=mpicxx \
|
||||
-DGeant4_DIR=<your Geant4 install path>/lib[64]/Geant4-V.m.n <path-to-source>
|
||||
(V.m.n is the version of Geant4, eg. Geant4-9.6.0)
|
||||
> make
|
||||
> make install
|
||||
|
||||
Replace mpicxx with your MPI-compiler wrapper.
|
||||
|
||||
*/
|
||||
@@ -0,0 +1,245 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="generated-by" content="Markdown PRO, http://markdownpro.com"/>
|
||||
<title></title>
|
||||
<style type="text/css">
|
||||
html,body{margin:0;padding:0;}
|
||||
body {padding: 20px}
|
||||
h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,cite,code,del,dfn,em,img,q,s,samp,small,strike,strong,sub,sup,tt,var,dd,dl,dt,li,ol,ul,fieldset,form,label,legend,button,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;font-weight:normal;font-style:normal;font-size:100%;line-height:1;font-family:inherit;}
|
||||
table{border-collapse:collapse;border-spacing:0;}
|
||||
ol,ul{list-style:none;}
|
||||
q:before,q:after,blockquote:before,blockquote:after{content:"";}
|
||||
html{overflow-y:scroll;font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;}
|
||||
a:focus{outline:thin dotted;}
|
||||
a:hover,a:active{outline:0;}
|
||||
article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block;}
|
||||
audio,canvas,video{display:inline-block;*display:inline;*zoom:1;}
|
||||
audio:not([controls]){display:none;}
|
||||
sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline;}
|
||||
sup{top:-0.5em;}
|
||||
sub{bottom:-0.25em;}
|
||||
img{border:0;-ms-interpolation-mode:bicubic;}
|
||||
button,input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle;}
|
||||
button,input{line-height:normal;*overflow:visible;}
|
||||
button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}
|
||||
button,input[type="button"],input[type="reset"],input[type="submit"]{cursor:pointer;-webkit-appearance:button;}
|
||||
input[type="search"]{-webkit-appearance:textfield;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;}
|
||||
input[type="search"]::-webkit-search-decoration{-webkit-appearance:none;}
|
||||
textarea{overflow:auto;vertical-align:top;}
|
||||
html,body{background-color:#ffffff;}
|
||||
body{margin:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;font-weight:normal;line-height:18px;color:#404040;}
|
||||
.container{width:940px;margin-left:auto;margin-right:auto;zoom:1;}.container:before,.container:after{display:table;content:"";zoom:1;*display:inline;}
|
||||
.container:after{clear:both;}
|
||||
.container-fluid{position:relative;min-width:940px;padding-left:20px;padding-right:20px;zoom:1;}.container-fluid:before,.container-fluid:after{display:table;content:"";zoom:1;*display:inline;}
|
||||
.container-fluid:after{clear:both;}
|
||||
.container-fluid>.sidebar{float:left;width:220px;}
|
||||
.container-fluid>.content{margin-left:240px;}
|
||||
a{color:#0069d6;text-decoration:none;line-height:inherit;font-weight:inherit;}a:hover{color:#00438a;text-decoration:underline;}
|
||||
.pull-right{float:right;}
|
||||
.pull-left{float:left;}
|
||||
.hide{display:none;}
|
||||
.show{display:block;}
|
||||
.row{zoom:1;margin-left:-20px;}.row:before,.row:after{display:table;content:"";zoom:1;*display:inline;}
|
||||
.row:after{clear:both;}
|
||||
p{font-size:13px;font-weight:normal;line-height:18px;margin-bottom:9px;}p small{font-size:11px;color:#bfbfbf;}
|
||||
h1,h2,h3,h4,h5,h6{font-weight:bold;color:#404040;}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small{color:#bfbfbf;}
|
||||
h1{margin-bottom:18px;font-size:30px;line-height:36px;}h1 small{font-size:18px;}
|
||||
h2{font-size:24px;line-height:36px;}h2 small{font-size:14px;}
|
||||
h3,h4,h5,h6{line-height:36px;}
|
||||
h3{font-size:18px;}h3 small{font-size:14px;}
|
||||
h4{font-size:16px;}h4 small{font-size:12px;}
|
||||
h5{font-size:14px;}
|
||||
h6{font-size:13px;color:#bfbfbf;text-transform:uppercase;}
|
||||
ul,ol{margin:0 0 18px 25px;}
|
||||
ul ul,ul ol,ol ol,ol ul{margin-bottom:0;}
|
||||
ul{list-style:disc;}
|
||||
ol{list-style:decimal;}
|
||||
li{line-height:18px;color:#808080;}
|
||||
ul.unstyled{list-style:none;margin-left:0;}
|
||||
dl{margin-bottom:18px;}dl dt,dl dd{line-height:18px;}
|
||||
dl dt{font-weight:bold;}
|
||||
dl dd{margin-left:9px;}
|
||||
hr{margin:20px 0 19px;border:0;border-bottom:1px solid #eee;}
|
||||
strong{font-style:inherit;font-weight:bold;}
|
||||
em{font-style:italic;font-weight:inherit;line-height:inherit;}
|
||||
.muted{color:#bfbfbf;}
|
||||
blockquote{margin-bottom:18px;border-left:5px solid #eee;padding-left:15px;}blockquote p{font-size:14px;font-weight:300;line-height:18px;margin-bottom:0;}
|
||||
blockquote small{display:block;font-size:12px;font-weight:300;line-height:18px;color:#bfbfbf;}blockquote small:before{content:'\2014 \00A0';}
|
||||
address{display:block;line-height:18px;margin-bottom:18px;}
|
||||
code,pre{padding:0 3px 2px;font-family:Monaco, Andale Mono, Courier New, monospace;font-size:12px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;}
|
||||
code{padding:1px 3px;}
|
||||
pre{background-color:#f5f5f5;display:block;padding:8.5px;margin:0 0 18px;line-height:18px;font-size:12px;border:1px solid #ccc;border:1px solid rgba(0, 0, 0, 0.15);-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;white-space:pre;white-space:pre-wrap;word-wrap:break-word;}
|
||||
form{margin-bottom:18px;}
|
||||
fieldset{margin-bottom:18px;padding-top:18px;}fieldset legend{display:block;padding-left:150px;font-size:19.5px;line-height:1;color:#404040;*padding:0 0 5px 145px;*line-height:1.5;}
|
||||
form .clearfix{margin-bottom:18px;zoom:1;}form .clearfix:before,form .clearfix:after{display:table;content:"";zoom:1;*display:inline;}
|
||||
form .clearfix:after{clear:both;}
|
||||
label,input,select,textarea{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;font-weight:normal;line-height:normal;}
|
||||
label{padding-top:6px;font-size:13px;line-height:18px;float:left;width:130px;text-align:right;color:#404040;}
|
||||
form .input{margin-left:150px;}
|
||||
input[type=checkbox],input[type=radio]{cursor:pointer;}
|
||||
input,textarea,select,.uneditable-input{display:inline-block;width:210px;height:18px;padding:4px;font-size:13px;line-height:18px;color:#808080;border:1px solid #ccc;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;}
|
||||
input[type=checkbox],input[type=radio]{width:auto;height:auto;padding:0;margin:3px 0;*margin-top:0;line-height:normal;border:none;}
|
||||
input[type=file]{background-color:#ffffff;padding:initial;border:initial;line-height:initial;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;}
|
||||
input[type=button],input[type=reset],input[type=submit]{width:auto;height:auto;}
|
||||
select,input[type=file]{height:27px;line-height:27px;*margin-top:4px;}
|
||||
select[multiple]{height:inherit;}
|
||||
textarea{height:auto;}
|
||||
.uneditable-input{background-color:#ffffff;display:block;border-color:#eee;-webkit-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);-moz-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);cursor:not-allowed;}
|
||||
:-moz-placeholder{color:#bfbfbf;}
|
||||
::-webkit-input-placeholder{color:#bfbfbf;}
|
||||
input,textarea{-webkit-transition:border linear 0.2s,box-shadow linear 0.2s;-moz-transition:border linear 0.2s,box-shadow linear 0.2s;-ms-transition:border linear 0.2s,box-shadow linear 0.2s;-o-transition:border linear 0.2s,box-shadow linear 0.2s;transition:border linear 0.2s,box-shadow linear 0.2s;-webkit-box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.1);-moz-box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.1);box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.1);}
|
||||
input:focus,textarea:focus{outline:0;border-color:rgba(82, 168, 236, 0.8);-webkit-box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.1),0 0 8px rgba(82, 168, 236, 0.6);-moz-box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.1),0 0 8px rgba(82, 168, 236, 0.6);box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.1),0 0 8px rgba(82, 168, 236, 0.6);}
|
||||
input[type=file]:focus,input[type=checkbox]:focus,select:focus{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;outline:1px dotted #666;}
|
||||
form div.clearfix.error{background:#fae5e3;padding:10px 0;margin:-10px 0 10px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}form div.clearfix.error>label,form div.clearfix.error span.help-inline,form div.clearfix.error span.help-block{color:#9d261d;}
|
||||
form div.clearfix.error input,form div.clearfix.error textarea{border-color:#c87872;-webkit-box-shadow:0 0 3px rgba(171, 41, 32, 0.25);-moz-box-shadow:0 0 3px rgba(171, 41, 32, 0.25);box-shadow:0 0 3px rgba(171, 41, 32, 0.25);}form div.clearfix.error input:focus,form div.clearfix.error textarea:focus{border-color:#b9554d;-webkit-box-shadow:0 0 6px rgba(171, 41, 32, 0.5);-moz-box-shadow:0 0 6px rgba(171, 41, 32, 0.5);box-shadow:0 0 6px rgba(171, 41, 32, 0.5);}
|
||||
form div.clearfix.error .input-prepend span.add-on,form div.clearfix.error .input-append span.add-on{background:#f4c8c5;border-color:#c87872;color:#b9554d;}
|
||||
table{width:100%;margin-bottom:18px;padding:0;border-collapse:separate;*border-collapse:collapse;font-size:13px;border:1px solid #ddd;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}table th,table td{padding:10px 10px 9px;line-height:18px;text-align:left;}
|
||||
table th{padding-top:9px;font-weight:bold;vertical-align:middle;border-bottom:1px solid #ddd;}
|
||||
table td{vertical-align:top;}
|
||||
table th+th,table td+td{border-left:1px solid #ddd;}
|
||||
table tr+tr td{border-top:1px solid #ddd;}
|
||||
table tbody tr:first-child td:first-child{-webkit-border-radius:4px 0 0 0;-moz-border-radius:4px 0 0 0;border-radius:4px 0 0 0;}
|
||||
table tbody tr:first-child td:last-child{-webkit-border-radius:0 4px 0 0;-moz-border-radius:0 4px 0 0;border-radius:0 4px 0 0;}
|
||||
table tbody tr:last-child td:first-child{-webkit-border-radius:0 0 0 4px;-moz-border-radius:0 0 0 4px;border-radius:0 0 0 4px;}
|
||||
table tbody tr:last-child td:last-child{-webkit-border-radius:0 0 4px 0;-moz-border-radius:0 0 4px 0;border-radius:0 0 4px 0;}
|
||||
.zebra-striped tbody tr:nth-child(odd) td{background-color:#f9f9f9;}
|
||||
.zebra-striped tbody tr:hover td{background-color:#f5f5f5;}
|
||||
.zebra-striped .header{cursor:pointer;}.zebra-striped .header:after{content:"";float:right;margin-top:7px;border-width:0 4px 4px;border-style:solid;border-color:#000 transparent;visibility:hidden;}
|
||||
.zebra-striped .header:hover:after{visibility:visible;}
|
||||
footer{margin-top:17px;padding-top:17px;border-top:1px solid #eee;}
|
||||
.page-header{margin-bottom:17px;border-bottom:1px solid #ddd;-webkit-box-shadow:0 1px 0 rgba(255, 255, 255, 0.5);-moz-box-shadow:0 1px 0 rgba(255, 255, 255, 0.5);box-shadow:0 1px 0 rgba(255, 255, 255, 0.5);}.page-header h1{margin-bottom:8px;}
|
||||
.close{float:right;color:#000000;font-size:20px;font-weight:bold;line-height:13.5px;text-shadow:0 1px 0 #ffffff;filter:alpha(opacity=20);-khtml-opacity:0.2;-moz-opacity:0.2;opacity:0.2;}.close:hover{color:#000000;text-decoration:none;filter:alpha(opacity=40);-khtml-opacity:0.4;-moz-opacity:0.4;opacity:0.4;}
|
||||
|
||||
pre {
|
||||
padding: 0;
|
||||
margin: 10px 0px 10px;
|
||||
overflow: auto; /*--If the Code exceeds the width, a scrolling is available--*/
|
||||
overflow-Y: hidden; /*--Hides vertical scroll created by IE--*/
|
||||
}
|
||||
pre code {
|
||||
margin: 5px; /*--Left Margin--*/
|
||||
padding: 0px;
|
||||
display: block;
|
||||
line-height: 18px;
|
||||
}
|
||||
.center { text-align:center}
|
||||
.left {text-align:left}
|
||||
.right {text-align:right}
|
||||
|
||||
</style><style type="text/css">
|
||||
body {
|
||||
font-family: "Geneva", Arial, sans-serif;
|
||||
font-size: 13px;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
a, a:visited {
|
||||
color: #09c;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: #336699;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
h1 {
|
||||
margin: 0px 0px 10px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
h2 {
|
||||
border-bottom: 2px dotted #ccc;
|
||||
margin: 5px 0px 15px;
|
||||
}
|
||||
|
||||
h6 {
|
||||
color: #09c;
|
||||
}
|
||||
|
||||
blockquote {
|
||||
font-family: "Georgia", Courier New, courier, sans-serif;
|
||||
background: #efefef;
|
||||
padding: 5px 10px;
|
||||
border: solid 1px #ddd;
|
||||
margin: 15px;
|
||||
-webkit-border-radius:6px;
|
||||
-moz-border-radius:6px;
|
||||
border-radius:6px;
|
||||
color: #333;
|
||||
|
||||
}
|
||||
|
||||
ul, ol {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
li {
|
||||
padding: 3px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
code {
|
||||
background-color: #f1f1f1;
|
||||
color: #336699;
|
||||
}
|
||||
|
||||
pre {
|
||||
background-color: #f1f1f1;
|
||||
}
|
||||
|
||||
pre > code {
|
||||
margin: 0px;
|
||||
padding: 5px;
|
||||
border: 0px;
|
||||
background-color: #f1f1f1;
|
||||
}
|
||||
|
||||
|
||||
</style></head>
|
||||
<body>
|
||||
<h1>MPI/Examples : exMPI01</h1>
|
||||
|
||||
<h2>Description</h2>
|
||||
|
||||
<p>A simple application</p>
|
||||
|
||||
<h3>Configuration:</h3>
|
||||
|
||||
<ul>
|
||||
<li>Geometry : chamber / calorimeter</li>
|
||||
<li>Primary : particle gun (200 MeV electron as default)</li>
|
||||
<li>Physics List : FTFP_BERT</li>
|
||||
</ul>
|
||||
|
||||
<h3>Features:</h3>
|
||||
|
||||
<ul>
|
||||
<li>Particles are transported in a geometry without any scoring.</li>
|
||||
<li>Learn how to parallelized your G4 session.</li>
|
||||
</ul>
|
||||
|
||||
<h2>How to build</h2>
|
||||
|
||||
<p>Use CMake on Geant4 library installed with CMake build.</p>
|
||||
|
||||
<p>This example requires G4mpi library to be installed
|
||||
(see examples/extended/parallel/MPI/source/REDME.md)</p>
|
||||
|
||||
<p>Follow these commands,</p>
|
||||
|
||||
|
||||
<pre><code>> mkdir build
|
||||
> cd build
|
||||
> cmake -DG4mpi_DIR=<where-G4mpi-wasintalled >/lib[64]/G4mpi -DCMAKE_CXX_COMPILER=mpicxx \
|
||||
-DGeant4_DIR=<your Geant4 install path
|
||||
>/lib[64]/Geant4-V.m.n <path-to-source><
|
||||
(V.m.n is the version of Geant4, eg. Geant4-9.6.0)
|
||||
> make<
|
||||
> make install
|
||||
</code></pre>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,37 @@
|
||||
MPI/Examples : exMPI01
|
||||
======================
|
||||
|
||||
Description
|
||||
-----------
|
||||
A simple application
|
||||
|
||||
### Configuration:
|
||||
|
||||
- Geometry : chamber / calorimeter
|
||||
- Primary : particle gun (200 MeV electron as default)
|
||||
- Physics List : FTFP_BERT
|
||||
|
||||
### Features:
|
||||
|
||||
- Particles are transported in a geometry without any scoring.
|
||||
- Learn how to parallelized your G4 session.
|
||||
|
||||
|
||||
How to build
|
||||
------------
|
||||
Use CMake on Geant4 library installed with CMake build.
|
||||
|
||||
This example requires G4mpi library to be installed
|
||||
(see examples/extended/parallel/MPI/source/REDME.md)
|
||||
|
||||
Follow these commands,
|
||||
|
||||
> mkdir build
|
||||
> cd build
|
||||
> cmake -DG4mpi_DIR=<where-G4mpi-wasintalled>/lib[64]/G4mpi -DCMAKE_CXX_COMPILER=mpicxx \
|
||||
-DGeant4_DIR=<your Geant4 install path>/lib[64]/Geant4-V.m.n <path-to-source>
|
||||
(V.m.n is the version of Geant4, eg. Geant4-9.6.0)
|
||||
> make
|
||||
> make install
|
||||
|
||||
Replace mpicxx with your MPI-compiler wrapper.
|
||||
@@ -0,0 +1,50 @@
|
||||
/// @file "MPI/examples/exMPI02/.README.txt"
|
||||
/// @brief Example exMPI02 README
|
||||
|
||||
/*! \page exMPI02 Example : exMPI02
|
||||
|
||||
|
||||
Description
|
||||
===========
|
||||
An example of dosimetry in a water phantom.
|
||||
|
||||
### Configuration:
|
||||
- Geometry : water phantom
|
||||
- Primary : broad beam (200 MeV proton)
|
||||
- Physics List : FTFP_BERT
|
||||
- Analysis : ROOT histogramming
|
||||
|
||||
The environment variables, *G4LEDATA*, *G4LEVELGAMMADATA* and *G4SAIDXSDATA*
|
||||
are required for data files.
|
||||
|
||||
The enviromnet variable, *ROOTSYS*, is set to the root path of the ROOT package.
|
||||
|
||||
### Features:
|
||||
- Score dose distribution in a water phantom.
|
||||
- Learn how to paralleized your applications.
|
||||
- Create a ROOT file containing histograms/trees in each node.
|
||||
Each slave node generate a ROOT file, whose file name is different
|
||||
from each other.
|
||||
|
||||
- - -
|
||||
|
||||
How to build
|
||||
============
|
||||
Use CMake on Geant4 library installed with CMake build.
|
||||
|
||||
This example requires G4mpi library to be installed
|
||||
(see examples/extended/parallel/MPI/source/REDME.md)
|
||||
|
||||
Follow these commands,
|
||||
|
||||
> mkdir build
|
||||
> cd build
|
||||
> cmake -DG4mpi_DIR=<where-G4mpi-wasintalled>/lib[64]/G4mpi -DCMAKE_CXX_COMPILER=mpicxx \
|
||||
-DGeant4_DIR=<your Geant4 install path>/lib[64]/Geant4-V.m.n <path-to-source>
|
||||
(V.m.n is the version of Geant4, eg. Geant4-9.6.0)
|
||||
> make
|
||||
> make install
|
||||
|
||||
Replace mpicxx with your MPI-compiler wrapper.
|
||||
|
||||
*/
|
||||
@@ -0,0 +1,246 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="generated-by" content="Markdown PRO, http://markdownpro.com"/>
|
||||
<title></title>
|
||||
<style type="text/css">
|
||||
html,body{margin:0;padding:0;}
|
||||
body {padding: 20px}
|
||||
h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,cite,code,del,dfn,em,img,q,s,samp,small,strike,strong,sub,sup,tt,var,dd,dl,dt,li,ol,ul,fieldset,form,label,legend,button,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;font-weight:normal;font-style:normal;font-size:100%;line-height:1;font-family:inherit;}
|
||||
table{border-collapse:collapse;border-spacing:0;}
|
||||
ol,ul{list-style:none;}
|
||||
q:before,q:after,blockquote:before,blockquote:after{content:"";}
|
||||
html{overflow-y:scroll;font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;}
|
||||
a:focus{outline:thin dotted;}
|
||||
a:hover,a:active{outline:0;}
|
||||
article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block;}
|
||||
audio,canvas,video{display:inline-block;*display:inline;*zoom:1;}
|
||||
audio:not([controls]){display:none;}
|
||||
sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline;}
|
||||
sup{top:-0.5em;}
|
||||
sub{bottom:-0.25em;}
|
||||
img{border:0;-ms-interpolation-mode:bicubic;}
|
||||
button,input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle;}
|
||||
button,input{line-height:normal;*overflow:visible;}
|
||||
button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}
|
||||
button,input[type="button"],input[type="reset"],input[type="submit"]{cursor:pointer;-webkit-appearance:button;}
|
||||
input[type="search"]{-webkit-appearance:textfield;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;}
|
||||
input[type="search"]::-webkit-search-decoration{-webkit-appearance:none;}
|
||||
textarea{overflow:auto;vertical-align:top;}
|
||||
html,body{background-color:#ffffff;}
|
||||
body{margin:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;font-weight:normal;line-height:18px;color:#404040;}
|
||||
.container{width:940px;margin-left:auto;margin-right:auto;zoom:1;}.container:before,.container:after{display:table;content:"";zoom:1;*display:inline;}
|
||||
.container:after{clear:both;}
|
||||
.container-fluid{position:relative;min-width:940px;padding-left:20px;padding-right:20px;zoom:1;}.container-fluid:before,.container-fluid:after{display:table;content:"";zoom:1;*display:inline;}
|
||||
.container-fluid:after{clear:both;}
|
||||
.container-fluid>.sidebar{float:left;width:220px;}
|
||||
.container-fluid>.content{margin-left:240px;}
|
||||
a{color:#0069d6;text-decoration:none;line-height:inherit;font-weight:inherit;}a:hover{color:#00438a;text-decoration:underline;}
|
||||
.pull-right{float:right;}
|
||||
.pull-left{float:left;}
|
||||
.hide{display:none;}
|
||||
.show{display:block;}
|
||||
.row{zoom:1;margin-left:-20px;}.row:before,.row:after{display:table;content:"";zoom:1;*display:inline;}
|
||||
.row:after{clear:both;}
|
||||
p{font-size:13px;font-weight:normal;line-height:18px;margin-bottom:9px;}p small{font-size:11px;color:#bfbfbf;}
|
||||
h1,h2,h3,h4,h5,h6{font-weight:bold;color:#404040;}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small{color:#bfbfbf;}
|
||||
h1{margin-bottom:18px;font-size:30px;line-height:36px;}h1 small{font-size:18px;}
|
||||
h2{font-size:24px;line-height:36px;}h2 small{font-size:14px;}
|
||||
h3,h4,h5,h6{line-height:36px;}
|
||||
h3{font-size:18px;}h3 small{font-size:14px;}
|
||||
h4{font-size:16px;}h4 small{font-size:12px;}
|
||||
h5{font-size:14px;}
|
||||
h6{font-size:13px;color:#bfbfbf;text-transform:uppercase;}
|
||||
ul,ol{margin:0 0 18px 25px;}
|
||||
ul ul,ul ol,ol ol,ol ul{margin-bottom:0;}
|
||||
ul{list-style:disc;}
|
||||
ol{list-style:decimal;}
|
||||
li{line-height:18px;color:#808080;}
|
||||
ul.unstyled{list-style:none;margin-left:0;}
|
||||
dl{margin-bottom:18px;}dl dt,dl dd{line-height:18px;}
|
||||
dl dt{font-weight:bold;}
|
||||
dl dd{margin-left:9px;}
|
||||
hr{margin:20px 0 19px;border:0;border-bottom:1px solid #eee;}
|
||||
strong{font-style:inherit;font-weight:bold;}
|
||||
em{font-style:italic;font-weight:inherit;line-height:inherit;}
|
||||
.muted{color:#bfbfbf;}
|
||||
blockquote{margin-bottom:18px;border-left:5px solid #eee;padding-left:15px;}blockquote p{font-size:14px;font-weight:300;line-height:18px;margin-bottom:0;}
|
||||
blockquote small{display:block;font-size:12px;font-weight:300;line-height:18px;color:#bfbfbf;}blockquote small:before{content:'\2014 \00A0';}
|
||||
address{display:block;line-height:18px;margin-bottom:18px;}
|
||||
code,pre{padding:0 3px 2px;font-family:Monaco, Andale Mono, Courier New, monospace;font-size:12px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;}
|
||||
code{padding:1px 3px;}
|
||||
pre{background-color:#f5f5f5;display:block;padding:8.5px;margin:0 0 18px;line-height:18px;font-size:12px;border:1px solid #ccc;border:1px solid rgba(0, 0, 0, 0.15);-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;white-space:pre;white-space:pre-wrap;word-wrap:break-word;}
|
||||
form{margin-bottom:18px;}
|
||||
fieldset{margin-bottom:18px;padding-top:18px;}fieldset legend{display:block;padding-left:150px;font-size:19.5px;line-height:1;color:#404040;*padding:0 0 5px 145px;*line-height:1.5;}
|
||||
form .clearfix{margin-bottom:18px;zoom:1;}form .clearfix:before,form .clearfix:after{display:table;content:"";zoom:1;*display:inline;}
|
||||
form .clearfix:after{clear:both;}
|
||||
label,input,select,textarea{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;font-weight:normal;line-height:normal;}
|
||||
label{padding-top:6px;font-size:13px;line-height:18px;float:left;width:130px;text-align:right;color:#404040;}
|
||||
form .input{margin-left:150px;}
|
||||
input[type=checkbox],input[type=radio]{cursor:pointer;}
|
||||
input,textarea,select,.uneditable-input{display:inline-block;width:210px;height:18px;padding:4px;font-size:13px;line-height:18px;color:#808080;border:1px solid #ccc;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;}
|
||||
input[type=checkbox],input[type=radio]{width:auto;height:auto;padding:0;margin:3px 0;*margin-top:0;line-height:normal;border:none;}
|
||||
input[type=file]{background-color:#ffffff;padding:initial;border:initial;line-height:initial;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;}
|
||||
input[type=button],input[type=reset],input[type=submit]{width:auto;height:auto;}
|
||||
select,input[type=file]{height:27px;line-height:27px;*margin-top:4px;}
|
||||
select[multiple]{height:inherit;}
|
||||
textarea{height:auto;}
|
||||
.uneditable-input{background-color:#ffffff;display:block;border-color:#eee;-webkit-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);-moz-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);cursor:not-allowed;}
|
||||
:-moz-placeholder{color:#bfbfbf;}
|
||||
::-webkit-input-placeholder{color:#bfbfbf;}
|
||||
input,textarea{-webkit-transition:border linear 0.2s,box-shadow linear 0.2s;-moz-transition:border linear 0.2s,box-shadow linear 0.2s;-ms-transition:border linear 0.2s,box-shadow linear 0.2s;-o-transition:border linear 0.2s,box-shadow linear 0.2s;transition:border linear 0.2s,box-shadow linear 0.2s;-webkit-box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.1);-moz-box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.1);box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.1);}
|
||||
input:focus,textarea:focus{outline:0;border-color:rgba(82, 168, 236, 0.8);-webkit-box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.1),0 0 8px rgba(82, 168, 236, 0.6);-moz-box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.1),0 0 8px rgba(82, 168, 236, 0.6);box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.1),0 0 8px rgba(82, 168, 236, 0.6);}
|
||||
input[type=file]:focus,input[type=checkbox]:focus,select:focus{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;outline:1px dotted #666;}
|
||||
form div.clearfix.error{background:#fae5e3;padding:10px 0;margin:-10px 0 10px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}form div.clearfix.error>label,form div.clearfix.error span.help-inline,form div.clearfix.error span.help-block{color:#9d261d;}
|
||||
form div.clearfix.error input,form div.clearfix.error textarea{border-color:#c87872;-webkit-box-shadow:0 0 3px rgba(171, 41, 32, 0.25);-moz-box-shadow:0 0 3px rgba(171, 41, 32, 0.25);box-shadow:0 0 3px rgba(171, 41, 32, 0.25);}form div.clearfix.error input:focus,form div.clearfix.error textarea:focus{border-color:#b9554d;-webkit-box-shadow:0 0 6px rgba(171, 41, 32, 0.5);-moz-box-shadow:0 0 6px rgba(171, 41, 32, 0.5);box-shadow:0 0 6px rgba(171, 41, 32, 0.5);}
|
||||
form div.clearfix.error .input-prepend span.add-on,form div.clearfix.error .input-append span.add-on{background:#f4c8c5;border-color:#c87872;color:#b9554d;}
|
||||
table{width:100%;margin-bottom:18px;padding:0;border-collapse:separate;*border-collapse:collapse;font-size:13px;border:1px solid #ddd;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}table th,table td{padding:10px 10px 9px;line-height:18px;text-align:left;}
|
||||
table th{padding-top:9px;font-weight:bold;vertical-align:middle;border-bottom:1px solid #ddd;}
|
||||
table td{vertical-align:top;}
|
||||
table th+th,table td+td{border-left:1px solid #ddd;}
|
||||
table tr+tr td{border-top:1px solid #ddd;}
|
||||
table tbody tr:first-child td:first-child{-webkit-border-radius:4px 0 0 0;-moz-border-radius:4px 0 0 0;border-radius:4px 0 0 0;}
|
||||
table tbody tr:first-child td:last-child{-webkit-border-radius:0 4px 0 0;-moz-border-radius:0 4px 0 0;border-radius:0 4px 0 0;}
|
||||
table tbody tr:last-child td:first-child{-webkit-border-radius:0 0 0 4px;-moz-border-radius:0 0 0 4px;border-radius:0 0 0 4px;}
|
||||
table tbody tr:last-child td:last-child{-webkit-border-radius:0 0 4px 0;-moz-border-radius:0 0 4px 0;border-radius:0 0 4px 0;}
|
||||
.zebra-striped tbody tr:nth-child(odd) td{background-color:#f9f9f9;}
|
||||
.zebra-striped tbody tr:hover td{background-color:#f5f5f5;}
|
||||
.zebra-striped .header{cursor:pointer;}.zebra-striped .header:after{content:"";float:right;margin-top:7px;border-width:0 4px 4px;border-style:solid;border-color:#000 transparent;visibility:hidden;}
|
||||
.zebra-striped .header:hover:after{visibility:visible;}
|
||||
footer{margin-top:17px;padding-top:17px;border-top:1px solid #eee;}
|
||||
.page-header{margin-bottom:17px;border-bottom:1px solid #ddd;-webkit-box-shadow:0 1px 0 rgba(255, 255, 255, 0.5);-moz-box-shadow:0 1px 0 rgba(255, 255, 255, 0.5);box-shadow:0 1px 0 rgba(255, 255, 255, 0.5);}.page-header h1{margin-bottom:8px;}
|
||||
.close{float:right;color:#000000;font-size:20px;font-weight:bold;line-height:13.5px;text-shadow:0 1px 0 #ffffff;filter:alpha(opacity=20);-khtml-opacity:0.2;-moz-opacity:0.2;opacity:0.2;}.close:hover{color:#000000;text-decoration:none;filter:alpha(opacity=40);-khtml-opacity:0.4;-moz-opacity:0.4;opacity:0.4;}
|
||||
|
||||
pre {
|
||||
padding: 0;
|
||||
margin: 10px 0px 10px;
|
||||
overflow: auto; /*--If the Code exceeds the width, a scrolling is available--*/
|
||||
overflow-Y: hidden; /*--Hides vertical scroll created by IE--*/
|
||||
}
|
||||
pre code {
|
||||
margin: 5px; /*--Left Margin--*/
|
||||
padding: 0px;
|
||||
display: block;
|
||||
line-height: 18px;
|
||||
}
|
||||
.center { text-align:center}
|
||||
.left {text-align:left}
|
||||
.right {text-align:right}
|
||||
|
||||
</style><style type="text/css">
|
||||
body{font-size:14px;line-height:1.6;font-family: Helvetica, arial, freesans, clean, sans-serif;padding: 20px;}
|
||||
body>*:first-child{margin-top:0!important;}
|
||||
body>*:last-child{margin-bottom:0!important;}
|
||||
body a:active {outline: none;}
|
||||
body a:hover {text-decoration: underline;}
|
||||
body a {color: #4183C4;text-decoration: none;}
|
||||
body a.absent{color:#c00;}
|
||||
body h1, body h2, h3, h4, h5, h6{margin:20px 0 10px;padding:0;font-weight:bold;-webkit-font-smoothing:antialiased;}
|
||||
body h1 tt, h1 code, h2 tt, h2 code, h3 tt, h3 code, h4 tt, h4 code, h5 tt, h5 code, h6 tt, h6 code{font-size:inherit;}
|
||||
body h1{font-size:28px;color:#000;}
|
||||
body h2{font-size:24px;border-bottom:1px solid #ccc;color:#000;}
|
||||
body h3{font-size:18px;}
|
||||
body h4{font-size:16px;}
|
||||
body h5{font-size:14px;}
|
||||
body h6{color:#777;font-size:14px;}
|
||||
body p, blockquote, ul, ol, dl, li, table, pre{margin:15px 0;}
|
||||
body hr{background:transparent url('../../images/modules/pulls/dirty-shade.png') repeat-x 0 0;border:0 none;color:#ccc;height:4px;padding:0;}
|
||||
body>h2:first-child,>h1:first-child,>h1:first-child+h2,>h3:first-child,>h4:first-child,>h5:first-child,>h6:first-child{margin-top:0;padding-top:0;}
|
||||
body h1+p, h2+p, h3+p, h4+p, h5+p, h6+p{margin-top:0;}
|
||||
body li p.first{display:inline-block;}
|
||||
body ul, ol{padding-left:30px;}
|
||||
body ul li>:first-child, ol li>:first-child{margin-top:0;}
|
||||
body ul li>:last-child, ol li>:last-child{margin-bottom:0;}
|
||||
body dl{padding:0;}
|
||||
body dl dt{font-size:14px;font-weight:bold;font-style:italic;padding:0;margin:15px 0 5px;}
|
||||
body dl dt:first-child{padding:0;}
|
||||
body dl dt>:first-child{margin-top:0;}
|
||||
body dl dt>:last-child{margin-bottom:0;}
|
||||
body dl dd{margin:0 0 15px;padding:0 15px;}
|
||||
body dl dd>:first-child{margin-top:0;}
|
||||
body dl dd>:last-child{margin-bottom:0;}
|
||||
body blockquote{border-left:4px solid #DDD;padding:0 15px;color:#777;}
|
||||
body blockquote>:first-child{margin-top:0;}
|
||||
body blockquote>:last-child{margin-bottom:0;}
|
||||
body table{padding:0;}
|
||||
body table tr{border-top:1px solid #ccc;background-color:#fff;margin:0;padding:0;}
|
||||
body table tr:nth-child(2n){background-color:#f8f8f8;}
|
||||
body table tr th{font-weight:bold;}
|
||||
body table tr th, table tr td{border:1px solid #ccc;text-align:left;margin:0;padding:6px 13px;}
|
||||
body table tr th>:first-child, table tr td>:first-child{margin-top:0;}
|
||||
body table tr th>:last-child, table tr td>:last-child{margin-bottom:0;}
|
||||
body img{max-width:100%;}
|
||||
body span.frame{display:block;overflow:hidden;}
|
||||
body span.frame>span{border:1px solid #ddd;display:block;float:left;overflow:hidden;margin:13px 0 0;padding:7px;width:auto;}
|
||||
body span.frame span img{display:block;float:left;}
|
||||
body span.frame span span{clear:both;color:#333;display:block;padding:5px 0 0;}
|
||||
body span.align-center{display:block;overflow:hidden;clear:both;}
|
||||
body span.align-center>span{display:block;overflow:hidden;margin:13px auto 0;text-align:center;}
|
||||
body span.align-center span img{margin:0 auto;text-align:center;}
|
||||
body span.align-right{display:block;overflow:hidden;clear:both;}
|
||||
body span.align-right>span{display:block;overflow:hidden;margin:13px 0 0;text-align:right;}
|
||||
body span.align-right span img{margin:0;text-align:right;}
|
||||
body span.float-left{display:block;margin-right:13px;overflow:hidden;float:left;}
|
||||
body span.float-left span{margin:13px 0 0;}
|
||||
body span.float-right{display:block;margin-left:13px;overflow:hidden;float:right;}
|
||||
body span.float-right>span{display:block;overflow:hidden;margin:13px auto 0;text-align:right;}
|
||||
body code, tt{margin:0 2px;padding:0 5px;white-space:nowrap;border:1px solid #eaeaea;background-color:#f8f8f8;border-radius:3px;}
|
||||
body pre>code{margin:0;padding:0;white-space:pre;border:none;background:transparent;}
|
||||
body .highlight pre, pre{background-color:#f8f8f8;border:1px solid #ccc;font-size:13px;line-height:19px;overflow:auto;padding:6px 10px;border-radius:3px;}
|
||||
body pre code, pre tt{background-color:transparent;border:none;}
|
||||
</style></head>
|
||||
<body>
|
||||
<h1>MPI/Examples : exMPI02</h1>
|
||||
|
||||
<h2>Description</h2>
|
||||
|
||||
<p>An example of dosimetry in a water phantom.</p>
|
||||
|
||||
<h3>Configuration:</h3>
|
||||
|
||||
<ul>
|
||||
<li>Geometry : water phantom</li>
|
||||
<li>Primary : broad beam (200 MeV proton)</li>
|
||||
<li>Physics List : FTFP_BERT</li>
|
||||
<li>Analysis : ROOT histogramming</li>
|
||||
</ul>
|
||||
|
||||
<p>The environment variables, <em>G4LEDATA</em>, <em>G4LEVELGAMMADATA</em> and <em>G4SAIDXSDATA</em>
|
||||
are required for data files.</p>
|
||||
|
||||
<p>The enviromnet variable, <em>ROOTSYS</em>, is set to the root path of the ROOT package.</p>
|
||||
|
||||
<h3>Features:</h3>
|
||||
|
||||
<ul>
|
||||
<li>Score dose distribution in a water phantom.</li>
|
||||
<li>Learn how to paralleized your applications.</li>
|
||||
<li>Create a ROOT file containing histograms/trees in each node.
|
||||
Each slave node generate a ROOT file, whose file name is different
|
||||
from each other.</li>
|
||||
</ul>
|
||||
|
||||
<h2>How to build</h2>
|
||||
|
||||
<p>Use CMake on Geant4 library installed with CMake build.</p>
|
||||
|
||||
<p>This example requires G4mpi library to be installed
|
||||
(see examples/extended/parallel/MPI/source/REDME.md)</p>
|
||||
|
||||
<p>Follow these commands,</p>
|
||||
|
||||
|
||||
<pre><code>> mkdir build
|
||||
> cd build
|
||||
> cmake -DG4mpi_DIR=<where-G4mpi-wasintalled >/lib[64]/G4mpi -DCMAKE_CXX_COMPILER=mpicxx \
|
||||
-DGeant4_DIR=<your Geant4 install path
|
||||
>/lib[64]/Geant4-V.m.n <path-to-source><
|
||||
(V.m.n is the version of Geant4, eg. Geant4-9.6.0)
|
||||
> make<
|
||||
> make install
|
||||
</code></pre>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,44 @@
|
||||
MPI/Examples : exMPI02
|
||||
======================
|
||||
|
||||
Description
|
||||
-----------
|
||||
An example of dosimetry in a water phantom.
|
||||
|
||||
### Configuration:
|
||||
- Geometry : water phantom
|
||||
- Primary : broad beam (200 MeV proton)
|
||||
- Physics List : FTFP_BERT
|
||||
- Analysis : ROOT histogramming
|
||||
|
||||
The environment variables, *G4LEDATA*, *G4LEVELGAMMADATA* and *G4SAIDXSDATA*
|
||||
are required for data files.
|
||||
|
||||
The enviromnet variable, *ROOTSYS*, is set to the root path of the ROOT package.
|
||||
|
||||
### Features:
|
||||
- Score dose distribution in a water phantom.
|
||||
- Learn how to paralleized your applications.
|
||||
- Create a ROOT file containing histograms/trees in each node.
|
||||
Each slave node generate a ROOT file, whose file name is different
|
||||
from each other.
|
||||
|
||||
|
||||
How to build
|
||||
------------
|
||||
Use CMake on Geant4 library installed with CMake build.
|
||||
|
||||
This example requires G4mpi library to be installed
|
||||
(see examples/extended/parallel/MPI/source/REDME.md)
|
||||
|
||||
Follow these commands,
|
||||
|
||||
> mkdir build
|
||||
> cd build
|
||||
> cmake -DG4mpi_DIR=<where-G4mpi-wasintalled>/lib[64]/G4mpi -DCMAKE_CXX_COMPILER=mpicxx \
|
||||
-DGeant4_DIR=<your Geant4 install path>/lib[64]/Geant4-V.m.n <path-to-source>
|
||||
(V.m.n is the version of Geant4, eg. Geant4-9.6.0)
|
||||
> make
|
||||
> make install
|
||||
|
||||
Replace mpicxx with your MPI-compiler wrapper.
|
||||
@@ -0,0 +1,59 @@
|
||||
/// @file "MPI/examples/exMPI03/.README.txt"
|
||||
/// @brief Example exMPI03 README
|
||||
|
||||
/*! \page exMPI03 Example : exMPI03
|
||||
|
||||
|
||||
Description
|
||||
===========
|
||||
An example of dosimetry in a water phantom.
|
||||
The example has same geometry and physics as exMPI02, only the analysis part
|
||||
is diffenrent.
|
||||
|
||||
### Configuration:
|
||||
- Geometry : water phantom
|
||||
- Primary : broad beam (200 MeV proton)
|
||||
- Physics List : FTFP_BERT
|
||||
- Analysis : g4tools histogramming
|
||||
|
||||
The environment variables, *G4LEDATA*, *G4LEVELGAMMADATA* and *G4SAIDXSDATA*
|
||||
are required for data files.
|
||||
|
||||
### Features:
|
||||
- Score dose distribution in a water phantom.
|
||||
- Learn how to paralleized your applications.
|
||||
- Create a ROOT file containing histograms/trees in each node.
|
||||
Each slave node generate a ROOT file, whose file name is different
|
||||
from each other.
|
||||
- MT is enabled.
|
||||
- One of each object supported by g4tools is instantiated: 1D, 2D and 3D
|
||||
histograms and 1D and 2D profiles.
|
||||
- Histograms and profiles are merged first among threads of the same
|
||||
MPI-rank and then across MPI-ranks. See RunActionMaster class for
|
||||
an example on how to use the mergers.
|
||||
- G4Run object and scorers (command line ones) are also merged via
|
||||
MPI.
|
||||
- Output: several root files are created: dose-rank*.root thread-merged
|
||||
histograms for each rank; dose-merged.root, merged across threads and
|
||||
across ranks.
|
||||
|
||||
How to build
|
||||
============
|
||||
Use CMake on Geant4 library installed with CMake build.
|
||||
|
||||
This example requires G4mpi library to be installed
|
||||
(see examples/extended/parallel/MPI/source/REDME.md)
|
||||
|
||||
Follow these commands,
|
||||
|
||||
> mkdir build
|
||||
> cd build
|
||||
> cmake -DG4mpi_DIR=<where-G4mpi-wasintalled>/lib[64]/G4mpi -DCMAKE_CXX_COMPILER=mpicxx \
|
||||
-DGeant4_DIR=<your Geant4 install path>/lib[64]/Geant4-V.m.n <path-to-source>
|
||||
(V.m.n is the version of Geant4, eg. Geant4-9.6.0)
|
||||
> make
|
||||
> make install
|
||||
|
||||
Replace mpicxx with your MPI-compiler wrapper.
|
||||
|
||||
*/
|
||||
@@ -0,0 +1,255 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="generated-by" content="Markdown PRO, http://markdownpro.com"/>
|
||||
<title></title>
|
||||
<style type="text/css">
|
||||
html,body{margin:0;padding:0;}
|
||||
body {padding: 20px}
|
||||
h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,cite,code,del,dfn,em,img,q,s,samp,small,strike,strong,sub,sup,tt,var,dd,dl,dt,li,ol,ul,fieldset,form,label,legend,button,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;font-weight:normal;font-style:normal;font-size:100%;line-height:1;font-family:inherit;}
|
||||
table{border-collapse:collapse;border-spacing:0;}
|
||||
ol,ul{list-style:none;}
|
||||
q:before,q:after,blockquote:before,blockquote:after{content:"";}
|
||||
html{overflow-y:scroll;font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;}
|
||||
a:focus{outline:thin dotted;}
|
||||
a:hover,a:active{outline:0;}
|
||||
article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block;}
|
||||
audio,canvas,video{display:inline-block;*display:inline;*zoom:1;}
|
||||
audio:not([controls]){display:none;}
|
||||
sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline;}
|
||||
sup{top:-0.5em;}
|
||||
sub{bottom:-0.25em;}
|
||||
img{border:0;-ms-interpolation-mode:bicubic;}
|
||||
button,input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle;}
|
||||
button,input{line-height:normal;*overflow:visible;}
|
||||
button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}
|
||||
button,input[type="button"],input[type="reset"],input[type="submit"]{cursor:pointer;-webkit-appearance:button;}
|
||||
input[type="search"]{-webkit-appearance:textfield;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;}
|
||||
input[type="search"]::-webkit-search-decoration{-webkit-appearance:none;}
|
||||
textarea{overflow:auto;vertical-align:top;}
|
||||
html,body{background-color:#ffffff;}
|
||||
body{margin:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;font-weight:normal;line-height:18px;color:#404040;}
|
||||
.container{width:940px;margin-left:auto;margin-right:auto;zoom:1;}.container:before,.container:after{display:table;content:"";zoom:1;*display:inline;}
|
||||
.container:after{clear:both;}
|
||||
.container-fluid{position:relative;min-width:940px;padding-left:20px;padding-right:20px;zoom:1;}.container-fluid:before,.container-fluid:after{display:table;content:"";zoom:1;*display:inline;}
|
||||
.container-fluid:after{clear:both;}
|
||||
.container-fluid>.sidebar{float:left;width:220px;}
|
||||
.container-fluid>.content{margin-left:240px;}
|
||||
a{color:#0069d6;text-decoration:none;line-height:inherit;font-weight:inherit;}a:hover{color:#00438a;text-decoration:underline;}
|
||||
.pull-right{float:right;}
|
||||
.pull-left{float:left;}
|
||||
.hide{display:none;}
|
||||
.show{display:block;}
|
||||
.row{zoom:1;margin-left:-20px;}.row:before,.row:after{display:table;content:"";zoom:1;*display:inline;}
|
||||
.row:after{clear:both;}
|
||||
p{font-size:13px;font-weight:normal;line-height:18px;margin-bottom:9px;}p small{font-size:11px;color:#bfbfbf;}
|
||||
h1,h2,h3,h4,h5,h6{font-weight:bold;color:#404040;}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small{color:#bfbfbf;}
|
||||
h1{margin-bottom:18px;font-size:30px;line-height:36px;}h1 small{font-size:18px;}
|
||||
h2{font-size:24px;line-height:36px;}h2 small{font-size:14px;}
|
||||
h3,h4,h5,h6{line-height:36px;}
|
||||
h3{font-size:18px;}h3 small{font-size:14px;}
|
||||
h4{font-size:16px;}h4 small{font-size:12px;}
|
||||
h5{font-size:14px;}
|
||||
h6{font-size:13px;color:#bfbfbf;text-transform:uppercase;}
|
||||
ul,ol{margin:0 0 18px 25px;}
|
||||
ul ul,ul ol,ol ol,ol ul{margin-bottom:0;}
|
||||
ul{list-style:disc;}
|
||||
ol{list-style:decimal;}
|
||||
li{line-height:18px;color:#808080;}
|
||||
ul.unstyled{list-style:none;margin-left:0;}
|
||||
dl{margin-bottom:18px;}dl dt,dl dd{line-height:18px;}
|
||||
dl dt{font-weight:bold;}
|
||||
dl dd{margin-left:9px;}
|
||||
hr{margin:20px 0 19px;border:0;border-bottom:1px solid #eee;}
|
||||
strong{font-style:inherit;font-weight:bold;}
|
||||
em{font-style:italic;font-weight:inherit;line-height:inherit;}
|
||||
.muted{color:#bfbfbf;}
|
||||
blockquote{margin-bottom:18px;border-left:5px solid #eee;padding-left:15px;}blockquote p{font-size:14px;font-weight:300;line-height:18px;margin-bottom:0;}
|
||||
blockquote small{display:block;font-size:12px;font-weight:300;line-height:18px;color:#bfbfbf;}blockquote small:before{content:'\2014 \00A0';}
|
||||
address{display:block;line-height:18px;margin-bottom:18px;}
|
||||
code,pre{padding:0 3px 2px;font-family:Monaco, Andale Mono, Courier New, monospace;font-size:12px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;}
|
||||
code{padding:1px 3px;}
|
||||
pre{background-color:#f5f5f5;display:block;padding:8.5px;margin:0 0 18px;line-height:18px;font-size:12px;border:1px solid #ccc;border:1px solid rgba(0, 0, 0, 0.15);-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;white-space:pre;white-space:pre-wrap;word-wrap:break-word;}
|
||||
form{margin-bottom:18px;}
|
||||
fieldset{margin-bottom:18px;padding-top:18px;}fieldset legend{display:block;padding-left:150px;font-size:19.5px;line-height:1;color:#404040;*padding:0 0 5px 145px;*line-height:1.5;}
|
||||
form .clearfix{margin-bottom:18px;zoom:1;}form .clearfix:before,form .clearfix:after{display:table;content:"";zoom:1;*display:inline;}
|
||||
form .clearfix:after{clear:both;}
|
||||
label,input,select,textarea{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;font-weight:normal;line-height:normal;}
|
||||
label{padding-top:6px;font-size:13px;line-height:18px;float:left;width:130px;text-align:right;color:#404040;}
|
||||
form .input{margin-left:150px;}
|
||||
input[type=checkbox],input[type=radio]{cursor:pointer;}
|
||||
input,textarea,select,.uneditable-input{display:inline-block;width:210px;height:18px;padding:4px;font-size:13px;line-height:18px;color:#808080;border:1px solid #ccc;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;}
|
||||
input[type=checkbox],input[type=radio]{width:auto;height:auto;padding:0;margin:3px 0;*margin-top:0;line-height:normal;border:none;}
|
||||
input[type=file]{background-color:#ffffff;padding:initial;border:initial;line-height:initial;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;}
|
||||
input[type=button],input[type=reset],input[type=submit]{width:auto;height:auto;}
|
||||
select,input[type=file]{height:27px;line-height:27px;*margin-top:4px;}
|
||||
select[multiple]{height:inherit;}
|
||||
textarea{height:auto;}
|
||||
.uneditable-input{background-color:#ffffff;display:block;border-color:#eee;-webkit-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);-moz-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);cursor:not-allowed;}
|
||||
:-moz-placeholder{color:#bfbfbf;}
|
||||
::-webkit-input-placeholder{color:#bfbfbf;}
|
||||
input,textarea{-webkit-transition:border linear 0.2s,box-shadow linear 0.2s;-moz-transition:border linear 0.2s,box-shadow linear 0.2s;-ms-transition:border linear 0.2s,box-shadow linear 0.2s;-o-transition:border linear 0.2s,box-shadow linear 0.2s;transition:border linear 0.2s,box-shadow linear 0.2s;-webkit-box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.1);-moz-box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.1);box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.1);}
|
||||
input:focus,textarea:focus{outline:0;border-color:rgba(82, 168, 236, 0.8);-webkit-box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.1),0 0 8px rgba(82, 168, 236, 0.6);-moz-box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.1),0 0 8px rgba(82, 168, 236, 0.6);box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.1),0 0 8px rgba(82, 168, 236, 0.6);}
|
||||
input[type=file]:focus,input[type=checkbox]:focus,select:focus{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;outline:1px dotted #666;}
|
||||
form div.clearfix.error{background:#fae5e3;padding:10px 0;margin:-10px 0 10px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}form div.clearfix.error>label,form div.clearfix.error span.help-inline,form div.clearfix.error span.help-block{color:#9d261d;}
|
||||
form div.clearfix.error input,form div.clearfix.error textarea{border-color:#c87872;-webkit-box-shadow:0 0 3px rgba(171, 41, 32, 0.25);-moz-box-shadow:0 0 3px rgba(171, 41, 32, 0.25);box-shadow:0 0 3px rgba(171, 41, 32, 0.25);}form div.clearfix.error input:focus,form div.clearfix.error textarea:focus{border-color:#b9554d;-webkit-box-shadow:0 0 6px rgba(171, 41, 32, 0.5);-moz-box-shadow:0 0 6px rgba(171, 41, 32, 0.5);box-shadow:0 0 6px rgba(171, 41, 32, 0.5);}
|
||||
form div.clearfix.error .input-prepend span.add-on,form div.clearfix.error .input-append span.add-on{background:#f4c8c5;border-color:#c87872;color:#b9554d;}
|
||||
table{width:100%;margin-bottom:18px;padding:0;border-collapse:separate;*border-collapse:collapse;font-size:13px;border:1px solid #ddd;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}table th,table td{padding:10px 10px 9px;line-height:18px;text-align:left;}
|
||||
table th{padding-top:9px;font-weight:bold;vertical-align:middle;border-bottom:1px solid #ddd;}
|
||||
table td{vertical-align:top;}
|
||||
table th+th,table td+td{border-left:1px solid #ddd;}
|
||||
table tr+tr td{border-top:1px solid #ddd;}
|
||||
table tbody tr:first-child td:first-child{-webkit-border-radius:4px 0 0 0;-moz-border-radius:4px 0 0 0;border-radius:4px 0 0 0;}
|
||||
table tbody tr:first-child td:last-child{-webkit-border-radius:0 4px 0 0;-moz-border-radius:0 4px 0 0;border-radius:0 4px 0 0;}
|
||||
table tbody tr:last-child td:first-child{-webkit-border-radius:0 0 0 4px;-moz-border-radius:0 0 0 4px;border-radius:0 0 0 4px;}
|
||||
table tbody tr:last-child td:last-child{-webkit-border-radius:0 0 4px 0;-moz-border-radius:0 0 4px 0;border-radius:0 0 4px 0;}
|
||||
.zebra-striped tbody tr:nth-child(odd) td{background-color:#f9f9f9;}
|
||||
.zebra-striped tbody tr:hover td{background-color:#f5f5f5;}
|
||||
.zebra-striped .header{cursor:pointer;}.zebra-striped .header:after{content:"";float:right;margin-top:7px;border-width:0 4px 4px;border-style:solid;border-color:#000 transparent;visibility:hidden;}
|
||||
.zebra-striped .header:hover:after{visibility:visible;}
|
||||
footer{margin-top:17px;padding-top:17px;border-top:1px solid #eee;}
|
||||
.page-header{margin-bottom:17px;border-bottom:1px solid #ddd;-webkit-box-shadow:0 1px 0 rgba(255, 255, 255, 0.5);-moz-box-shadow:0 1px 0 rgba(255, 255, 255, 0.5);box-shadow:0 1px 0 rgba(255, 255, 255, 0.5);}.page-header h1{margin-bottom:8px;}
|
||||
.close{float:right;color:#000000;font-size:20px;font-weight:bold;line-height:13.5px;text-shadow:0 1px 0 #ffffff;filter:alpha(opacity=20);-khtml-opacity:0.2;-moz-opacity:0.2;opacity:0.2;}.close:hover{color:#000000;text-decoration:none;filter:alpha(opacity=40);-khtml-opacity:0.4;-moz-opacity:0.4;opacity:0.4;}
|
||||
|
||||
pre {
|
||||
padding: 0;
|
||||
margin: 10px 0px 10px;
|
||||
overflow: auto; /*--If the Code exceeds the width, a scrolling is available--*/
|
||||
overflow-Y: hidden; /*--Hides vertical scroll created by IE--*/
|
||||
}
|
||||
pre code {
|
||||
margin: 5px; /*--Left Margin--*/
|
||||
padding: 0px;
|
||||
display: block;
|
||||
line-height: 18px;
|
||||
}
|
||||
.center { text-align:center}
|
||||
.left {text-align:left}
|
||||
.right {text-align:right}
|
||||
|
||||
</style><style type="text/css">
|
||||
body{font-size:14px;line-height:1.6;font-family: Helvetica, arial, freesans, clean, sans-serif;padding: 20px;}
|
||||
body>*:first-child{margin-top:0!important;}
|
||||
body>*:last-child{margin-bottom:0!important;}
|
||||
body a:active {outline: none;}
|
||||
body a:hover {text-decoration: underline;}
|
||||
body a {color: #4183C4;text-decoration: none;}
|
||||
body a.absent{color:#c00;}
|
||||
body h1, body h2, h3, h4, h5, h6{margin:20px 0 10px;padding:0;font-weight:bold;-webkit-font-smoothing:antialiased;}
|
||||
body h1 tt, h1 code, h2 tt, h2 code, h3 tt, h3 code, h4 tt, h4 code, h5 tt, h5 code, h6 tt, h6 code{font-size:inherit;}
|
||||
body h1{font-size:28px;color:#000;}
|
||||
body h2{font-size:24px;border-bottom:1px solid #ccc;color:#000;}
|
||||
body h3{font-size:18px;}
|
||||
body h4{font-size:16px;}
|
||||
body h5{font-size:14px;}
|
||||
body h6{color:#777;font-size:14px;}
|
||||
body p, blockquote, ul, ol, dl, li, table, pre{margin:15px 0;}
|
||||
body hr{background:transparent url('../../images/modules/pulls/dirty-shade.png') repeat-x 0 0;border:0 none;color:#ccc;height:4px;padding:0;}
|
||||
body>h2:first-child,>h1:first-child,>h1:first-child+h2,>h3:first-child,>h4:first-child,>h5:first-child,>h6:first-child{margin-top:0;padding-top:0;}
|
||||
body h1+p, h2+p, h3+p, h4+p, h5+p, h6+p{margin-top:0;}
|
||||
body li p.first{display:inline-block;}
|
||||
body ul, ol{padding-left:30px;}
|
||||
body ul li>:first-child, ol li>:first-child{margin-top:0;}
|
||||
body ul li>:last-child, ol li>:last-child{margin-bottom:0;}
|
||||
body dl{padding:0;}
|
||||
body dl dt{font-size:14px;font-weight:bold;font-style:italic;padding:0;margin:15px 0 5px;}
|
||||
body dl dt:first-child{padding:0;}
|
||||
body dl dt>:first-child{margin-top:0;}
|
||||
body dl dt>:last-child{margin-bottom:0;}
|
||||
body dl dd{margin:0 0 15px;padding:0 15px;}
|
||||
body dl dd>:first-child{margin-top:0;}
|
||||
body dl dd>:last-child{margin-bottom:0;}
|
||||
body blockquote{border-left:4px solid #DDD;padding:0 15px;color:#777;}
|
||||
body blockquote>:first-child{margin-top:0;}
|
||||
body blockquote>:last-child{margin-bottom:0;}
|
||||
body table{padding:0;}
|
||||
body table tr{border-top:1px solid #ccc;background-color:#fff;margin:0;padding:0;}
|
||||
body table tr:nth-child(2n){background-color:#f8f8f8;}
|
||||
body table tr th{font-weight:bold;}
|
||||
body table tr th, table tr td{border:1px solid #ccc;text-align:left;margin:0;padding:6px 13px;}
|
||||
body table tr th>:first-child, table tr td>:first-child{margin-top:0;}
|
||||
body table tr th>:last-child, table tr td>:last-child{margin-bottom:0;}
|
||||
body img{max-width:100%;}
|
||||
body span.frame{display:block;overflow:hidden;}
|
||||
body span.frame>span{border:1px solid #ddd;display:block;float:left;overflow:hidden;margin:13px 0 0;padding:7px;width:auto;}
|
||||
body span.frame span img{display:block;float:left;}
|
||||
body span.frame span span{clear:both;color:#333;display:block;padding:5px 0 0;}
|
||||
body span.align-center{display:block;overflow:hidden;clear:both;}
|
||||
body span.align-center>span{display:block;overflow:hidden;margin:13px auto 0;text-align:center;}
|
||||
body span.align-center span img{margin:0 auto;text-align:center;}
|
||||
body span.align-right{display:block;overflow:hidden;clear:both;}
|
||||
body span.align-right>span{display:block;overflow:hidden;margin:13px 0 0;text-align:right;}
|
||||
body span.align-right span img{margin:0;text-align:right;}
|
||||
body span.float-left{display:block;margin-right:13px;overflow:hidden;float:left;}
|
||||
body span.float-left span{margin:13px 0 0;}
|
||||
body span.float-right{display:block;margin-left:13px;overflow:hidden;float:right;}
|
||||
body span.float-right>span{display:block;overflow:hidden;margin:13px auto 0;text-align:right;}
|
||||
body code, tt{margin:0 2px;padding:0 5px;white-space:nowrap;border:1px solid #eaeaea;background-color:#f8f8f8;border-radius:3px;}
|
||||
body pre>code{margin:0;padding:0;white-space:pre;border:none;background:transparent;}
|
||||
body .highlight pre, pre{background-color:#f8f8f8;border:1px solid #ccc;font-size:13px;line-height:19px;overflow:auto;padding:6px 10px;border-radius:3px;}
|
||||
body pre code, pre tt{background-color:transparent;border:none;}
|
||||
</style></head>
|
||||
<body>
|
||||
<h1>MPI/Examples : exMPI03</h1>
|
||||
|
||||
<h2>Description</h2>
|
||||
|
||||
<p>An example of dosimetry in a water phantom.</p>
|
||||
|
||||
<h3>Configuration:</h3>
|
||||
|
||||
<ul>
|
||||
<li>Geometry : water phantom</li>
|
||||
<li>Primary : broad beam (200 MeV proton)</li>
|
||||
<li>Physics List : FTFP_BERT</li>
|
||||
<li>Analysis : g4tools histogramming</li>
|
||||
</ul>
|
||||
|
||||
<p>The environment variables, <em>G4LEDATA</em>, <em>G4LEVELGAMMADATA</em> and <em>G4SAIDXSDATA</em>
|
||||
are required for data files.</p>
|
||||
|
||||
<h3>Features:</h3>
|
||||
|
||||
<ul>
|
||||
<li>Score dose distribution in a water phantom.</li>
|
||||
<li>Learn how to paralleized your applications.</li>
|
||||
<li>Create a ROOT file containing histograms/trees in each node.
|
||||
Each slave node generate a ROOT file, whose file name is different
|
||||
from each other.</li>
|
||||
<li>MT is enabled.</li>
|
||||
<li>One of each object supported by g4tools is instantiated: 1D, 2D and 3D
|
||||
histograms and 1D and 2D profiles.</li>
|
||||
<li>Histograms and profiles are merged first among threads of the same
|
||||
MPI-rank and then across MPI-ranks. See RunActionMaster class for
|
||||
an example on how to use the mergers.</li>
|
||||
<li>G4Run object and scorers (command line ones) are also merged via
|
||||
MPI.</li>
|
||||
<li>Output: several root files are created: dose-rank*.root thread-merged
|
||||
histograms for each rank; dose-merged.root, merged across threads and
|
||||
across ranks.</li>
|
||||
</ul>
|
||||
|
||||
<h2>How to build</h2>
|
||||
|
||||
<p>Use CMake on Geant4 library installed with CMake build.</p>
|
||||
|
||||
<p>This example requires G4mpi library to be installed
|
||||
(see examples/extended/parallel/MPI/source/REDME.md)</p>
|
||||
|
||||
<p>Follow these commands,</p>
|
||||
|
||||
|
||||
<pre><code>> mkdir build
|
||||
> cd build
|
||||
> cmake -DG4mpi_DIR=<where-G4mpi-wasintalled >/lib[64]/G4mpi -DCMAKE_CXX_COMPILER=mpicxx \
|
||||
-DGeant4_DIR=<your Geant4 install path
|
||||
>/lib[64]/Geant4-V.m.n <path-to-source><
|
||||
(V.m.n is the version of Geant4, eg. Geant4-9.6.0)
|
||||
> make<
|
||||
> make install
|
||||
</code></pre>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,54 @@
|
||||
MPI/Examples : exMPI03
|
||||
======================
|
||||
|
||||
Description
|
||||
-----------
|
||||
An example of dosimetry in a water phantom.
|
||||
The example has same geometry and physics as exMPI02, only the analysis part
|
||||
is different.
|
||||
|
||||
### Configuration:
|
||||
- Geometry : water phantom
|
||||
- Primary : broad beam (200 MeV proton)
|
||||
- Physics List : FTFP_BERT
|
||||
- Analysis : g4tools histogramming
|
||||
|
||||
The environment variables, *G4LEDATA*, *G4LEVELGAMMADATA* and *G4SAIDXSDATA*
|
||||
are required for data files.
|
||||
|
||||
### Features:
|
||||
- Score dose distribution in a water phantom.
|
||||
- Learn how to paralleized your applications.
|
||||
- Create a ROOT file containing histograms/trees in each node.
|
||||
Each slave node generate a ROOT file, whose file name is different
|
||||
from each other.
|
||||
- MT is enabled.
|
||||
- One of each object supported by g4tools is instantiated: 1D, 2D and 3D
|
||||
histograms and 1D and 2D profiles.
|
||||
- Histograms and profiles are merged first among threads of the same
|
||||
MPI-rank and then across MPI-ranks. See RunActionMaster class for
|
||||
an example on how to use the mergers.
|
||||
- G4Run object and scorers (command line ones) are also merged via
|
||||
MPI.
|
||||
- Output: several root files are created: dose-rank*.root thread-merged
|
||||
histograms for each rank; dose-merged.root, merged across threads and
|
||||
across ranks.
|
||||
|
||||
How to build
|
||||
------------
|
||||
Use CMake on Geant4 library installed with CMake build.
|
||||
|
||||
This example requires G4mpi library to be installed
|
||||
(see examples/extended/parallel/MPI/source/REDME.md)
|
||||
|
||||
Follow these commands,
|
||||
|
||||
> mkdir build
|
||||
> cd build
|
||||
> cmake -DG4mpi_DIR=<where-G4mpi-wasintalled>/lib[64]/G4mpi -DCMAKE_CXX_COMPILER=mpicxx \
|
||||
-DGeant4_DIR=<your Geant4 install path>/lib[64]/Geant4-V.m.n <path-to-source>
|
||||
(V.m.n is the version of Geant4, eg. Geant4-9.6.0)
|
||||
> make
|
||||
> make install
|
||||
|
||||
Replace mpicxx with your MPI-compiler wrapper.
|
||||
@@ -0,0 +1,58 @@
|
||||
/// @file "MPI/examples/exMPI04/.README.txt"
|
||||
/// @brief Example exMPI04 README
|
||||
|
||||
/*! \page exMPI04 Example : exMPI04
|
||||
|
||||
|
||||
Description
|
||||
===========
|
||||
An example of dosimetry in a water phantom.
|
||||
The example is as exMPI03, but adds output in G4analysis ntuple
|
||||
and demonstrates ntuple merging.
|
||||
|
||||
In difference from merging other data (G4Run, scorers, hitograms),
|
||||
the ntuple data are not sent to the collecting rank(s) at the
|
||||
end of run but during event processing. That's why (an) extra rank(s)
|
||||
have to be reserved for this purpose. The number of extra workers requested
|
||||
is set in G4MPImanager constructor in main(). While G4MPImanager
|
||||
can be created with any number of extra workers (< total number),
|
||||
the ntuple merging is at present supported only for one.
|
||||
|
||||
The extra worker is connected to the run action class via G4MPIextraWorker
|
||||
object which is set to G4MPImanager in main().
|
||||
The standard calls to G4AnalysisManager (creating ntuple, open, write and
|
||||
close file) trigger creating all necessary analysis tools object
|
||||
for merging ntuple data on flight.
|
||||
|
||||
MPI ntuple merging can be activated in sequential mode only;
|
||||
this activation is perfomed by creating the G4MPIntupleMerger
|
||||
object in the RunActionMaster constructor.
|
||||
The merger must be created before creating G4AnalysisManager
|
||||
(= the first call to G4AnalysisManager::Instance())
|
||||
and deleted only at the end of program.
|
||||
|
||||
If multithreading mode is enabled, the ntuples are merged from
|
||||
threads to files per ranks.
|
||||
Combined MT + MPI merging is not yet supported.
|
||||
Merging ntuples is actually supported only with Root output format.
|
||||
|
||||
How to build
|
||||
============
|
||||
Use CMake on Geant4 library installed with CMake build.
|
||||
|
||||
This example requires G4mpi library to be installed
|
||||
(see examples/extended/parallel/MPI/source/REDME.md)
|
||||
|
||||
Follow these commands,
|
||||
|
||||
> mkdir build
|
||||
> cd build
|
||||
> cmake -DG4mpi_DIR=<where-G4mpi-wasintalled>/lib[64]/G4mpi -DCMAKE_CXX_COMPILER=mpicxx \
|
||||
-DGeant4_DIR=<your Geant4 install path>/lib[64]/Geant4-V.m.n <path-to-source>
|
||||
(V.m.n is the version of Geant4, eg. Geant4-9.6.0)
|
||||
> make
|
||||
> make install
|
||||
|
||||
Replace mpicxx with your MPI-compiler wrapper.
|
||||
|
||||
*/
|
||||
@@ -0,0 +1,53 @@
|
||||
MPI/Examples : exMPI04
|
||||
======================
|
||||
|
||||
Description
|
||||
-----------
|
||||
An example of dosimetry in a water phantom.
|
||||
The example is as exMPI03, but adds output in G4analysis ntuple
|
||||
and demonstrates ntuple merging.
|
||||
|
||||
In difference from merging other data (G4Run, scorers, hitograms),
|
||||
the ntuple data are not sent to the collecting rank(s) at the
|
||||
end of run but during event processing. That's why (an) extra rank(s)
|
||||
have to be reserved for this purpose. The number of extra workers requested
|
||||
is set in G4MPImanager constructor in main(). While G4MPImanager
|
||||
can be created with any number of extra workers (< total number),
|
||||
the ntuple merging is at present supported only for one.
|
||||
|
||||
The extra worker is connected to the run action class via G4MPIextraWorker
|
||||
object which is set to G4MPImanager in main().
|
||||
The standard calls to G4AnalysisManager (creating ntuple, open, write and
|
||||
close file) trigger creating all necessary analysis tools object
|
||||
for merging ntuple data on flight.
|
||||
|
||||
MPI ntuple merging can be activated in sequential mode only;
|
||||
this activation is perfomed by creating the G4MPIntupleMerger
|
||||
object in the RunActionMaster constructor.
|
||||
The merger must be created before creating G4AnalysisManager
|
||||
(= the first call to G4AnalysisManager::Instance())
|
||||
and deleted only at the end of program.
|
||||
|
||||
If multithreading mode is enabled, the ntuples are merged from
|
||||
threads to files per ranks.
|
||||
Combined MT + MPI merging is not yet supported.
|
||||
Merging ntuples is actually supported only with Root output format.
|
||||
|
||||
How to build
|
||||
------------
|
||||
Use CMake on Geant4 library installed with CMake build.
|
||||
|
||||
This example requires G4mpi library to be installed
|
||||
(see examples/extended/parallel/MPI/source/REDME.md)
|
||||
|
||||
Follow these commands,
|
||||
|
||||
> mkdir build
|
||||
> cd build
|
||||
> cmake -DG4mpi_DIR=<where-G4mpi-wasintalled>/lib[64]/G4mpi -DCMAKE_CXX_COMPILER=mpicxx \
|
||||
-DGeant4_DIR=<your Geant4 install path>/lib[64]/Geant4-V.m.n <path-to-source>
|
||||
(V.m.n is the version of Geant4, eg. Geant4-9.6.0)
|
||||
> make
|
||||
> make install
|
||||
|
||||
Replace mpicxx with your MPI-compiler wrapper.
|
||||
Reference in New Issue
Block a user