The number of threads in Multithread will have a impact on results?

Hello,my program simulating neutron generation first set number of thread 64,after i change it to 20,the yield of neutron decreases.So ,i tried 1,10,30,40 as the number of threads.i find that the yield of neutron will increase along with the increasing of nOfThreads(i change nothing except nOfThreads) .Could told me why?
i use g4root to analysis the raw data and just use histogram to collect data about neutron.

I’m experiencing a very similar thing (G4 version 11.0.1), except my neutron count goes down with thread number. I’ve been trying to work out why this is the case for a while now.

If anyone has any thoughts, ideas or tests that could be done, it’d be very much appreciated.

So when I run the simulation, for example (./Sim mac.mac n), I get different neutron counts from my SD. I’m running a modified radioactive decay/Activation example.

In my simulation, I have a pencil beam of deuterons incident on a G4Box of lithium. Neutrons are produced in which the distribution has a forward bias. These neutrons that enter the SD are counted.

I tried (in MySD.cc)
aStep->IsFirstStepInVolume()
aStep->GetPreStepPoint()->GetPosition()
Track->SetTrackStatus(fStopAndKill) // To see if the primary neutrons are creating new neutrons in the SD.

I sent the neutron count (primary neutrons passing through SD surface) to Run.cc where they are counted. However, the neutron count is always the same. It only differs when I change the thread count using (./Sim mac.mac n) where n is the number of thread I want to use.

Neutron passing through the SD.
1 Thread = 1600746606 neutrons
6 threads = 824725087 neutrons
8 threads = 674259323 neutrons

A peculiarity I found which could be a clue, is that the neutron count doesn’t change when changing the seed in the macro file (/random/setSeed) made to run the simulation, however, other things do change, such as the number of elements and isotopes created.

Can anyone offer any assistance to solving this?
I can provide snippets of code if needed and answer any questions.