67{
68
69 std::string rm_type =
GetName(_type);
72 {
73
74 fail_if_unavail = true;
75 }
76 else {
77
78
79
80
81
83 "Overriding G4RunManager type...");
84 auto force_rm =
86
87 if (force_rm.length() > 0) {
88 rm_type = force_rm;
89 fail_if_unavail = true;
90 }
91 else if (rm_type.empty()) {
93 }
94 }
95
96
97
98
100 if (opts.find(rm_type) == opts.end()) {
101 if (fail_if_unavail) {
102 fail("Run manager type is not available", rm_type, opts, 1);
103 }
104 else {
106 }
107 }
108
109
112
113 switch (_type) {
116 break;
118#if defined(G4MULTITHREADED)
120#endif
121 break;
123#if defined(G4MULTITHREADED)
125#endif
126 break;
128#if defined(G4MULTITHREADED) && defined(GEANT4_USE_TBB)
130#endif
131 break;
132
134 break;
136 break;
138 break;
140 break;
142 break;
143 }
144
145 if (rm ==
nullptr) fail(
"Failure creating run manager",
GetName(_type),
GetOptions(), 2);
146
149
150 master_run_manager = rm;
151 mt_master_run_manager = mtrm;
152 master_run_manager_kernel = rm->
kernel;
153
155 return rm;
156}
_Tp G4GetEnv(const std::string &env_id, _Tp _default=_Tp())
void SetNumberOfThreads(G4int n) override
static std::set< std::string > GetOptions()
static std::string GetName(G4RunManagerType)
static std::string GetDefault()
static G4RunManagerType GetType(const std::string &)
G4RunManagerKernel * kernel
void G4ConsumeParameters(_Args &&...)