Message: Re: Saving partial results Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Feedback Re: Saving partial results 

Forum: Multithreading
Re: None Saving partial results
Date: 26 Aug, 2015
From: Andrea Dotti <Andrea Dotti>

Hello, sorry for the late answer.

> Question 1: When a thread detects that (N % 50) == 0, is it possible to
> somehow merge all the events processed so far across all threads so that
> the output can be written to file?

No this is not possible, because this would require synchronization between threads during event loop that would cause a large CPU penalty.

> Question 2: Is there a convenient way to process only a subrange of the
> events in a run? Maybe a check in BeginOfEventAction to skip the entire
> event unless it is in the desired range. Can this be done?

I think you have already found the correct solution to your problem. The solution is to make separate runs. A G4UserRunAction should be used. For example: t=Nevt/Ntot + Ntot*Nrun where Nrun is the run number.

Geant4 will guarantee that G4Run are correctly merged and threads are synchronized between the runs that compose your job.


 Add Message Add Message
to: "Re: Saving partial results"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews