When I G4HadronicParameters::Instance()->SetVerboseLevel(0); I get, in each thread G4WT0 > G4HadronicProcess::BuildPhysicsTable: for photonNuclear and gamma fail due to undefined pointer to the master process
Hi, John, in what application? Or as minimum with which Physics List? Vladimir
Hi Vladimir In a very simple application firing 4 MeV gammas into a block of Lutetium. // Physics list const auto physList = G4PhysListFactory().GetReferencePhysList("FTFP_BERT_EMZ"); physList->SetVerboseLevel(0); runManager->SetUserInitialization(physList); G4HadronicParameters::Instance()->SetVerboseLevel(0); It's not a big problem for me. The message appears only once per thread independent of number of events. The relevant bit of code seems to be G4HadronicProcess.cc:220: if(nullptr == masterProcess) { masterProcess = dynamic_cast<const G4HadronicProcess*>(GetMasterProcess()); } if(nullptr == masterProcess) { G4cout << "G4HadronicProcess::BuildPhysicsTable: for " << GetProcessName() << " and " << p.GetParticleName() << " fail due to undefined pointer to the master process" << G4endl; } else { // initialisation in worker threads fXSType = masterProcess->CrossSectionType(); fXSpeaks = masterProcess->TwoPeaksXS(); theEnergyOfCrossSectionMax = masterProcess->EnergyOfCrossSectionMax(); } If I do not "G4HadronicParameters::Instance()->SetVerboseLevel(0)", the message does not appear but, of course, I get lots of output that I wish to suppress. Cheers, John
P.S. I'm guessing that if param->GetVerboseLevel()>0, masterProcess is instantiated somewhere else, whereas if param->GetVerboseLevel()==0, it triggers the warning message, but gets instantiated in the "else" clause anyway, so all's well. It's just annoying message.
Hi John, at Lunux I have added lines to the main of Hadr00.cc example: runManager->SetUserInitialization(phys); phys->SetVerboseLevel(0); det->SetPhysicsList(phys); G4HadronicParameters::Instance()->SetVerboseLevel(0); use modified hadr00.in macro - comment out the first line limiting printout in threads and use the command: $G4BWORK/Hadr00 hadr00.in FTFP_BERT_EMZ 2 No problem is observed. It well may be that the problem is seen at MAC and not at Linux. To avoid misunderstanding can you, please, reproduce the problem in Hadr00? Vladimir
Hi John, Lines of code in G4HadronicProcess, which you have shown, has relation to threading and not to verbosity level, so we need to reproduce this problem locally, because not clear how verbosity level connect to instantiation of processes per thread. May be there is a difference in MAC and Linux. Have you tried the same job for the case of 1 thread? Vladimir
Hi John, the problem was due to specifics of G4GammaGeneralProcess in the MT mode. It is fixed and the fix may be back-ported to the patch. Cheers, Vladimir