Multi-threaded operation problem

Experts I recently found that I could not enable multi-threaded mode when running the program. G4 gave me an error message.

-------- EEEE ------- G4Exception-START -------- EEEE -------

*** ExceptionHandler is not defined ***
*** G4Exception : Run0107
      issued by : G4RunManager::G4RunManager(G4bool)
Geant4 code is compiled without multi-threading support (-DG4MULTITHREADED is set to off). This type of RunManager can only be used in mult-threaded applications.
*** Fatal Exception ***
-------- EEEE ------- G4Exception-END -------- EEEE -------

*** G4Exception: Aborting execution ***

I enable multi-threaded mode with the following program.

auto runManager = new G4MTRunManager;
/run/numberOfThreads 8

I’m not sure what went wrong and I’m looking forward to your responses.

You built your G4 with multithreaded disabled at compile time. That’s what the error message is telling you.

Thank you for your reply, please ask where this needs to be contacted for this ban.

It’s not a ban. It’s a choice you made when you built your G4 installation. If you G4 installation was built by someone else (perhaps you’re working on a large computing cluster?), then the choice was made by whomever did the build.

The error message you posted tells you what was set in the original cmake command. You may also read the Geant4 Installation Guide for details.

You can start installation again adding -DGEANT4_BUILD_MULTITHREADED=ON during cmake.

Thanks for your reply, I have now put this code into my own installation of G411.0 and it now enables multi-threaded mode properly.

1 Like

Thanks for the method you provided I will try it on my next run.

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