Message: Re: Clear the memory allocated for G4VPrimitiveScorer? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Feedback Re: Clear the memory allocated for G4VPrimitiveScorer? 

Forum: Biasing and Scoring
Re: Question Clear the memory allocated for G4VPrimitiveScorer? (Clare Huang)
Re: None Re: Clear the memory allocated for G4VPrimitiveScorer? (Tsukasa Aso)
Re: None Re: Clear the memory allocated for G4VPrimitiveScorer? (Clare Huang)
Re: Question Re: Clear the memory allocated for G4VPrimitiveScorer? (Philipp Roser)
Date: 08 May, 2018
From: Pedro Arce <Pedro Arce>

In my opinion the problem is that the scores are saved as an std::map<int,double>. STL maps are supposed to be the faster way, but they occupy a lot of memory, 64 bytes in this case. The problem is that if you have millions of voxels it has to store the full set of indices until the end of the run. And, I do not really know how the multithreading it is implemented, but if the scores map is not shared among threads, you have to multiply by the number of threads. You can check if this is the reason by printing the size of your RunMap. I implemented an alternative solution, using std::vector<float>, but this means that you have to reserve the full memory at the beginning (so it is only worth if you are filling a good proportion of the indices).

Pedro

 Add Message Add Message
to: "Re: Clear the memory allocated for G4VPrimitiveScorer?"

 Subscribe Subscribe

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