Hi all,
I am trying to store the kinetic energy of neutrons passing through a sensitive volume, by passing the data from each steppingAction to the eventAction, and from each eventAction to the runAction, and finally save the data in a .txt file, at the end of the runAction.
The code works fine in the sequential mode, but as I switch to multi-thread mode, and use: if(IsMaster()) at the end of the runAction to store the data by the master thread, the data file will be empty. However typing: if(!IsMaster()) to store the data by the worker threads the data exist in the file.
How can I fix the problem, to be able to store the data by the master thread?
Thanks,
Nima