|Message: too much particles generated in PrimaryGeneratorAction caused core dumped||Not Logged In (login)|
Click on the Forum title, e.g. on the "Forums by Category" page, to read a sequence of postings to the Forum and its threads all in one page. If you are only interested in one thread or the thread following a specific posting, click the thread or the posting, which takes you to a smaller page, which contains only the part you are interested in and may be easier to navigate.
Messages are "chained" if there are only replies at the first level, i.e. 1/1.html, 1/1/1.html etc. In case of "chained" messages the message number is replaced by the icon and there is no indentation.
Inline: Display the subject line only or also the text of the posting(s); for the choice "All" the "Outline" choices are switched off.
|1||0||1||no text / full text of posting|
|2||1||All||text for level 1 only / text for All postings|
Outline: Choose the depth of the posting thread, successive toggle controls provide increasing detail.
|1||2||1||2 levels / 1 level (original posting)|
|2||3||2||3 levels / 2 levels|
|3||3||All||3 levels / all levels (all postings)|
I'm using geant4.9.3 on Fedora 12. I'm building a simple simulation where deuteron beams are shot towards a thin beryllium plate and measure its neutron and gamma distributions.
My problem is, whenever I initialize the particle gun with too many particles in PrimaryGeneratorAction.cc, it will cause segmentation error. For example, if in one beam I shoot 1 million particles, after finishing one event the program will ends with the error (from gdb)
Program received signal SIGSEGV, Segmentation fault. 0x034edaaa in G4PrimaryParticle::~G4PrimaryParticle (this=0xc01c298, __in_chrg=<value optimized out>) at src/G4PrimaryParticle.cc:106 106 G4PrimaryParticle::~G4PrimaryParticle() (gdb) bt #0 0x034edaaa in G4PrimaryParticle::~G4PrimaryParticle (this=0xc01c298, __in_chrg=<value optimized out>) at src/G4PrimaryParticle.cc:106 #1 0x034edad1 in G4PrimaryParticle::~G4PrimaryParticle (this=0xc01c230, __in_chrg=<value optimized out>) at src/G4PrimaryParticle.cc:109 #2 0x034edad1 in G4PrimaryParticle::~G4PrimaryParticle (this=0xc01c1c8, __in_chrg=<value optimized out>)
and it stops. If I initialized with 10^8 particles, the program could not run at all. A backtrace gives
### Run 0 start. terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc
Program received signal SIGABRT, Aborted. 0x006da424 in __kernel_vsyscall () (gdb) bt #0 0x006da424 in __kernel_vsyscall () #1 0x02b31a91 in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64 #2 0x02b3335a in abort () at abort.c:92 #3 0x028b4a77 in __gnu_cxx::__verbose_terminate_handler () at ../../../../libstdc++-v3/libsupc++/vterminate.cc:93 #4 0x028b28f6 in __cxxabiv1::__terminate (handler= 0x28b4910 <__gnu_cxx::__verbose_terminate_handler()>) at ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:38 #5 0x028b2933 in std::terminate () at ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:48 #6 0x028b2a72 in __cxxabiv1::__cxa_throw (obj=0xbfeffdc8, tinfo=0x28e5f5c, dest= 0x28b2f10 <std::bad_alloc::~bad_alloc()>) at ../../../../libstdc++-v3/libsupc++/eh_throw.cc:83 #7 0x028b3007 in operator new (sz=1008) at ../../../../libstdc++-v3/libsupc++/new_op.cc:58 #8 0x028b30ee in operator new (sz=1008) at ../../../../libstdc++-v3/libsupc++/new_opv.cc:32 #9 0x01e0b9a3 in G4AllocatorPool::G4PoolChunk::G4PoolChunk (this=0xbfeffd58, sz=1008) at include/G4AllocatorPool.hh:86 #10 0x01e0b8bc in G4AllocatorPool::Grow (this=0x3a7e920) at src/G4AllocatorPool.cc:115 #11 0x0051aacd in G4AllocatorPool::Alloc (this=0x3a7e920) at /home/neohys/geant4/geant4.9.3/include/G4AllocatorPool.hh:116 #12 0x00df2387 in G4Allocator<G4PrimaryParticle>::MallocSingle (this=0x3a7e920) at /home/neohys/geant4/geant4.9.3/source/global/management/include/G4Allocator.hh:179 #13 0x00df1e96 in G4PrimaryParticle::operator new () at /home/neohys/geant4/geant4.9.3/source/particles/management/include/G4PrimaryParticle.hh:219 #14 0x02f6029c in G4ParticleGun::GeneratePrimaryVertex (this=0x818b560, evt=0x9522a90) at src/G4ParticleGun.cc:216
Is there suppose a limit in the number of particles that I can initialize in a beam? Because I plan to simulate 5Coulomb of deuteron beam, does that mean I need to break smaller number of particles into different events?
Thanks for your attention
|Inline Depth:||Outline Depth:||Add message:|