[gate-users] Re: gate-users Digest, Vol 20, Issue 1
patrice descourt
patrice.descourt at univ-brest.fr
Wed Nov 2 09:55:18 CET 2005
Dear Vandana
you do not have to bother about installing geant or gate on each node,
MPI logs on each node via rsh or ssh depending on your parameterization.
Below are outlines along which you can get parallel jobs
I will be pleased to give the final codes in a directory when I have
written those because for now I only focus on the second implementation
which is far more cumbersome.
The first one should not present any problems :
You just have to install MPI and compile Geant and Gate with mpicc which
replaces gcc
and run Gate via mpirun :
mpirun -np #number of nodes your_compiled_code.exe
you have to include
#include "mpi.h" in each file using MPI library e.g Gate.cc and
G4RunManager.hh
In Gate.cc you need at the beginning of main()
to add
MPI::Init(argc,argv); : this is to initialize MPI
at the end of Gate.cc main()
you put
MPI::Finalize();
in G4RunManager::DoEventLoop()
you put
G4int proc_number = MPI::COMM_WORLD.Get_size();
G4int proc_ID = MPI::COMM_WORLD.Get_rank();
before the for loop
which you replace with
for(i_event = proc_ID; i_event<n_event; i_event += proc_number)
now for the output, I review the ROOT one but the scheme is the same
for any GateVOutputModule :
in GateToRoot.hh you put #include "mpi.h"
and put at the beginning of GateToRoot:RecordBeginOfAcquisition
G4int proc_ID = MPI::COMM_WORLD.Get_rank();
and replace each GetFilePath() by GetFilePath()+"proc_"+proc_ID
I will give all the codes when this is all implemented
Cheers
P.Descourt
More information about the Gate-users
mailing list