Multithreading issue with /run/numberOfThreads

Hello! These are the first lines of my macro file for a user-written code:

/control/verbose 0
/run/verbose 0
/tracking/verbose 2
/run/numberOfThreads 32

And I ran into this error:

***** Illegal application state </run/numberOfThreads 32> *****
***** Batch is interrupted!! *****

Does anyone happen to know why? I saw that people have encountered this issue before, and that was due to /run/numberOfThreads going after /run/initialize; I tried changing the order of /run/numberOfThreads around but that doesn’t work.

Please let me know. Thank you so much!

Geant4 Version: 11.1
Operating System: MacOS, M1
Compiler/Version: g++ (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
CMake Version: 3.20.1

Is Initialize() for the run manager being called in the main() or elsewhere of the program? /run/numberOfThreads can only be called at the PreInit state, so it looks like initialization has been done by the point in execution the script is run.

Omg you’re right. It’s working now, thank you so much!