Download
|
User Forum
|
Contact Us
|
Bug Reports
Home
>
Examples
Loading...
Searching...
No Matches
extended
parallel
MPI
source
src
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 "
G4MPImanager.hh
"
33
#include "G4ios.hh"
34
#include "toolx/mpi/hmpi"
35
#include <mpi.h>
36
#include "G4VAnalysisManager.hh"
37
38
G4MPIhistoMerger::G4MPIhistoMerger
() :
39
manager(0),destination(
G4MPImanager
::kRANK_MASTER),
40
verboseLevel(0) {}
41
42
G4MPIhistoMerger::G4MPIhistoMerger
(
G4VAnalysisManager
* m,
43
G4int dest, G4int v) : manager(m), destination(dest),verboseLevel(v) {}
44
45
void
G4MPIhistoMerger::Merge
()
46
{
47
if
(
verboseLevel
> 0 ) {
48
G4cout <<
"Starting merging of histograms"
<< G4endl;
49
}
50
51
const
MPI::Intracomm* parentComm =
G4MPImanager::GetManager
()->
GetComm
();
52
MPI::Intracomm comm = parentComm->Dup();
53
54
G4bool verbose = (
verboseLevel
> 1 );
55
G4int tag =
G4MPImanager::kTAG_HISTO
;
56
//const MPI::Intracomm* comm = &COMM_G4COMMAND_;
57
toolx::mpi::hmpi* hmpi
58
=
new
toolx::mpi::hmpi(G4cout,
destination
, tag, comm, verbose);
59
if
( !
manager
->Merge(hmpi) ) {
60
G4cout<<
" Merge FAILED"
<<G4endl;
61
}
62
63
delete
hmpi;
64
65
if
(
verboseLevel
> 0 ) {
66
G4cout <<
"End merging of histograms"
<< G4endl;
67
}
68
comm.Free();
69
}
G4MPIhistoMerger.hh
G4MPImanager.hh
MPI manager class.
G4MPIhistoMerger::manager
G4VAnalysisManager * manager
Definition
G4MPIhistoMerger.hh:53
G4MPIhistoMerger::Merge
void Merge()
Definition
G4MPIhistoMerger.cc:45
G4MPIhistoMerger::destination
G4int destination
Definition
G4MPIhistoMerger.hh:54
G4MPIhistoMerger::G4MPIhistoMerger
G4MPIhistoMerger()
Definition
G4MPIhistoMerger.cc:38
G4MPIhistoMerger::verboseLevel
G4int verboseLevel
Definition
G4MPIhistoMerger.hh:55
G4MPImanager
Definition
Doxymodules_parallel.h:63
G4MPImanager::GetManager
static G4MPImanager * GetManager()
Definition
G4MPImanager.cc:127
G4MPImanager::kTAG_HISTO
@ kTAG_HISTO
Definition
G4MPImanager.hh:56
G4MPImanager::GetComm
const MPI::Intracomm * GetComm() const
Definition
G4MPImanager.hh:119
G4VAnalysisManager
Generated on Tue Jan 30 2024 12:18:45 for Geant4 examples by
1.9.8
Applications
|
User Support
|
Publications
|
Collaboration