33 #include "Analysis.hh"
34 #include "RunActionMaster.hh"
36 #include "RunMerger.hh"
45 fMPIntupleMerger(nullptr)
47 #ifndef G4MULTITHREADED
54 G4int nofReducedNtupleFiles = 0;
90 std::ostringstream
fname;
91 fname<<
"dose-rank"<<rank;
121 G4cout <<
"=====================================================" <<
G4endl;
122 G4cout <<
"Start EndOfRunAction for master thread in rank: " << rank<<
G4endl;
123 G4cout <<
"=====================================================" <<
G4endl;
126 G4cout <<
"Go to merge on processing workers" <<
G4endl;
132 if ( rank == 0 && ver == 0) ver = 1;
135 G4cout<<
"Before merge the Run object has test counter value: "
136 <<
static_cast<const Run*
>(arun)->GetCounter()<<
G4endl;
138 rm.SetVerbosity( ver );
141 G4cout<<
"After merge the Run object has test counter value: "
142 <<
static_cast<const Run*
>(arun)->GetCounter()
143 <<
" (with 1 thread== number of ranks)"<<
G4endl;
151 sm.SetVerbosity(ver);
153 auto debugme = [&scor](){
154 for (
size_t idx = 0 ;
idx < scor->GetNumberOfMesh() ; ++
idx) {
155 const auto m = scor->GetMesh(
idx);
156 const auto map =
m->GetScoreMap();
157 std::for_each(map.begin(),map.end(),
158 [](
const G4VScoringMesh::MeshScoreMap::value_type&
e) {
160 const auto data =
e.second->GetMap();
162 G4cout<<
it->first<<
" => G4StatDouble(n,sum_w,sum_w2,sum_wx,sum_wx2): "
163 <<
it->second->n()<<
" "<<
it->second->sum_w()<<
" "
164 <<
it->second->sum_w2()<<
" "<<
it->second->sum_wx()<<
" "
179 for (
size_t idx = 0 ;
idx < scor->GetNumberOfMesh() ; ++
idx) {
180 const auto m = scor->GetMesh(
idx);
181 const auto& mn =
m->GetWorldName();
182 std::ostringstream
fname;
183 fname<<
"scorer-"<<mn<<
"-rank"<<rank<<
".csv";
184 scor->DumpAllQuantitiesToFile(mn,fname.str());
198 for (
size_t idx = 0 ;
idx < scor->GetNumberOfMesh() ; ++
idx) {
199 const auto m = scor->GetMesh(
idx);
200 const auto& mn =
m->GetWorldName();
201 std::ostringstream
fname;
202 fname<<
"scorer-"<<mn<<
"-merged.csv";
203 scor->DumpAllQuantitiesToFile(mn,fname.str());
213 myana->
Close(
false);
219 hm.SetVerbosity(ver);
239 G4cout <<
"===================================================" <<
G4endl;
240 G4cout <<
"End EndOfRunAction for master thread in rank: " << rank <<
G4endl;
241 G4cout <<
"===================================================" <<
G4endl;