Message: Is RunManager C++ compilation optimization option dependent? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Is RunManager C++ compilation optimization option dependent? 

Forum: Run Management
Date: 30 Aug, 2018
From: Abhijit Bhattacharyya <Abhijit Bhattacharyya>

I see one strange effect of optimization.

If I compile my Geant4 10.5.0 (Multithreading) based code using

cmake ../ -DCMAKE_BUILD_TYPE="Release" -DCMAKE_CXX_FLAGS="-std=c++11 -O3"

and then run, I see core dump through following steps

Code is started with 4 threads. 
 Define Blocks in ParallelWorld  initialised.
G4PhysListFactory::GetReferencePhysList <QGSP_BIC_HP>  EMoption= 0
<<< Geant4 Physics List simulation engine: QGSP_BIC_HP 2.0
<<< Reference Physics List QGSP_BIC_HP is built
BookHisto Ntuples created.
Root data is being stored.
BookHisto Ntuples created.
Root data is being stored.
***** Table : Nb of materials = 0 *****
./NeutVEGA.run: line 32: 29855 Segmentation fault      (core dumped) ./tarcVega Data/GeomData/tarc_geometry.gdml -m $1
real	0m0.428s
user	0m0.105s
sys	0m0.046s

If I analyse the dumped core with the executable code in gdb then I see that

Reading symbols from ./NeutVega...(no debugging symbols found)...done.
[New LWP 29855]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `./tarcVega Data/GeomData/tarc_geometry.gdml -m run.mac'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f5d61d92007 in G4RunManagerKernel::DefineWorldVolume(G4VPhysicalVolume*, bool) ()
   from /opt/G4MT_Master/share/Geant4-10.5.0/../../lib/libG4run.so
(gdb) 
(gdb) 
(gdb) bt
#0  0x00007f5d61d92007 in G4RunManagerKernel::DefineWorldVolume(G4VPhysicalVolume*, bool) ()
   from /opt/G4MT_Master/share/Geant4-10.5.0/../../lib/libG4run.so
#1  0x00007f5d61d7a0be in G4RunManager::InitializeGeometry() ()
   from /opt/G4MT_Master/share/Geant4-10.5.0/../../lib/libG4run.so
#2  0x00007f5d61d7d7a9 in G4RunManager::Initialize() ()
   from /opt/G4MT_Master/share/Geant4-10.5.0/../../lib/libG4run.so
#3  0x00007f5d61d85179 in G4MTRunManager::Initialize() ()
   from /opt/G4MT_Master/share/Geant4-10.5.0/../../lib/libG4run.so
#4  0x000056405b4ee3df in main ()
(gdb) 

However, if I compile the same code without any modification using

cmake ../ -DCMAKE_BUILD_TYPE="Debug" -DCMAKE_CXX_FLAGS="-std=c++11 -O1 -g"

then I do not see error and the code runs.

Is it normal or I have problem in Geometry. By the by, I am using imported GDML file.

Thanks and Regards Abhijit

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 None: Re: Is RunManager C++ compilation optimization option dependent?   (Asai, Makoto - 30 Aug, 2018)
(_ None: Re: Is RunManager C++ compilation optimization option dependent?   (Abhijit Bhattacharyya - 30 Aug, 2018)
(_ Feedback: Re: Is RunManager C++ compilation optimization option dependent?   (Abhijit Bhattacharyya - 30 Aug, 2018)
 Add Message Add Message
to: "Is RunManager C++ compilation optimization option dependent?"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]