Warning, /geant4/examples/extended/parallel/MPI/exMPI04/README.md is written in an unsupported language. File is not indexed.
0001 MPI/Examples : exMPI04
0002 ======================
0003
0004 Description
0005 -----------
0006 An example of dosimetry in a water phantom.
0007 The example is as exMPI03, but adds output in G4analysis ntuple
0008 and demonstrates ntuple merging.
0009
0010 In difference from merging other data (G4Run, scorers, hitograms),
0011 the ntuple data are not sent to the collecting rank(s) at the
0012 end of run but during event processing. That's why (an) extra rank(s)
0013 have to be reserved for this purpose. The number of extra workers requested
0014 is set in G4MPImanager constructor in main(). While G4MPImanager
0015 can be created with any number of extra workers (< total number),
0016 the ntuple merging is at present supported only for one.
0017
0018 The extra worker is connected to the run action class via G4MPIextraWorker
0019 object which is set to G4MPImanager in main().
0020 The standard calls to G4AnalysisManager (creating ntuple, open, write and
0021 close file) trigger creating all necessary analysis tools object
0022 for merging ntuple data on flight.
0023
0024 MPI ntuple merging can be activated in sequential mode only;
0025 this activation is perfomed by creating the G4MPIntupleMerger
0026 object in the RunActionMaster constructor.
0027 The merger must be created before creating G4AnalysisManager
0028 (= the first call to G4AnalysisManager::Instance())
0029 and deleted only at the end of program.
0030
0031 If multithreading mode is enabled, the ntuples are merged from
0032 threads to files per ranks.
0033 Combined MT + MPI merging is not yet supported.
0034 Merging ntuples is actually supported only with Root output format.
0035
0036 How to build
0037 ------------
0038 Use CMake on Geant4 library installed with CMake build.
0039
0040 This example requires G4mpi library to be installed
0041 (see examples/extended/parallel/MPI/source/REDME.md)
0042
0043 Follow these commands,
0044
0045 > mkdir build
0046 > cd build
0047 > cmake -DG4mpi_DIR=<where-G4mpi-wasintalled>/lib[64]/G4mpi -DCMAKE_CXX_COMPILER=mpicxx \
0048 -DGeant4_DIR=<your Geant4 install path>/lib[64]/Geant4-V.m.n <path-to-source>
0049 (V.m.n is the version of Geant4, eg. Geant4-9.6.0)
0050 > make
0051 > make install
0052
0053 Replace mpicxx with your MPI-compiler wrapper.
0054
0055 How to run
0056 ----------
0057
0058 > mpiexec -n # ./exMPI04 [run.mac]