Skip to content

Commit

Permalink
[fpe] in gq_ttq.mad, add -g to make_opts and cudacpp.mk, and switch o…
Browse files Browse the repository at this point in the history
…ff OpenMP, to debug madgraph5#845

As previously observed, this crashes immediately (NB: it only crashes with AVX512 in '512z' mode!)

gdb ./madevent_cpp -ex 'set pagination off' -ex 'set confirm off' -ex 'set trace-commands on' \
  -ex 'run < /tmp/avalassi/input_gqttq_x1_cudacpp' -ex where -ex l -ex 'p okcol' -ex quit

Program received signal SIGFPE, Arithmetic exception.
0x00007ffff7f98dbd in mg5amcCpu::sigmaKin (allmomenta=0x7ffff76bf040, allcouplings=0x7ffff7b57040, allrndhel=<optimized out>, allrndcol=0x6300d00, allMEs=0x6310d80, channelId=channelId@entry=1, allNumerators=0x6341000, allDenominators=0x6351080, allselhel=0x6320e00, allselcol=0x6330e80, nevt=16384) at CPPProcess.cc:1197
1197                if( okcol )
+where
 0  0x00007ffff7f98dbd in mg5amcCpu::sigmaKin (allmomenta=0x7ffff76bf040, allcouplings=0x7ffff7b57040, allrndhel=<optimized out>, allrndcol=0x6300d00, allMEs=0x6310d80, channelId=channelId@entry=1, allNumerators=0x6341000, allDenominators=0x6351080, allselhel=0x6320e00, allselcol=0x6330e80, nevt=16384) at CPPProcess.cc:1197
 1  0x00007ffff7f9fa3e in mg5amcCpu::MatrixElementKernelHost::computeMatrixElements (this=0x6340ee0, channelId=channelId@entry=1) at MatrixElementKernels.cc:115
 2  0x00007ffff7fa52d2 in mg5amcCpu::Bridge<double>::cpu_sequence (goodHelOnly=false, selcol=0x7fffffc1cc70, selhel=0x7fffffc2cc70, mes=0x7fffffc3cc70, channelId=1, rndcol=0x7fffffc9cfd0, rndhel=0x7fffffcbcfd0, gs=0x1d35a68 <strong_+8>, momenta=<optimized out>, this=0x62e0a70) at /usr/include/c++/11/bits/unique_ptr.h:173
 3  fbridgesequence_ (ppbridge=<optimized out>, momenta=<optimized out>, gs=0x1d35a68 <strong_+8>, rndhel=0x7fffffcbcfd0, rndcol=0x7fffffc9cfd0, pchannelId=<optimized out>, mes=0x7fffffc3cc70, selhel=0x7fffffc2cc70, selcol=0x7fffffc1cc70) at fbridge.cc:106
 4  0x00000000004300ec in smatrix1_multi (p_multi=<error reading variable: value requires 2621440 bytes, which is more than max-value-size>, hel_rand=<error reading variable: value requires 131072 bytes, which is more than max-value-size>, col_rand=<error reading variable: value requires 131072 bytes, which is more than max-value-size>, channel=1, out=<error reading variable: value requires 131072 bytes, which is more than max-value-size>, selected_hel=..., selected_col=..., vecsize_used=16384) at auto_dsig1.f:618
 5  0x0000000000431c71 in dsig1_vec (all_pp=<error reading variable: value requires 2621440 bytes, which is more than max-value-size>, all_xbk=<error reading variable: value requires 262144 bytes, which is more than max-value-size>, all_q2fact=<error reading variable: value requires 262144 bytes, which is more than max-value-size>, all_cm_rap=<error reading variable: value requires 131072 bytes, which is more than max-value-size>, all_wgt=<error reading variable: value requires 131072 bytes, which is more than max-value-size>, imode=0, all_out=<error reading variable: value requires 131072 bytes, which is more than max-value-size>, vecsize_used=16384) at auto_dsig1.f:445
 6  0x0000000000432da8 in dsigproc_vec (all_p=..., all_xbk=<error reading variable: value requires 262144 bytes, which is more than max-value-size>, all_q2fact=<error reading variable: value requires 262144 bytes, which is more than max-value-size>, all_cm_rap=<error reading variable: value requires 131072 bytes, which is more than max-value-size>, iconf=1, iproc=1, imirror=1, symconf=..., confsub=..., all_wgt=<error reading variable: value requires 131072 bytes, which is more than max-value-size>, imode=0, all_out=<error reading variable: value requires 131072 bytes, which is more than max-value-size>, vecsize_used=16384) at auto_dsig.f:1034
 7  0x0000000000433b7f in dsig_vec (all_p=..., all_wgt=..., all_xbk=..., all_q2fact=..., all_cm_rap=..., iconf=1, iproc=1, imirror=1, all_out=..., vecsize_used=16384) at auto_dsig.f:327
 8  0x000000000044a9c2 in sample_full (ndim=7, ncall=8192, itmax=1, itmin=1, dsig=0x433d70 <dsig>, ninvar=7, nconfigs=1, vecsize_used=16384) at dsample.f:208
 9  0x000000000042ebe0 in driver () at driver.f:257
 10 0x000000000040371f in main (argc=<optimized out>, argv=<optimized out>) at driver.f:302
 11 0x00007ffff743feb0 in __libc_start_call_main () from /lib64/libc.so.6
 12 0x00007ffff743ff60 in __libc_start_main_impl () from /lib64/libc.so.6
 13 0x0000000000403845 in _start ()
+l
1192    #if defined MGONGPU_CPPSIMD
1193                const bool okcol = allrndcol[ievt] < ( targetamp[icolC][ieppV] / targetamp[ncolor - 1][ieppV] );
1194    #else
1195                const bool okcol = allrndcol[ievt] < ( targetamp[icolC] / targetamp[ncolor - 1] );
1196    #endif
1197                if( okcol )
1198                {
1199                  allselcol[ievt] = icolC + 1; // NB Fortran [1,ncolor], cudacpp [0,ncolor-1]
1200                  break;
1201                }
+p okcol
$1 = <optimized out>
  • Loading branch information
valassi committed Jun 28, 2024
1 parent afa50dc commit 4df870b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion epochX/cudacpp/gq_ttq.mad/Source/make_opts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
DEFAULT_CPP_COMPILER=g++
DEFAULT_F2PY_COMPILER=f2py3
DEFAULT_F_COMPILER=gfortran
GLOBAL_FLAG=-O3 -ffast-math -fbounds-check
GLOBAL_FLAG=-O3 -ffast-math -fbounds-check -g
MACFLAG=
MG5AMC_VERSION=SpecifiedByMG5aMCAtRunTime
PYTHIA8_PATH=NotInstalled
Expand Down
4 changes: 3 additions & 1 deletion epochX/cudacpp/gq_ttq.mad/SubProcesses/cudacpp.mk
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ ifeq ($(shell $(CXX) --version | grep ^nvc++),)
CXXFLAGS += -ffast-math # see issue #117
endif
###CXXFLAGS+= -Ofast # performance is not different from --fast-math
###CXXFLAGS+= -g # FOR DEBUGGING ONLY
CXXFLAGS+= -g # FOR DEBUGGING ONLY

# Optionally add debug flags to display the full list of flags (eg on Darwin)
###CXXFLAGS+= -v
Expand Down Expand Up @@ -369,6 +369,8 @@ endif

#=== Configure defaults for OMPFLAGS

OMPFLAGS= # FOR DEBUGGING ONLY (disable OMP)

# To build without OpenMP, you must set externally OMPFLAGS to an empty string (#758)
ifeq ($(origin OMPFLAGS),undefined)
###$(info OMPFLAGS was not set externally: will override it to a default value)
Expand Down

0 comments on commit 4df870b

Please sign in to comment.