Multithread mode

Hi, dear experts

I am interested in showing only the final result in the terminal during using Multithread mode.

Best regards

That looks like printout in your own code. You can wrap that output in an if-condition:

#include "G4Threading.hh"
...
  if (IsMaster()) {
    G4cout << "blah blah blah << G4endl;
  }

Thank You so much!
I did it but doesn’t work(
Could you give me more tips, please?


look for accumulable in the examples (or in the documentation Accumulables — Book For Application Developers 11.0 documentation)

the master thread does not process events, hence the values stay zero in your code. you could merge the results of the worker threads with the help of said accumulables

Thank You so much! But, it doesn’t work.
Could You help me to correct my code, please?


can you show the code where you register or create the accumulable? check the documentation, there is code to copy from…

Thank You for your reply
What is the problem here, I don’t understand… Could you help me, please?


transmission, reflection and lost need to be different types, as described in the documentation. check the header file for your runaction, think you skipped the necessary changes there.

I can recommend reading the documentation and studying the examples mentioned there. if something does not work, compare what is different in your code :slight_smile:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.