RickKessler / SNANA

Supernova Analysis package
38 stars 23 forks source link

Seg Fault when using SNIax and TAKE_SPECTRUM #1148

Closed benjaminrose closed 1 year ago

benjaminrose commented 1 year ago

For some reason, when using TAKE_SPECTRUM(DEEP-PRISM): MJD(61000:61725:10) TEXPOSE_ZPOLY(3600) on the SNIax model (taken from PLASRICC_ROOT), I get a seg fault.

An example of the failing command can be found at $SNANA_DEBUG/brose3/1ax_take_spectrum.

The end of the output from snlc_sim.exe is:

 ******************************************************************
   INIT_SPECTROGRAPH_SEDMODEL : prep NONIA spectra for WFIRST_PRISM (NBLAM=206)
         206 wavelength bins, 7402.8 to 18492.7 A
         magSpecBin(AB,  6358.6 - 18429.2 A) = interpolated value

 ******************************************************************
   README_DOCANA_DRIVER: Prepare README content (iflag=1)

 ******************************************************************
   clr_VERSION
         LCMERGE Version TMP_bros_PIP_PIPPIN_ROMAN_TRANS_SN_NONIaMODEL3-0001_38176 does not exist.
         SIM Version TMP_bros_PIP_PIPPIN_ROMAN_TRANS_SN_NONIaMODEL3-0001_38176 does not exist.
         PHOTOMETRY Version TMP_bros_PIP_PIPPIN_ROMAN_TRANS_SN_NONIaMODEL3-0001_38176 does not exist.
mkdir: cannot create directory ‘/scratch/midway2/rkessler/SNDATA_ROOT/SIM/TMP_bros_PIP_PIPPIN_ROMAN_TRANS_SN_NONIaMODEL3-0001_38’: File exists
mkdir: cannot create directory ‘/project2/rkessler/SURVEYS/WFIRST/USERS/brose3/roman/SEARCHEFF_PIPELINE_LOGIC.DAT’: File exists

 *** Break *** segmentation violation

===========================================================
There was a crash.
This is the entire stack trace of all threads:
===========================================================
#0  0x00007ff33533146c in waitpid () from /lib64/libc.so.6
#1  0x00007ff3352aef62 in do_system () from /lib64/libc.so.6
#2  0x00007ff339a1ae59 in TUnixSystem::StackTrace() () from /software/ROOT-5.34.14-el7-x86_64/lib/libCore.so
#3  0x00007ff339a1ca5c in TUnixSystem::DispatchSignals(ESignals) () from /software/ROOT-5.34.14-el7-x86_64/lib/libCore.so
#4  <signal handler called>
#5  0x00007ff3352b462d in vfprintf () from /lib64/libc.so.6
#6  0x00007ff3352bf407 in fprintf () from /lib64/libc.so.6
#7  0x00000000004397f5 in init_simFiles ()
#8  0x0000000000442464 in main ()
===========================================================

The lines below might hint at the cause of the crash.
If they do not help you then please submit a bug report at
http://root.cern.ch/bugs. Please post the ENTIRE stack trace
from above as an attachment in addition to anything else
that might help us fixing this issue.
===========================================================
#5  0x00007ff3352b462d in vfprintf () from /lib64/libc.so.6
#6  0x00007ff3352bf407 in fprintf () from /lib64/libc.so.6
#7  0x00000000004397f5 in init_simFiles ()
#8  0x0000000000442464 in main ()
===========================================================
RickKessler commented 1 year ago

Unfortunately TAKE_SPECTRUM doesn't work with SIMSED models because it pre-computes all magnitudes on a multidimensional grid and then loses the SEDs to avoid using too much memory. There is a relatively simple way to convert a SIMSED model into a NONIASED model that allows TAKE_SPECTRUM keys. I will post again after setting up an example.

RickKessler commented 1 year ago

Looks like you already used the NON1ASED feature for TAKE_SPECTRUM keys. The seg fault was due to the large number of NON1A keys (1000 keys) causing the README_DOC list to be exceeded. Fix is to change MXDOCLINE = 1000 -> 2000