|Message: Multithreading and random generators||Not Logged In (login)|
Click on the Forum title, e.g. on the "Forums by Category" page, to read a sequence of postings to the Forum and its threads all in one page. If you are only interested in one thread or the thread following a specific posting, click the thread or the posting, which takes you to a smaller page, which contains only the part you are interested in and may be easier to navigate.
Messages are "chained" if there are only replies at the first level, i.e. 1/1.html, 1/1/1.html etc. In case of "chained" messages the message number is replaced by the icon and there is no indentation.
Inline: Display the subject line only or also the text of the posting(s); for the choice "All" the "Outline" choices are switched off.
|1||0||1||no text / full text of posting|
|2||1||All||text for level 1 only / text for All postings|
Outline: Choose the depth of the posting thread, successive toggle controls provide increasing detail.
|1||2||1||2 levels / 1 level (original posting)|
|2||3||2||3 levels / 2 levels|
|3||3||All||3 levels / all levels (all postings)|
Dear G4 Experts and developers
I recently tried to add a more modern Random Generator engine to the set used by G4. I developed my class then wrapped it as a descendant in the HepRandomEngine hierarchy. Everything works fine when I use my classes stand-alone, within or outside G4.
When I switch on the multithreading, though I receive a runtime exception :
"Unknown type of RNG Engine - Can cope only with HepJamesRandom, Ranecu, Ranlux64, MTwistEngine, DualRand, Ranlux or Ranshi. Cannot clone this type of RNG engine, as required for this thread"
I went through the code and I found out that the reason for this problem is in the G4UserWorkerThreadInitialization::SetupRNGEngine method.
In this method due to the lack of a polymorphic creation function in the engine interface, the developer decided to place a switch clause to find which is the engine used in the master thread. Obviously this system limits the choice only to the engines already available and known to the developer but doesn't allow any extension.
In fact the developer himself comments:
"Does a new method, such as aNewRng->newEngine() exist to clone it ?"
Is this a known issue? Are there plans to solve this problem? Technically it would be quite easy but it would require a change of the HepRandomEngine interface, or, more simply but less clean, the addition of a "generic clonable engine", derived from HepRandomEngine, as a base class for additional custom engines, which introduces the Create or Clone abstract function to be implemented by the user
|Inline Depth:||Outline Depth:||Add message:|