177{
178 if ( ! htVector.size() ) return true;
179
180
181 G4int nofActiveT = 0;
183
184 for (
G4int i=0; i<
G4int(htVector.size()); ++i ) {
185 auto activation = hnVector[i]->GetActivation();
186 if ( activation ) ++nofActiveT;
187 }
188 } else {
189 nofActiveT =
G4int(htVector.size());
190 }
191
192 if ( ! nofActiveT ) return true;
193
195 if ( ! fHmpi->comm_rank(commRank) ) {
197 description
198 <<
" Failed to get MPI commander rank." <<
G4endl
199 << " Merging will not be performed.";
202 return false;
203 }
204
205 G4bool finalResult =
true;
206
207 if ( commRank != fHmpi->rank() ) {
208
209#ifdef G4VERBOSE
212 description << "on rank " << commRank
213 << " destination rank: " << fHmpi->rank();
215 }
216#endif
217
218 auto result = Send(nofActiveT, htVector, hnVector);
219
220 finalResult = result && finalResult;
221
222#ifdef G4VERBOSE
225 description << "on rank " << commRank
226 << " destination rank: " << fHmpi->rank();
228 }
229#endif
230
231 } else {
232
233#ifdef G4VERBOSE
236 description << "on rank " << commRank
237 << " destination rank: " << fHmpi->rank();
239 }
240#endif
241
242 auto result = Receive(nofActiveT, htVector, hnVector);
243
244 finalResult = result && finalResult;
245
246#ifdef G4VERBOSE
249 description << "on rank " << commRank
250 << " destination rank: " << fHmpi->rank();
252 }
253#endif
254 }
255 return finalResult;
256}
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
const G4AnalysisVerbose * GetVerboseL3() const
const G4AnalysisVerbose * GetVerboseL1() const
G4bool GetIsActivation() const
const G4AnalysisVerbose * GetVerboseL4() const
void Message(const G4String &action, const G4String &object, const G4String &objectName, G4bool success=true) const