Import Geant4 10.5.0 source tree
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
|
||||
// The extra MPI worker class defines actions on an extra MPI worker
|
||||
// which does not perform event processing.
|
||||
// It calls the BeginOfRunAction() and EndOfRunAction().
|
||||
// Currently used only for ntuple merging.
|
||||
//
|
||||
// Author: Ivana Hrivnacova, 21/11/2018 (ivana@ipno.in2p3.fr)
|
||||
|
||||
#ifndef G4MPIEXTRAWORKER_HH
|
||||
|
||||
#include "G4VMPIextraWorker.hh"
|
||||
|
||||
class G4UserRunAction;
|
||||
|
||||
class G4MPIextraWorker : public G4VMPIextraWorker
|
||||
{
|
||||
public:
|
||||
G4MPIextraWorker(G4UserRunAction* runAction) : fRunAction(runAction) {}
|
||||
virtual ~G4MPIextraWorker() {}
|
||||
|
||||
virtual void BeamOn();
|
||||
private:
|
||||
G4UserRunAction* fRunAction;
|
||||
};
|
||||
|
||||
#endif //G4MPIEXTRAWORKER_HH
|
||||
|
||||
@@ -41,6 +41,7 @@ class G4MPImessenger;
|
||||
class G4MPIsession;
|
||||
class G4MPIstatus;
|
||||
class G4VMPIseedGenerator;
|
||||
class G4VMPIextraWorker;
|
||||
|
||||
class G4MPImanager {
|
||||
public:
|
||||
@@ -54,11 +55,12 @@ public:
|
||||
kTAG_DATA = 1000,
|
||||
kTAG_HISTO = 1001,
|
||||
kTAG_RUN = 1002,
|
||||
kTAG_CMDSCR = 1003
|
||||
kTAG_CMDSCR = 1003,
|
||||
kTAG_NTUPLE = 1004
|
||||
};
|
||||
|
||||
G4MPImanager();
|
||||
G4MPImanager(int argc, char** argv);
|
||||
G4MPImanager(int nof_extra_workers = 0);
|
||||
G4MPImanager(int argc, char** argv, int nof_extra_workers = 0);
|
||||
~G4MPImanager();
|
||||
|
||||
static G4MPImanager* GetManager();
|
||||
@@ -69,11 +71,13 @@ public:
|
||||
G4int GetVerbose() const;
|
||||
void SetVerbose(G4int iverbose);
|
||||
|
||||
G4int GetSize() const;
|
||||
G4int GetTotalSize() const; // get size of all ranks
|
||||
G4int GetActiveSize() const; // get size of ranks wher RunBeamOn is called
|
||||
G4int GetRank() const;
|
||||
|
||||
G4bool IsMaster() const;
|
||||
G4bool IsSlave() const;
|
||||
G4bool IsExtraWorker() const;
|
||||
|
||||
G4bool IsInitMacro() const;
|
||||
const G4String& GetInitFileName() const;
|
||||
@@ -84,6 +88,9 @@ public:
|
||||
void SetMasterWeight(G4double aweight);
|
||||
G4double GetMasterWeight() const;
|
||||
|
||||
void SetExtraWorker(G4VMPIextraWorker* extraWorker);
|
||||
G4VMPIextraWorker* GetExtraWorker() const;
|
||||
|
||||
G4VMPIseedGenerator* GetSeedGenerator() const;
|
||||
|
||||
// MPI methods
|
||||
@@ -107,7 +114,10 @@ public:
|
||||
// misc
|
||||
void ShowHelp() const;
|
||||
|
||||
//MPI::Intracomm* GetComm() const { return &COMM_G4COMMAND_; }
|
||||
const MPI::Intracomm* GetComm() const { return &COMM_G4COMMAND_; }
|
||||
const MPI_Comm* GetProcessingComm() const { return &processing_comm_; }
|
||||
const MPI_Comm* GetCollectingComm() const { return &collecting_comm_; }
|
||||
const MPI_Comm* GetAllComm() const { return &all_comm_; }
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(G4MPImanager);
|
||||
|
||||
@@ -119,6 +129,7 @@ private:
|
||||
static G4MPImanager* g4mpi_;
|
||||
G4MPImessenger* messenger_;
|
||||
G4MPIsession* session_;
|
||||
G4VMPIextraWorker* extra_worker_;
|
||||
|
||||
// seed generator
|
||||
G4VMPIseedGenerator* seed_generator_;
|
||||
@@ -130,11 +141,24 @@ private:
|
||||
// MPI rank
|
||||
G4bool is_master_;
|
||||
G4bool is_slave_;
|
||||
G4bool is_extra_worker_;
|
||||
G4int rank_;
|
||||
G4int size_;
|
||||
G4int size_; // processing comm size
|
||||
G4int world_size_; // world comm size
|
||||
|
||||
// MPI communicator
|
||||
// MPI communicator (when no extra ranks)
|
||||
MPI::Intracomm COMM_G4COMMAND_;
|
||||
// MPI communicator (processing ranks - if ntuple merging)
|
||||
MPI_Comm processing_comm_;
|
||||
// MPI communicator (collecting ranks - if ntuple merging)
|
||||
MPI_Comm collecting_comm_;
|
||||
// MPI communicator (all ranks - if ntuple mergins)
|
||||
MPI_Comm all_comm_;
|
||||
// Interim data - need to be freed
|
||||
MPI_Group world_group_;
|
||||
MPI_Group processing_group_;
|
||||
MPI_Group collecting_group_;
|
||||
MPI_Group all_group_;
|
||||
|
||||
// cout/cerr control
|
||||
G4bool qfcout_;
|
||||
@@ -151,6 +175,7 @@ private:
|
||||
|
||||
// parallel parameters
|
||||
G4double master_weight_;
|
||||
G4int nof_extra_workers_;
|
||||
};
|
||||
|
||||
// ====================================================================
|
||||
@@ -179,7 +204,12 @@ inline G4int G4MPImanager::GetRank() const
|
||||
return rank_;
|
||||
}
|
||||
|
||||
inline G4int G4MPImanager::GetSize() const
|
||||
inline G4int G4MPImanager::GetTotalSize() const
|
||||
{
|
||||
return world_size_;
|
||||
}
|
||||
|
||||
inline G4int G4MPImanager::GetActiveSize() const
|
||||
{
|
||||
return size_;
|
||||
}
|
||||
@@ -194,6 +224,11 @@ inline G4bool G4MPImanager::IsSlave() const
|
||||
return is_slave_;
|
||||
}
|
||||
|
||||
inline G4bool G4MPImanager::IsExtraWorker() const
|
||||
{
|
||||
return is_extra_worker_;
|
||||
}
|
||||
|
||||
inline G4bool G4MPImanager::IsInitMacro() const
|
||||
{
|
||||
return qinitmacro_;
|
||||
@@ -229,6 +264,11 @@ inline G4double G4MPImanager::GetMasterWeight() const
|
||||
return master_weight_;
|
||||
}
|
||||
|
||||
inline G4VMPIextraWorker* G4MPImanager::GetExtraWorker() const
|
||||
{
|
||||
return extra_worker_;
|
||||
}
|
||||
|
||||
inline G4VMPIseedGenerator* G4MPImanager::GetSeedGenerator() const
|
||||
{
|
||||
return seed_generator_;
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// Class for configuring G4analysis for merging ntuples via MPI
|
||||
//
|
||||
// Author: Ivana Hrivnacova, 21/11/2018 (ivana@ipno.in2p3.fr)
|
||||
|
||||
#ifndef G4MPINTUPLEMERGER_HH
|
||||
#define G4MPINTUPLEMERGER_HH
|
||||
|
||||
#include "G4MPImanager.hh"
|
||||
#include "G4VMPIextraWorker.hh"
|
||||
|
||||
namespace tools {
|
||||
namespace mpi {
|
||||
class wrmpi;
|
||||
}
|
||||
}
|
||||
|
||||
class G4RootMpiAnalysisManager;
|
||||
|
||||
class G4MPIntupleMerger
|
||||
{
|
||||
public:
|
||||
G4MPIntupleMerger(G4int nofReducedNtupleFiles = 0,
|
||||
G4bool rowWise = false);
|
||||
~G4MPIntupleMerger();
|
||||
|
||||
private:
|
||||
tools::mpi::wrmpi* fWrmpi;
|
||||
};
|
||||
|
||||
#endif //G4MPINTUPLEMERGER_HH
|
||||
@@ -0,0 +1,42 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
|
||||
// The interface class for an extra MPI worker
|
||||
//
|
||||
// Author: Ivana Hrivnacova, 21/11/2018 (ivana@ipno.in2p3.fr)
|
||||
|
||||
#ifndef G4MVPIEXTRAWORKER_HH
|
||||
|
||||
class G4VMPIextraWorker {
|
||||
public:
|
||||
G4VMPIextraWorker() {}
|
||||
virtual ~G4VMPIextraWorker() {}
|
||||
|
||||
virtual void BeamOn() = 0;
|
||||
};
|
||||
|
||||
#endif //G4MPIVEXTRAWORKER_HH
|
||||
|
||||
Reference in New Issue
Block a user