source: trunk/examples/extended/parallel/MPI/README @ 1341

Last change on this file since 1341 was 1337, checked in by garnier, 14 years ago

tag geant4.9.4 beta 1 + modifs locales

File size: 4.7 KB
Line 
1$Id: README,v 1.3 2010/05/18 06:09:09 kmura Exp $
2==========================================================================
3Geant4 MPI Interface
4
5  Author:
6  Koichi Murakami (KEK) / Koichi.Murakami@kek.jp
7==========================================================================
8
9About the interface
10===================
11G4MPI is a native interface with MPI libraries. The directory contains
12a Geant4 UI library and a couple of parallelized examples.
13Using this interface, users applications can be parllelized with
14different MPI compliant libraries, such as OpenMPI, LAM/MPI, MPICH2,
15and so on.
16
17System Requirements:
18-------------------
19* Platform
20
21- Linux (32bit/64bit)
22- MacOS (Tiger)
23
24
25* MPI implementation
26
27- Open MPI (1.4.2)
28  http://www.open-mpi.org/
29
30- LAM/MPI (7.1.3) (development is terminated. maintenance only)
31  http://www.lam-mpi.org/
32
33- MPICH2 (1.2.1p1)
34  http://www.mcs.anl.gov/research/projects/mpich2/
35
36* Optional
37- ROOT for histogramming/analysis
38
39
40G4MPI UI library
41----------------
42G4MPI UI library is provided in the "mpi_interface" directory.
43Start with building the G4MPI UI library according to the instruction
44in the directory.
45
46
47How to make parallel applications:
48----------------------------------
49* An example of a main program:
50
51#include "G4MPImanager.hh"
52#include "G4MPIsession.hh"
53
54int main(int argc,char** argv)
55{
56  // At first, G4MPImanager/G4MPIsession should be created.
57  G4MPImanager* g4MPI= new G4MPImanager(argc,argv);
58
59  // MPI session (G4MPIsession) instead of G4UIterminal
60  G4MPIsession* session= g4MPI-> GetMPIsession();
61
62  // user application setting
63  G4RunManager* runManager= new G4RunManager();
64
65  // ....
66
67  // After user application setting, just start a MPI session.
68  // MPIsession treats both interactive and batch modes.
69  session-> SessionStart();
70
71  // Finally, terminate the program
72  delete g4MPI;
73  delete runManager;
74}
75
76
77* Notes about session shell:
78
79LAM/MPI users can use "G4tcsh" as an interactive session shell.
80For other users (Open MPI/MPICH2), plese use G4csh (default).
81
82In case of OpenMPI, LD_LIBRARY_PATH for OpenMPI runtime libraries
83should be set at run time. Alternatively, you can add this path
84to the dynamic linker configuration using `ldconfig`.
85(needs sys-admin authorization)
86
87
88How to use:
89-----------
90* MPI runtime rnvironment
91
921. Make hosts/cluster configuration of your MPI environment.
93
942. Launch MPI runtime environment, typically executing
95   lamboot (LAM) / mpdboot (MPICH2).
96
97* How to run
98For example,
99
100> mpiexec -n # <your application>
101
102Instead, "mpirun" command is more convenient for LAM users.
103
104
105MPI G4UI commands:
106------------------
107G4UI commands handling the G4MPI interface are placed in /mpi/.
108
109Command directory path : /mpi/
110
111Guidance :
112MPI control commands
113
114 Sub-directories :
115 Commands :
116   verbose *        Set verbose level.
117   status *         Show mpi status.
118   execute *        Execute a macro file. (=/control/execute)
119   beamOn *         Start a parallel run w/ thread.
120   .beamOn *        Start a parallel run w/o thread.
121   masterWeight *   Set weight for master node.
122   wait *           Wait until beamOn-s on all nodes are done. (batch mode only)
123   showSeeds *      Show seeds of MPI nodes.
124   setMasterSeed *  Set a master seed for the seed generator.
125   setSeed *        Set a seed for a specified node.
126
127* Notes:
128While "/run/beamOn" and "/mpi/beamOn" commands invoke beam-on in background,
129so you can input UI commands even while event processing.
130
131The original "/control/execute" and "/run/beamOn" are overwritten
132with "/mpi/execute" and "/mpi/beamOn" commands respectively,
133customized for the MPI interface.
134
135
136Examples
137========
138There are a couple of examples for Geant4 MPI applications.
139
140In some cases, you need to set some additional environment variables
141for running examples:
142
143- G4LEVELGAMMADATA : directory path for the data of
144                     "low energy electromagnetic processes".
145
146For running ROOT applications,
147
148- ROOTSYS         : root path of the ROOT package
149- LD_LIBRARY_PATH : add ROOT library path, such as $(ROOTSYS)/lib/root
150
151
152[exMPI01]
153A simple application.
154
155* Geometry     : chamber / calorimeter
156* Primary      : particle gun (200 MeV electron as default)
157* Physics List : standard EM
158
159- Particles are transported in a geometry without any scoring.
160- Learn how to parallelize your G4 session.
161
162
163[exMPI02] (ROOT application)
164An example of dosimetry in a water phantom.
165
166* Geometry     : water phantom
167* Primary      : particle gun (200 MeV proton as default)
168* Physics List : QGSP_BIC
169
170- Score dose distribution in a water phantom.
171- Learn how to paralleize your applications.
172- Create a ROOT file containing histograms in each node.
173  * treat multiple outputs properly:
174    each slave node generate a ROOT file, whose file name should
175    be different from each other.
176
Note: See TracBrowser for help on using the repository browser.