Geant4
10.03.p02
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
G4MPIhistoMerger.cc
Go to the documentation of this file.
1
//
2
// ********************************************************************
3
// * License and Disclaimer *
4
// * *
5
// * The Geant4 software is copyright of the Copyright Holders of *
6
// * the Geant4 Collaboration. It is provided under the terms and *
7
// * conditions of the Geant4 Software License, included in the file *
8
// * LICENSE and available at http://cern.ch/geant4/license . These *
9
// * include a list of copyright holders. *
10
// * *
11
// * Neither the authors of this software system, nor their employing *
12
// * institutes,nor the agencies providing financial support for this *
13
// * work make any representation or warranty, express or implied, *
14
// * regarding this software system or assume any liability for its *
15
// * use. Please see the license in the file LICENSE and URL above *
16
// * for the full disclaimer and the limitation of liability. *
17
// * *
18
// * This code implementation is the result of the scientific and *
19
// * technical work of the GEANT4 collaboration. *
20
// * By using, copying, modifying or distributing the software (or *
21
// * any work based on the software) you agree to acknowledge its *
22
// * use in resulting scientific publications, and indicate your *
23
// * acceptance of all terms of the Geant4 Software license. *
24
// ********************************************************************
25
//
26
// Merge G4analysis histogram objects via MPI
27
//
28
// History:
29
// Jun 27, 2015 : Ivana Hrivnacova - new implementation using g4analysis
30
31
#include "
G4MPIhistoMerger.hh
"
32
#include "
G4ios.hh
"
33
#include "tools/mpi/hmpi"
34
#include <mpi.h>
35
#include "
G4VAnalysisManager.hh
"
36
37
G4MPIhistoMerger::G4MPIhistoMerger
() :
38
manager(0),destination(
G4MPImanager
::kRANK_MASTER),
39
verboseLevel(0) {}
40
41
G4MPIhistoMerger::G4MPIhistoMerger
(
G4VAnalysisManager
*
m
,
42
G4int
dest,
G4int
v
) : manager(m), destination(dest),verboseLevel(v) {}
43
44
void
G4MPIhistoMerger::Merge
()
45
{
46
if
( verboseLevel > 0 ) {
47
G4cout
<<
"Starting merging of histograms"
<<
G4endl
;
48
}
49
50
MPI::Intracomm comm = MPI::COMM_WORLD.Dup();
51
52
G4bool
verbose = ( verboseLevel > 1 );
53
G4int
tag
=
G4MPImanager::kTAG_HISTO
;
54
//const MPI::Intracomm* comm = &COMM_G4COMMAND_;
55
tools::mpi::hmpi* hmpi =
new
tools::mpi::hmpi(
G4cout
, destination, tag,
56
comm, verbose);
57
if
( ! manager->
Merge
(hmpi) ) {
58
G4cout
<<
" Merge FAILED"
<<
G4endl
;
59
}
60
61
delete
hmpi;
62
63
if
( verboseLevel > 0 ) {
64
G4cout
<<
"End merging of histograms"
<<
G4endl
;
65
}
66
comm.Free();
67
}
G4VAnalysisManager
Definition:
G4VAnalysisManager.hh:65
tag
Definition:
xmlparse.cc:187
G4int
int G4int
Definition:
G4Types.hh:78
G4MPImanager
Definition:
G4MPImanager.hh:45
G4cout
G4GLOB_DLL std::ostream G4cout
m
static constexpr double m
Definition:
G4SIunits.hh:129
G4bool
bool G4bool
Definition:
G4Types.hh:79
G4MPIhistoMerger::Merge
void Merge()
Definition:
G4MPIhistoMerger.cc:44
G4VAnalysisManager.hh
G4MPImanager::kTAG_HISTO
Definition:
G4MPImanager.hh:55
test.v
tuple v
Definition:
test.py:18
G4ios.hh
G4MPIhistoMerger::G4MPIhistoMerger
G4MPIhistoMerger()
Definition:
G4MPIhistoMerger.cc:37
G4endl
#define G4endl
Definition:
G4ios.hh:61
G4MPIhistoMerger.hh
G4VAnalysisManager::Merge
G4bool Merge(tools::histo::hmpi *hmpi)
Definition:
G4VAnalysisManager.cc:226
source
geant4.10.03.p02
examples
extended
parallel
MPI
source
src
G4MPIhistoMerger.cc
Generated on Tue Nov 28 2017 21:43:16 for Geant4 by
1.8.5