Import Geant4 11.2.0 source tree
This commit is contained in:
@@ -8,7 +8,7 @@ project(${_projname})
|
||||
#------------------------------------------------------------------------------
|
||||
#Manadatory dependencies
|
||||
|
||||
cmake_minimum_required(VERSION 3.16...3.21)
|
||||
cmake_minimum_required(VERSION 3.16...3.27)
|
||||
find_package(MPI REQUIRED)
|
||||
find_package(Geant4 10.2.0 REQUIRED)
|
||||
include(${Geant4_USE_FILE})
|
||||
|
||||
+71
-18
@@ -52,27 +52,80 @@ class base_pntuple;
|
||||
|
||||
using RootNtupleDescription = G4TNtupleDescription<tools::wroot::ntuple, G4RootFile>;
|
||||
|
||||
struct G4RootMpiPNtupleDescription
|
||||
class G4RootMpiPNtupleDescription
|
||||
{
|
||||
G4RootMpiPNtupleDescription(G4NtupleBooking* g4NtupleBooking)
|
||||
: fDescription(g4NtupleBooking),
|
||||
fNtuple(nullptr),
|
||||
fBasePNtuple(nullptr),
|
||||
fMainBranches(),
|
||||
fMainNtupleRank(0),
|
||||
fImpi(nullptr) {}
|
||||
public:
|
||||
G4RootMpiPNtupleDescription(G4NtupleBooking* g4NtupleBooking)
|
||||
: fDescription(g4NtupleBooking) {}
|
||||
|
||||
~G4RootMpiPNtupleDescription()
|
||||
{
|
||||
if ( fDescription.GetIsNtupleOwner() ) delete fNtuple;
|
||||
}
|
||||
~G4RootMpiPNtupleDescription()
|
||||
{
|
||||
if ( fDescription.GetIsNtupleOwner() ) delete fNtuple;
|
||||
}
|
||||
|
||||
RootNtupleDescription fDescription;
|
||||
tools::wroot::impi_ntuple* fNtuple;
|
||||
tools::wroot::base_pntuple* fBasePNtuple;
|
||||
std::vector<tools::wroot::branch*> fMainBranches;
|
||||
G4int fMainNtupleRank;
|
||||
tools::impi* fImpi;
|
||||
// Set methods
|
||||
void SetNtuple(tools::wroot::impi_ntuple* intuple);
|
||||
void SetBasePNtuple(tools::wroot::base_pntuple* basePNtuple);
|
||||
void SetMainNtupleRank(G4int value);
|
||||
void SetImpi(tools::impi* value);
|
||||
void Reset();
|
||||
|
||||
// Get methods
|
||||
RootNtupleDescription& GetDescription();
|
||||
tools::wroot::impi_ntuple* GetNtuple() const;
|
||||
tools::wroot::base_pntuple* GetBasePNtuple() const;
|
||||
std::vector<tools::wroot::branch*>& GetMainBranches();
|
||||
G4int GetMainNtupleRank() const;
|
||||
|
||||
private:
|
||||
RootNtupleDescription fDescription;
|
||||
tools::wroot::impi_ntuple* fNtuple { nullptr };
|
||||
tools::wroot::base_pntuple* fBasePNtuple { nullptr };
|
||||
std::vector<tools::wroot::branch*> fMainBranches;
|
||||
G4int fMainNtupleRank { 0 };
|
||||
tools::impi* fImpi { nullptr };
|
||||
};
|
||||
|
||||
// inline function
|
||||
|
||||
inline void G4RootMpiPNtupleDescription::SetNtuple(
|
||||
tools::wroot::impi_ntuple* intuple)
|
||||
{ fNtuple = intuple; }
|
||||
|
||||
inline void G4RootMpiPNtupleDescription::SetBasePNtuple(
|
||||
tools::wroot::base_pntuple* basePNtuple)
|
||||
{ fBasePNtuple = basePNtuple; }
|
||||
|
||||
inline void G4RootMpiPNtupleDescription::SetMainNtupleRank(G4int value)
|
||||
{ fMainNtupleRank = value; }
|
||||
|
||||
inline void G4RootMpiPNtupleDescription::SetImpi(tools::impi* value)
|
||||
{ fImpi = value; }
|
||||
|
||||
inline void G4RootMpiPNtupleDescription::Reset()
|
||||
{
|
||||
if ( fDescription.GetIsNtupleOwner() ) delete fNtuple;
|
||||
fNtuple = nullptr;
|
||||
}
|
||||
|
||||
inline RootNtupleDescription&
|
||||
G4RootMpiPNtupleDescription::GetDescription()
|
||||
{ return fDescription; }
|
||||
|
||||
inline tools::wroot::impi_ntuple*
|
||||
G4RootMpiPNtupleDescription::GetNtuple() const
|
||||
{ return fNtuple; }
|
||||
|
||||
inline tools::wroot::base_pntuple*
|
||||
G4RootMpiPNtupleDescription::GetBasePNtuple() const
|
||||
{ return fBasePNtuple; }
|
||||
|
||||
inline std::vector<tools::wroot::branch*>&
|
||||
G4RootMpiPNtupleDescription::GetMainBranches()
|
||||
{ return fMainBranches; }
|
||||
|
||||
inline G4int
|
||||
G4RootMpiPNtupleDescription::GetMainNtupleRank() const
|
||||
{ return fMainNtupleRank; }
|
||||
|
||||
#endif
|
||||
|
||||
@@ -100,8 +100,8 @@ class G4RootMpiPNtupleManager : public G4BaseNtupleManager
|
||||
virtual G4bool Reset() final;
|
||||
virtual void Clear() final;
|
||||
|
||||
// Reset
|
||||
virtual G4bool Reset(G4bool deleteNtuple) final;
|
||||
// Method to delete selected ntuple
|
||||
G4bool Delete(G4int id) final;
|
||||
|
||||
// Activation option
|
||||
//
|
||||
@@ -116,9 +116,6 @@ class G4RootMpiPNtupleManager : public G4BaseNtupleManager
|
||||
// Access methods
|
||||
virtual G4int GetNofNtuples() const final;
|
||||
|
||||
// List ntuples
|
||||
G4bool List(std::ostream& output, G4bool onlyIfActive = true) final;
|
||||
|
||||
private:
|
||||
G4RootMpiPNtupleDescription*
|
||||
GetNtupleDescriptionInFunction(G4int id, G4String function, G4bool warn = true) const;
|
||||
|
||||
@@ -91,7 +91,7 @@ void G4RootMpiAnalysisManager::SetMpiNtupleMerging(tools::impi* impi,
|
||||
G4bool G4RootMpiAnalysisManager::OpenFileImpl(const G4String& fileName)
|
||||
{
|
||||
if ( fNtupleFileManager->GetMergeMode() == G4NtupleMergeMode::kNone ) {
|
||||
return G4RootAnalysisManager::OpenFileImpl(fileName);
|
||||
return G4ToolsAnalysisManager::OpenFileImpl(fileName);
|
||||
}
|
||||
|
||||
// Create ntuple manager(s)
|
||||
@@ -136,20 +136,42 @@ G4bool G4RootMpiAnalysisManager::WriteImpl()
|
||||
//_____________________________________________________________________________
|
||||
G4bool G4RootMpiAnalysisManager::CloseFileImpl(G4bool reset)
|
||||
{
|
||||
// Cannot call base class function, as we need to close files also
|
||||
// on slave; an option in the base class can be added for this in future
|
||||
|
||||
Message(kVL4, "close", "files");
|
||||
|
||||
auto result = true;
|
||||
|
||||
// Call base class method
|
||||
result &= G4RootAnalysisManager::CloseFileImpl(reset);
|
||||
|
||||
// Close file also on Slave
|
||||
// (skipped in base class)
|
||||
if ( fNtupleFileManager->GetMergeMode() == G4NtupleMergeMode::kSlave ) {
|
||||
// close all open files
|
||||
result &= fFileManager->CloseFiles();
|
||||
if (fVNtupleFileManager) {
|
||||
result &= fVNtupleFileManager->ActionAtCloseFile();
|
||||
}
|
||||
|
||||
Message(kVL2, "close", "slave files", "", result);
|
||||
// close file also on Slave
|
||||
// - the conditoon used in the base class is commented out
|
||||
// if ( (fVNtupleFileManager == nullptr) ||
|
||||
// (fVNtupleFileManager->GetMergeMode() != G4NtupleMergeMode::kSlave) ) {
|
||||
if ( ! fVFileManager->CloseFiles() ) {
|
||||
Warn("Closing files failed", fkClass, "CloseFileImpl");
|
||||
result = false;
|
||||
}
|
||||
// }
|
||||
|
||||
// delete empty files
|
||||
if ( ! fVFileManager->DeleteEmptyFiles() ) {
|
||||
Warn("Deleting empty files failed", fkClass, "CloseFileImpl");
|
||||
result = false;
|
||||
}
|
||||
|
||||
// reset histograms
|
||||
if ( reset ) {
|
||||
if ( ! Reset() ) {
|
||||
Warn("Resetting data failed", fkClass, "CloseFileImpl");
|
||||
result = false;
|
||||
}
|
||||
}
|
||||
|
||||
Message(kVL3, "close", "files", "", result);
|
||||
G4cout << "### Done G4RootMpiAnalysisManager::CloseFileImpl" << G4endl;
|
||||
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
@@ -99,7 +99,6 @@ void G4RootMpiNtupleFileManager::SetMpiNtupleMergingMode(
|
||||
Message(kVL1, "set", "mpi ntuple merging mode", mergingMode);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// public methods
|
||||
//
|
||||
@@ -281,7 +280,7 @@ G4bool G4RootMpiNtupleFileManager::Reset()
|
||||
}
|
||||
|
||||
if ( fNtupleMergeMode == G4NtupleMergeMode::kSlave ) {
|
||||
result &= fMpiSlaveNtupleManager->Reset(false);
|
||||
result &= fMpiSlaveNtupleManager->Reset();
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
@@ -99,13 +99,13 @@ tools::wroot::base_pntuple* G4RootMpiPNtupleManager::GetNtupleInFunction(
|
||||
auto ntupleDescription = GetNtupleDescriptionInFunction(id, functionName);
|
||||
if ( ! ntupleDescription ) return nullptr;
|
||||
|
||||
if ( ! ntupleDescription->fBasePNtuple ) {
|
||||
if ( ! ntupleDescription->GetBasePNtuple() ) {
|
||||
if ( warn ) {
|
||||
NotExistException("ntuple", id, functionName);
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
return ntupleDescription->fBasePNtuple;
|
||||
return ntupleDescription->GetBasePNtuple();
|
||||
}
|
||||
|
||||
//
|
||||
@@ -116,7 +116,7 @@ tools::wroot::base_pntuple* G4RootMpiPNtupleManager::GetNtupleInFunction(
|
||||
void G4RootMpiPNtupleManager::CreateNtuple(G4RootMpiPNtupleDescription* ntupleDescription)
|
||||
{
|
||||
Message(kVL4, "create from booking", "mpi pntuple",
|
||||
ntupleDescription->fDescription.GetNtupleBooking().name());
|
||||
ntupleDescription->GetDescription().GetNtupleBooking().name());
|
||||
|
||||
// Wait for the ntuple data from main
|
||||
|
||||
@@ -206,27 +206,27 @@ void G4RootMpiPNtupleManager::CreateNtuple(G4RootMpiPNtupleDescription* ntupleDe
|
||||
tools::wroot::mpi_ntuple_row_wise* ntuple
|
||||
= new tools::wroot::mpi_ntuple_row_wise(
|
||||
mainNtupleId, G4cout, byteSwap, compression, seekDirectory,
|
||||
basketSize, ntupleDescription->fDescription.GetNtupleBooking(), verbose);
|
||||
ntupleDescription->fNtuple = ntuple;
|
||||
ntupleDescription->fBasePNtuple = ntuple;
|
||||
basketSize, ntupleDescription->GetDescription().GetNtupleBooking(), verbose);
|
||||
ntupleDescription->SetNtuple(ntuple);
|
||||
ntupleDescription->SetBasePNtuple(ntuple);
|
||||
} else {
|
||||
tools::wroot::mpi_ntuple_column_wise* ntuple
|
||||
= new tools::wroot::mpi_ntuple_column_wise(
|
||||
mainNtupleId, G4cout, byteSwap, compression, seekDirectory,
|
||||
basketSizes, ntupleDescription->fDescription.GetNtupleBooking(),
|
||||
basketSizes, ntupleDescription->GetDescription().GetNtupleBooking(),
|
||||
rowMode, basketEntries, verbose);
|
||||
ntupleDescription->fNtuple = ntuple;
|
||||
ntupleDescription->fBasePNtuple = ntuple;
|
||||
ntupleDescription->SetNtuple(ntuple);
|
||||
ntupleDescription->SetBasePNtuple(ntuple);
|
||||
}
|
||||
|
||||
ntupleDescription->fDescription.SetIsNtupleOwner(true);
|
||||
ntupleDescription->fImpi = fImpi;
|
||||
// should be not needed
|
||||
ntupleDescription->GetDescription().SetIsNtupleOwner(true);
|
||||
ntupleDescription->SetImpi(fImpi);
|
||||
// should be not needed
|
||||
// pntuple object is not deleted automatically
|
||||
fNtupleVector.push_back(ntupleDescription->fNtuple);
|
||||
fNtupleVector.push_back(ntupleDescription->GetNtuple());
|
||||
|
||||
Message(kVL3, "create from booking", "mpi pntuple",
|
||||
ntupleDescription->fDescription.GetNtupleBooking().name());
|
||||
ntupleDescription->GetDescription().GetNtupleBooking().name());
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
@@ -244,7 +244,7 @@ void G4RootMpiPNtupleManager::CreateNtuplesFromBooking(
|
||||
// auto g4NtupleBookings = fBookingManager->GetNtupleBookingVector();
|
||||
for ( auto g4NtupleBooking : ntupleBookings ) {
|
||||
auto ntupleDescription = new G4RootMpiPNtupleDescription(g4NtupleBooking);
|
||||
ntupleDescription->fMainNtupleRank = fDestinationRank;
|
||||
ntupleDescription->SetMainNtupleRank(fDestinationRank);
|
||||
fNtupleDescriptionVector.push_back(ntupleDescription);
|
||||
}
|
||||
|
||||
@@ -252,13 +252,13 @@ void G4RootMpiPNtupleManager::CreateNtuplesFromBooking(
|
||||
for ( auto ntupleDescription : fNtupleDescriptionVector ) {
|
||||
|
||||
// Do not create ntuple if it is inactivated
|
||||
if ( fState.GetIsActivation() && ( ! ntupleDescription->fDescription.GetActivation() ) ) continue;
|
||||
if ( fState.GetIsActivation() && ( ! ntupleDescription->GetDescription().GetActivation() ) ) continue;
|
||||
|
||||
// Do not create ntuple if it already exists
|
||||
if ( ntupleDescription->fNtuple ) continue;
|
||||
if ( ntupleDescription->GetNtuple() ) continue;
|
||||
|
||||
Message(kVL4, "create from booking", "mpi pntuple",
|
||||
ntupleDescription->fDescription.GetNtupleBooking().name());
|
||||
ntupleDescription->GetDescription().GetNtupleBooking().name());
|
||||
|
||||
// create ntuple
|
||||
CreateNtuple(ntupleDescription);
|
||||
@@ -268,7 +268,7 @@ void G4RootMpiPNtupleManager::CreateNtuplesFromBooking(
|
||||
// FinishTNtuple(ntupleDescription);
|
||||
|
||||
Message(kVL3, "create from booking", "mpi pntuple",
|
||||
ntupleDescription->fDescription.GetNtupleBooking().name());
|
||||
ntupleDescription->GetDescription().GetNtupleBooking().name());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -326,8 +326,8 @@ G4bool G4RootMpiPNtupleManager::AddNtupleRow(G4int ntupleId)
|
||||
|
||||
// if(!_ntuple->add_row(_impi,rank_src,tag)) {
|
||||
auto result
|
||||
= ntupleDescription->fNtuple
|
||||
->add_row(*fImpi, ntupleDescription->fMainNtupleRank, kTAG_NTUPLE );
|
||||
= ntupleDescription->GetNtuple()
|
||||
->add_row(*fImpi, ntupleDescription->GetMainNtupleRank(), kTAG_NTUPLE );
|
||||
|
||||
if ( ! result ) {
|
||||
G4ExceptionDescription description;
|
||||
@@ -353,33 +353,33 @@ G4bool G4RootMpiPNtupleManager::Merge()
|
||||
for ( auto ntupleDescription : fNtupleDescriptionVector) {
|
||||
|
||||
// skip inactivated ntuples
|
||||
if ( ! ntupleDescription->fDescription.GetActivation() ) continue;
|
||||
if ( ! ntupleDescription->GetDescription().GetActivation() ) continue;
|
||||
|
||||
// skip if ntuple was already merged and deleted
|
||||
// (this happend when the main rank re-opens a new file for merged data)
|
||||
if ( ! ntupleDescription->fNtuple ) continue;
|
||||
if ( ! ntupleDescription->GetNtuple() ) continue;
|
||||
|
||||
Message(kVL4, "merge", "pntuple", ntupleDescription->fDescription.GetNtupleBooking().name());
|
||||
Message(kVL4, "merge", "pntuple", ntupleDescription->GetDescription().GetNtupleBooking().name());
|
||||
|
||||
// G4cout << "call end_fill " << fImpi
|
||||
// << " to rank " << ntupleDescription->fMainNtupleRank
|
||||
// << " pntuple: " << ntupleDescription->fNtuple << G4endl;
|
||||
// << " to rank " << ntupleDescription->GetMainNtupleRank()
|
||||
// << " pntuple: " << ntupleDescription->GetNtuple() << G4endl;
|
||||
auto result
|
||||
= ntupleDescription->fNtuple
|
||||
->end_fill(*fImpi, ntupleDescription->fMainNtupleRank, kTAG_NTUPLE);
|
||||
= ntupleDescription->GetNtuple()
|
||||
->end_fill(*fImpi, ntupleDescription->GetMainNtupleRank(), kTAG_NTUPLE);
|
||||
|
||||
if ( ! result ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " " << " ntuple " << ntupleDescription->fDescription.GetNtupleBooking().name()
|
||||
description << " " << " ntuple " << ntupleDescription->GetDescription().GetNtupleBooking().name()
|
||||
<< "end fill has failed.";
|
||||
G4Exception("G4RootMpiPNtupleManager::Merge()",
|
||||
"Analysis_W002", JustWarning, description);
|
||||
}
|
||||
|
||||
delete ntupleDescription->fNtuple;
|
||||
ntupleDescription->fNtuple = nullptr;
|
||||
delete ntupleDescription->GetNtuple();
|
||||
ntupleDescription->SetNtuple(nullptr);
|
||||
|
||||
Message(kVL3, "merge", "pntuple", ntupleDescription->fDescription.GetNtupleBooking().name());
|
||||
Message(kVL3, "merge", "pntuple", ntupleDescription->GetDescription().GetNtupleBooking().name());
|
||||
}
|
||||
|
||||
return finalResult;
|
||||
@@ -393,7 +393,7 @@ G4bool G4RootMpiPNtupleManager::Reset()
|
||||
// The ntuples will be recreated with new cycle or new open file.
|
||||
|
||||
for ( auto ntupleDescription : fNtupleDescriptionVector ) {
|
||||
ntupleDescription->fDescription.Reset();
|
||||
ntupleDescription->GetDescription().Reset();
|
||||
}
|
||||
|
||||
fNtupleVector.clear();
|
||||
@@ -405,7 +405,7 @@ G4bool G4RootMpiPNtupleManager::Reset()
|
||||
void G4RootMpiPNtupleManager::Clear()
|
||||
{
|
||||
for ( auto ntupleDescription : fNtupleDescriptionVector ) {
|
||||
delete ntupleDescription->fNtuple;
|
||||
delete ntupleDescription->GetNtuple();
|
||||
}
|
||||
|
||||
fNtupleDescriptionVector.clear();
|
||||
@@ -414,21 +414,31 @@ void G4RootMpiPNtupleManager::Clear()
|
||||
Message(kVL2, "clear", "pntuples");
|
||||
}
|
||||
|
||||
|
||||
//_____________________________________________________________________________
|
||||
G4bool G4RootMpiPNtupleManager::Reset(G4bool deleteNtuple)
|
||||
G4bool G4RootMpiPNtupleManager::Delete(G4int id)
|
||||
{
|
||||
for ( auto ntupleDescription : fNtupleDescriptionVector ) {
|
||||
if ( deleteNtuple ) {
|
||||
delete ntupleDescription->fNtuple;
|
||||
}
|
||||
ntupleDescription->fNtuple = nullptr;
|
||||
if ( IsVerbose(G4Analysis::kVL4) ) {
|
||||
Message(G4Analysis::kVL4, "delete", "pntuple ntupleId " + to_string(id));
|
||||
}
|
||||
|
||||
fNtupleVector.clear();
|
||||
auto ntupleDescription = GetNtupleDescriptionInFunction(id, "Delete", true);
|
||||
|
||||
if (ntupleDescription == nullptr) return false;
|
||||
|
||||
// Delete/clear ntuple data
|
||||
delete ntupleDescription->GetNtuple();
|
||||
ntupleDescription->SetNtuple(nullptr);
|
||||
ntupleDescription->SetBasePNtuple(nullptr);
|
||||
ntupleDescription->GetMainBranches().clear();
|
||||
|
||||
// Update ntuple vector
|
||||
auto index = id - GetFirstId();
|
||||
fNtupleVector[index] = nullptr;
|
||||
|
||||
Message(G4Analysis::kVL2, "delete", "pntuple ntupleId " + to_string(id));
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
|
||||
@@ -436,7 +446,7 @@ void G4RootMpiPNtupleManager::SetActivation(
|
||||
G4bool activation)
|
||||
{
|
||||
for ( auto ntupleDescription : fNtupleDescriptionVector ) {
|
||||
ntupleDescription->fDescription.SetActivation(activation);
|
||||
ntupleDescription->GetDescription().SetActivation(activation);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -448,7 +458,7 @@ void G4RootMpiPNtupleManager::SetActivation(
|
||||
auto ntupleDescription = GetNtupleDescriptionInFunction(ntupleId, "SetActivation");
|
||||
if ( ! ntupleDescription ) return;
|
||||
|
||||
ntupleDescription->fDescription.SetActivation(activation);
|
||||
ntupleDescription->GetDescription().SetActivation(activation);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
@@ -458,7 +468,7 @@ G4bool G4RootMpiPNtupleManager::GetActivation(
|
||||
auto ntupleDescription = GetNtupleDescriptionInFunction(ntupleId, "GetActivation");
|
||||
if ( ! ntupleDescription ) return false;
|
||||
|
||||
return ntupleDescription->fDescription.GetActivation();
|
||||
return ntupleDescription->GetDescription().GetActivation();
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
@@ -478,10 +488,3 @@ G4int G4RootMpiPNtupleManager::GetNofNtuples() const
|
||||
{
|
||||
return fNtupleVector.size();
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
G4bool G4RootMpiPNtupleManager::List(std::ostream& /*output*/, G4bool /*onlyIfActive*/)
|
||||
{
|
||||
Warn("Not implemented.", fkClass, "List");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -110,6 +110,8 @@ public:
|
||||
|
||||
void BeamOn(G4int nevent, G4bool qdivide=true);
|
||||
void Print(const G4String& message);
|
||||
G4int GetEventsInMaster() const {return fevents_in_master;}
|
||||
G4int GetEventsInSlave() const {return fevents_in_slave;}
|
||||
|
||||
// misc
|
||||
void ShowHelp() const;
|
||||
@@ -172,6 +174,8 @@ private:
|
||||
|
||||
// for beamOn
|
||||
pthread_t thread_id_;
|
||||
G4int fevents_in_master = 0;
|
||||
G4int fevents_in_slave = 0;
|
||||
|
||||
// parallel parameters
|
||||
G4double master_weight_;
|
||||
|
||||
@@ -571,6 +571,8 @@ void G4MPImanager::BeamOn(G4int nevent, G4bool qdivide)
|
||||
G4double ntot = master_weight_ + size_ - 1.;
|
||||
G4int nproc = G4int(nevent/ntot);
|
||||
G4int nproc0 = nevent - nproc*(size_ - 1);
|
||||
fevents_in_master = nproc0;
|
||||
fevents_in_slave = nproc;
|
||||
|
||||
if ( verbose_ > 0 && is_master_ ) {
|
||||
G4cout << "#events in master=" << nproc0 << " / "
|
||||
|
||||
Reference in New Issue
Block a user