Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash in FSI code when running on hydrogen target #33

Closed
karuboniru opened this issue Sep 23, 2024 · 2 comments · Fixed by #34
Closed

Crash in FSI code when running on hydrogen target #33

karuboniru opened this issue Sep 23, 2024 · 2 comments · Fixed by #34

Comments

@karuboniru
Copy link
Contributor

karuboniru commented Sep 23, 2024

input file to reproduce the issue


The traceback is:

#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#1  0x00007ffff5680793 in __pthread_kill_internal (threadid=<optimized out>, signo=6) at pthread_kill.c:78
#2  0x00007ffff5627d0e in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3  0x00007ffff560f942 in __GI_abort () at abort.c:79
#4  0x00007ffff560f85e in __assert_fail_base (fmt=0x7ffff57c3cb0 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x220b53 "E>=_mass", file=file@entry=0x21fb38 "src/particle.h", 
    line=line@entry=227, function=function@entry=0x21f680 "void particle::set_energy(double)") at assert.c:94
#5  0x00007ffff561fe47 in __assert_fail (assertion=0x220b53 "E>=_mass", file=0x21fb38 "src/particle.h", line=227, function=0x21f680 "void particle::set_energy(double)") at assert.c:103
#6  0x0000000000507a95 in particle::set_energy (this=0x7fffffffc110, E=<optimized out>) at src/particle.h:220
#7  particle::set_energy (this=0x7fffffffc110, E=<optimized out>) at src/particle.h:220
#8  kaskada::prepare_particles (this=this@entry=0x7fffffffc690) at src/kaskada7.cc:145
#9  0x000000000050824c in kaskada::kaskadaevent (this=this@entry=0x7fffffffc690) at src/kaskada7.cc:41
#10 0x00000000004d1359 in NuWro::finishevent (this=this@entry=0x724c60 <nuwro>, e=0x29ffd90, p=...) at src/nuwro.cc:513
#11 0x00000000004d7e99 in NuWro::real_events (this=this@entry=0x724c60 <nuwro>, p=...) at src/nuwro.cc:841
#12 0x00000000004e3675 in NuWro::main (this=0x724c60 <nuwro>, argc=5, argv=0x7fffffffd588) at src/nuwro.cc:1004
#13 0x000000000051c15a in main (argc=5, argv=0x7fffffffd588) at src/main.cc:34

The problem causing code is following:

nuwro/src/kaskada7.cc

Lines 142 to 145 in c8d29a6

if(par.nucleus_target) p1.set_fermi(nucl->hyp_BE(p1.r.length(),p1.pdg));
else p1.set_fermi(0);
p1.set_energy(p1.E() + p1.his_fermi);

  • the code set the binding energy by checking par.nucleus_target which is 2 in the input (which I think should never happen, so the condition to do set_fermi is the code causing the issue)
    gdb> p par.nucleus_target
    $2 = 2
    
  • The related sigma has a quite low momentum
    $3 = {
      <vect> = {
        t = 1244.7778345721508,
        x = 39.566419917875351,
        y = 97.297454760823186,
        z = 351.90703922212208
      }, 
      members of particle:
      _mass = 1189.3700000000003,
      r = {
        t = 0,
        x = 0,
        y = 0,
        z = 0
      },
      pdg = 3222,
      ks = 1 '\001',
      orgin = 3 '\003',
      travelled = 0,
      id = 3,
      mother = 0,
      endproc = -1,
      his_fermi = -70,
      primary = false
    }
    
  • The substraction of binding energy caused the issue.

I am unsure if this should be considered as invalid input or something. But if we want to properly handle the input we might want to

  • reset the nucleus_target to 0 when nucleon target is configured;
  • add another check like nucleus_p + nucleus_n > 1 to everywhere it applies (or disable FSI for nucleon target).
@jsobczyk
Copy link
Member

jsobczyk commented Sep 23, 2024 via email

@karuboniru
Copy link
Contributor Author

Yes, if the code in kaskada7 only does FSI then we should be safe to skip them for nucleon target. (See the PR #34)

While when reading the code, it seems that the actual cascade starts from following line

while (parts.size () > 0 and nucl->Ar() > 0) // main loop in cascade

and the check of nucl->Ar() > 0 should be able to make the code to skip nucleon target as we wanted. The code before cascade seems to be doing something else like "make sure about the energy balance" (from the text in comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants