Message: Re: FieldManager handling Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Warning Re: FieldManager handling 

Forum: Multithreading
Re: None FieldManager handling (Andrea Di Simone)
Re: Feedback Re: FieldManager handling (Andrea Dotti)
Re: None Re: FieldManager handling (Andrea Di Simone)
Date: 06 Nov, 2012
From: Andrea Dotti <Andrea Dotti>

FieldManagement has to be thread private!

It really depends on where the snippet of your code is. You need to be sure that each thread calls that piece of code.

Field and Manager classes have data members that have a state that depends on the tracking. For this reason each thread needs its own instance of these classes.

For clarification: 1- The threads share the same G4VUserDetectorConstruction instance (note that the A01DetectorConstruction *detector pointer is a variable defined at global scope and thus shared by all threads).

2- G4VUserDetectorConstruction::Construct() is called only once by the master thread (the one with threadRank==0). This constructs everything as the sequential G4.

3- The worker threads (that have threadRank>0) call ConstructSlave() and thus build only the objects that are thread-specific.

Regards, Andrea

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 None: Re: FieldManager handling   (Andrea Di Simone - 06 Nov, 2012)
(_ Feedback: Re: FieldManager handling   (Andrea Dotti - 06 Nov, 2012)
(_ None: Re: FieldManager handling   (Andrea Di Simone - 07 Nov, 2012)
 Add Message Add Message
to: "Re: FieldManager handling"

 Subscribe Subscribe

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