Skip to content

Commit

Permalink
Merge pull request #869 from valassi/valgrind
Browse files Browse the repository at this point in the history
Update MG5AMC with valgrind fixes (and regenerate all processes)
  • Loading branch information
valassi authored Jun 27, 2024
2 parents a9871fc + 71bb4c2 commit a87e640
Show file tree
Hide file tree
Showing 45 changed files with 179 additions and 16 deletions.
2 changes: 1 addition & 1 deletion MG5aMC/mg5amcnlo
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ index 4fbb8e6ba..f9e2335de 100644
END

diff --git b/epochX/cudacpp/gg_tt.mad/SubProcesses/P1_gg_ttx/driver.f a/epochX/cudacpp/gg_tt.mad/SubProcesses/P1_gg_ttx/driver.f
index 71fbf2b25..0f1d199fc 100644
index 1124a9164..27a6e4674 100644
--- b/epochX/cudacpp/gg_tt.mad/SubProcesses/P1_gg_ttx/driver.f
+++ a/epochX/cudacpp/gg_tt.mad/SubProcesses/P1_gg_ttx/driver.f
@@ -74,13 +74,77 @@ c common/to_colstats/ncols,ncolflow,ncolalt,ic
Expand Down Expand Up @@ -239,7 +239,7 @@ index 71fbf2b25..0f1d199fc 100644
c
c Read process number
c
@@ -207,8 +271,33 @@ c call sample_result(xsec,xerr)
@@ -208,8 +272,33 @@ c call sample_result(xsec,xerr)
c write(*,*) 'Final xsec: ',xsec

rewind(lun)
Expand Down Expand Up @@ -274,7 +274,7 @@ index 71fbf2b25..0f1d199fc 100644
end

c $B$ get_user_params $B$ ! tag for MadWeight
@@ -386,7 +475,7 @@ c
@@ -387,7 +476,7 @@ c
fopened=.false.
tempname=filename
fine=index(tempname,' ')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ Program DRIVER
l2=index(buf,'_')
if(l1.ne.0.and.l2.ne.0.and.l1.lt.l2-1)
$ read(buf(l1+1:l2-1),*,err=11) ngroup
close (lun+1)
11 print *,'Process in group number ',ngroup

c Read weight from results.dat if present, to allow event generation
Expand Down
13 changes: 12 additions & 1 deletion epochX/cudacpp/ee_mumu.mad/SubProcesses/reweight.f
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,17 @@ logical function setclscales(p, keepq2bck, ivec)
external is_octet
setclscales=.true.

setclscales=.true.

c Workaround for valgrind 'Conditional jump or move depends on uninitialised value(s)'
c See https://github.com/mg5amcnlo/mg5amcnlo/issues/111
c FIXME: this is just a workaround to avoid uninitialised values and undefined behaviour...
c FIXME: a real bug is probably hidden in the code (goodjet must be correctly defined!)...
c FIXME: adding this workaround may change the behaviour of existing code...
do i=1,n_max_cl
goodjet(i)=.false. !!FIXME!! there is no reason to choose false instead of true here...
end do

if(ickkw.le.0.and.xqcut.le.0d0.and.q2fact(1).gt.0.and.q2fact(2).gt.0.and.scale.gt.0) then
if(use_syst)then
s_scale(ivec)=scale
Expand Down Expand Up @@ -1227,7 +1238,7 @@ logical function setclscales(p, keepq2bck, ivec)
do i=1,2
do j=1,2
c First adjust goodjet based on iqjets
if(goodjet(ida(i)).and.ipart(j,ida(i)).gt.2)then
if(goodjet(ida(i)).and.ipart(j,ida(i)).gt.2)then ! FIXME: goodjet is uninitialised #111
if(iqjets(ipart(j,ida(i))).eq.0) goodjet(ida(i))=.false.
endif
c Now reset ptclus if jet vertex
Expand Down
1 change: 1 addition & 0 deletions epochX/cudacpp/gg_tt.mad/SubProcesses/P1_gg_ttx/driver.f
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ Program DRIVER
l2=index(buf,'_')
if(l1.ne.0.and.l2.ne.0.and.l1.lt.l2-1)
$ read(buf(l1+1:l2-1),*,err=11) ngroup
close (lun+1)
11 print *,'Process in group number ',ngroup

c Read weight from results.dat if present, to allow event generation
Expand Down
13 changes: 12 additions & 1 deletion epochX/cudacpp/gg_tt.mad/SubProcesses/reweight.f
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,17 @@ logical function setclscales(p, keepq2bck, ivec)
external is_octet
setclscales=.true.

setclscales=.true.

c Workaround for valgrind 'Conditional jump or move depends on uninitialised value(s)'
c See https://github.com/mg5amcnlo/mg5amcnlo/issues/111
c FIXME: this is just a workaround to avoid uninitialised values and undefined behaviour...
c FIXME: a real bug is probably hidden in the code (goodjet must be correctly defined!)...
c FIXME: adding this workaround may change the behaviour of existing code...
do i=1,n_max_cl
goodjet(i)=.false. !!FIXME!! there is no reason to choose false instead of true here...
end do

if(ickkw.le.0.and.xqcut.le.0d0.and.q2fact(1).gt.0.and.q2fact(2).gt.0.and.scale.gt.0) then
if(use_syst)then
s_scale(ivec)=scale
Expand Down Expand Up @@ -1227,7 +1238,7 @@ logical function setclscales(p, keepq2bck, ivec)
do i=1,2
do j=1,2
c First adjust goodjet based on iqjets
if(goodjet(ida(i)).and.ipart(j,ida(i)).gt.2)then
if(goodjet(ida(i)).and.ipart(j,ida(i)).gt.2)then ! FIXME: goodjet is uninitialised #111
if(iqjets(ipart(j,ida(i))).eq.0) goodjet(ida(i))=.false.
endif
c Now reset ptclus if jet vertex
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ Program DRIVER
l2=index(buf,'_')
if(l1.ne.0.and.l2.ne.0.and.l1.lt.l2-1)
$ read(buf(l1+1:l2-1),*,err=11) ngroup
close (lun+1)
11 print *,'Process in group number ',ngroup

c Read weight from results.dat if present, to allow event generation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ Program DRIVER
l2=index(buf,'_')
if(l1.ne.0.and.l2.ne.0.and.l1.lt.l2-1)
$ read(buf(l1+1:l2-1),*,err=11) ngroup
close (lun+1)
11 print *,'Process in group number ',ngroup

c Read weight from results.dat if present, to allow event generation
Expand Down
13 changes: 12 additions & 1 deletion epochX/cudacpp/gg_tt01g.mad/SubProcesses/reweight.f
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,17 @@ logical function setclscales(p, keepq2bck, ivec)
external is_octet
setclscales=.true.

setclscales=.true.

c Workaround for valgrind 'Conditional jump or move depends on uninitialised value(s)'
c See https://github.com/mg5amcnlo/mg5amcnlo/issues/111
c FIXME: this is just a workaround to avoid uninitialised values and undefined behaviour...
c FIXME: a real bug is probably hidden in the code (goodjet must be correctly defined!)...
c FIXME: adding this workaround may change the behaviour of existing code...
do i=1,n_max_cl
goodjet(i)=.false. !!FIXME!! there is no reason to choose false instead of true here...
end do

if(ickkw.le.0.and.xqcut.le.0d0.and.q2fact(1).gt.0.and.q2fact(2).gt.0.and.scale.gt.0) then
if(use_syst)then
s_scale(ivec)=scale
Expand Down Expand Up @@ -1227,7 +1238,7 @@ logical function setclscales(p, keepq2bck, ivec)
do i=1,2
do j=1,2
c First adjust goodjet based on iqjets
if(goodjet(ida(i)).and.ipart(j,ida(i)).gt.2)then
if(goodjet(ida(i)).and.ipart(j,ida(i)).gt.2)then ! FIXME: goodjet is uninitialised #111
if(iqjets(ipart(j,ida(i))).eq.0) goodjet(ida(i))=.false.
endif
c Now reset ptclus if jet vertex
Expand Down
1 change: 1 addition & 0 deletions epochX/cudacpp/gg_ttg.mad/SubProcesses/P1_gg_ttxg/driver.f
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ Program DRIVER
l2=index(buf,'_')
if(l1.ne.0.and.l2.ne.0.and.l1.lt.l2-1)
$ read(buf(l1+1:l2-1),*,err=11) ngroup
close (lun+1)
11 print *,'Process in group number ',ngroup

c Read weight from results.dat if present, to allow event generation
Expand Down
13 changes: 12 additions & 1 deletion epochX/cudacpp/gg_ttg.mad/SubProcesses/reweight.f
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,17 @@ logical function setclscales(p, keepq2bck, ivec)
external is_octet
setclscales=.true.

setclscales=.true.

c Workaround for valgrind 'Conditional jump or move depends on uninitialised value(s)'
c See https://github.com/mg5amcnlo/mg5amcnlo/issues/111
c FIXME: this is just a workaround to avoid uninitialised values and undefined behaviour...
c FIXME: a real bug is probably hidden in the code (goodjet must be correctly defined!)...
c FIXME: adding this workaround may change the behaviour of existing code...
do i=1,n_max_cl
goodjet(i)=.false. !!FIXME!! there is no reason to choose false instead of true here...
end do

if(ickkw.le.0.and.xqcut.le.0d0.and.q2fact(1).gt.0.and.q2fact(2).gt.0.and.scale.gt.0) then
if(use_syst)then
s_scale(ivec)=scale
Expand Down Expand Up @@ -1227,7 +1238,7 @@ logical function setclscales(p, keepq2bck, ivec)
do i=1,2
do j=1,2
c First adjust goodjet based on iqjets
if(goodjet(ida(i)).and.ipart(j,ida(i)).gt.2)then
if(goodjet(ida(i)).and.ipart(j,ida(i)).gt.2)then ! FIXME: goodjet is uninitialised #111
if(iqjets(ipart(j,ida(i))).eq.0) goodjet(ida(i))=.false.
endif
c Now reset ptclus if jet vertex
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ Program DRIVER
l2=index(buf,'_')
if(l1.ne.0.and.l2.ne.0.and.l1.lt.l2-1)
$ read(buf(l1+1:l2-1),*,err=11) ngroup
close (lun+1)
11 print *,'Process in group number ',ngroup

c Read weight from results.dat if present, to allow event generation
Expand Down
13 changes: 12 additions & 1 deletion epochX/cudacpp/gg_ttgg.mad/SubProcesses/reweight.f
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,17 @@ logical function setclscales(p, keepq2bck, ivec)
external is_octet
setclscales=.true.

setclscales=.true.

c Workaround for valgrind 'Conditional jump or move depends on uninitialised value(s)'
c See https://github.com/mg5amcnlo/mg5amcnlo/issues/111
c FIXME: this is just a workaround to avoid uninitialised values and undefined behaviour...
c FIXME: a real bug is probably hidden in the code (goodjet must be correctly defined!)...
c FIXME: adding this workaround may change the behaviour of existing code...
do i=1,n_max_cl
goodjet(i)=.false. !!FIXME!! there is no reason to choose false instead of true here...
end do

if(ickkw.le.0.and.xqcut.le.0d0.and.q2fact(1).gt.0.and.q2fact(2).gt.0.and.scale.gt.0) then
if(use_syst)then
s_scale(ivec)=scale
Expand Down Expand Up @@ -1227,7 +1238,7 @@ logical function setclscales(p, keepq2bck, ivec)
do i=1,2
do j=1,2
c First adjust goodjet based on iqjets
if(goodjet(ida(i)).and.ipart(j,ida(i)).gt.2)then
if(goodjet(ida(i)).and.ipart(j,ida(i)).gt.2)then ! FIXME: goodjet is uninitialised #111
if(iqjets(ipart(j,ida(i))).eq.0) goodjet(ida(i))=.false.
endif
c Now reset ptclus if jet vertex
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ Program DRIVER
l2=index(buf,'_')
if(l1.ne.0.and.l2.ne.0.and.l1.lt.l2-1)
$ read(buf(l1+1:l2-1),*,err=11) ngroup
close (lun+1)
11 print *,'Process in group number ',ngroup

c Read weight from results.dat if present, to allow event generation
Expand Down
13 changes: 12 additions & 1 deletion epochX/cudacpp/gg_ttggg.mad/SubProcesses/reweight.f
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,17 @@ logical function setclscales(p, keepq2bck, ivec)
external is_octet
setclscales=.true.

setclscales=.true.

c Workaround for valgrind 'Conditional jump or move depends on uninitialised value(s)'
c See https://github.com/mg5amcnlo/mg5amcnlo/issues/111
c FIXME: this is just a workaround to avoid uninitialised values and undefined behaviour...
c FIXME: a real bug is probably hidden in the code (goodjet must be correctly defined!)...
c FIXME: adding this workaround may change the behaviour of existing code...
do i=1,n_max_cl
goodjet(i)=.false. !!FIXME!! there is no reason to choose false instead of true here...
end do

if(ickkw.le.0.and.xqcut.le.0d0.and.q2fact(1).gt.0.and.q2fact(2).gt.0.and.scale.gt.0) then
if(use_syst)then
s_scale(ivec)=scale
Expand Down Expand Up @@ -1227,7 +1238,7 @@ logical function setclscales(p, keepq2bck, ivec)
do i=1,2
do j=1,2
c First adjust goodjet based on iqjets
if(goodjet(ida(i)).and.ipart(j,ida(i)).gt.2)then
if(goodjet(ida(i)).and.ipart(j,ida(i)).gt.2)then ! FIXME: goodjet is uninitialised #111
if(iqjets(ipart(j,ida(i))).eq.0) goodjet(ida(i))=.false.
endif
c Now reset ptclus if jet vertex
Expand Down
1 change: 1 addition & 0 deletions epochX/cudacpp/gq_ttq.mad/SubProcesses/P1_gu_ttxu/driver.f
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ Program DRIVER
l2=index(buf,'_')
if(l1.ne.0.and.l2.ne.0.and.l1.lt.l2-1)
$ read(buf(l1+1:l2-1),*,err=11) ngroup
close (lun+1)
11 print *,'Process in group number ',ngroup

c Read weight from results.dat if present, to allow event generation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ Program DRIVER
l2=index(buf,'_')
if(l1.ne.0.and.l2.ne.0.and.l1.lt.l2-1)
$ read(buf(l1+1:l2-1),*,err=11) ngroup
close (lun+1)
11 print *,'Process in group number ',ngroup

c Read weight from results.dat if present, to allow event generation
Expand Down
13 changes: 12 additions & 1 deletion epochX/cudacpp/gq_ttq.mad/SubProcesses/reweight.f
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,17 @@ logical function setclscales(p, keepq2bck, ivec)
external is_octet
setclscales=.true.

setclscales=.true.

c Workaround for valgrind 'Conditional jump or move depends on uninitialised value(s)'
c See https://github.com/mg5amcnlo/mg5amcnlo/issues/111
c FIXME: this is just a workaround to avoid uninitialised values and undefined behaviour...
c FIXME: a real bug is probably hidden in the code (goodjet must be correctly defined!)...
c FIXME: adding this workaround may change the behaviour of existing code...
do i=1,n_max_cl
goodjet(i)=.false. !!FIXME!! there is no reason to choose false instead of true here...
end do

if(ickkw.le.0.and.xqcut.le.0d0.and.q2fact(1).gt.0.and.q2fact(2).gt.0.and.scale.gt.0) then
if(use_syst)then
s_scale(ivec)=scale
Expand Down Expand Up @@ -1227,7 +1238,7 @@ logical function setclscales(p, keepq2bck, ivec)
do i=1,2
do j=1,2
c First adjust goodjet based on iqjets
if(goodjet(ida(i)).and.ipart(j,ida(i)).gt.2)then
if(goodjet(ida(i)).and.ipart(j,ida(i)).gt.2)then ! FIXME: goodjet is uninitialised #111
if(iqjets(ipart(j,ida(i))).eq.0) goodjet(ida(i))=.false.
endif
c Now reset ptclus if jet vertex
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ Program DRIVER
l2=index(buf,'_')
if(l1.ne.0.and.l2.ne.0.and.l1.lt.l2-1)
$ read(buf(l1+1:l2-1),*,err=11) ngroup
close (lun+1)
11 print *,'Process in group number ',ngroup

c Read weight from results.dat if present, to allow event generation
Expand Down
13 changes: 12 additions & 1 deletion epochX/cudacpp/heft_gg_bb.mad/SubProcesses/reweight.f
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,17 @@ logical function setclscales(p, keepq2bck, ivec)
external is_octet
setclscales=.true.

setclscales=.true.

c Workaround for valgrind 'Conditional jump or move depends on uninitialised value(s)'
c See https://github.com/mg5amcnlo/mg5amcnlo/issues/111
c FIXME: this is just a workaround to avoid uninitialised values and undefined behaviour...
c FIXME: a real bug is probably hidden in the code (goodjet must be correctly defined!)...
c FIXME: adding this workaround may change the behaviour of existing code...
do i=1,n_max_cl
goodjet(i)=.false. !!FIXME!! there is no reason to choose false instead of true here...
end do

if(ickkw.le.0.and.xqcut.le.0d0.and.q2fact(1).gt.0.and.q2fact(2).gt.0.and.scale.gt.0) then
if(use_syst)then
s_scale(ivec)=scale
Expand Down Expand Up @@ -1227,7 +1238,7 @@ logical function setclscales(p, keepq2bck, ivec)
do i=1,2
do j=1,2
c First adjust goodjet based on iqjets
if(goodjet(ida(i)).and.ipart(j,ida(i)).gt.2)then
if(goodjet(ida(i)).and.ipart(j,ida(i)).gt.2)then ! FIXME: goodjet is uninitialised #111
if(iqjets(ipart(j,ida(i))).eq.0) goodjet(ida(i))=.false.
endif
c Now reset ptclus if jet vertex
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ Program DRIVER
l2=index(buf,'_')
if(l1.ne.0.and.l2.ne.0.and.l1.lt.l2-1)
$ read(buf(l1+1:l2-1),*,err=11) ngroup
close (lun+1)
11 print *,'Process in group number ',ngroup

c Read weight from results.dat if present, to allow event generation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ Program DRIVER
l2=index(buf,'_')
if(l1.ne.0.and.l2.ne.0.and.l1.lt.l2-1)
$ read(buf(l1+1:l2-1),*,err=11) ngroup
close (lun+1)
11 print *,'Process in group number ',ngroup

c Read weight from results.dat if present, to allow event generation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ Program DRIVER
l2=index(buf,'_')
if(l1.ne.0.and.l2.ne.0.and.l1.lt.l2-1)
$ read(buf(l1+1:l2-1),*,err=11) ngroup
close (lun+1)
11 print *,'Process in group number ',ngroup

c Read weight from results.dat if present, to allow event generation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ Program DRIVER
l2=index(buf,'_')
if(l1.ne.0.and.l2.ne.0.and.l1.lt.l2-1)
$ read(buf(l1+1:l2-1),*,err=11) ngroup
close (lun+1)
11 print *,'Process in group number ',ngroup

c Read weight from results.dat if present, to allow event generation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ Program DRIVER
l2=index(buf,'_')
if(l1.ne.0.and.l2.ne.0.and.l1.lt.l2-1)
$ read(buf(l1+1:l2-1),*,err=11) ngroup
close (lun+1)
11 print *,'Process in group number ',ngroup

c Read weight from results.dat if present, to allow event generation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ Program DRIVER
l2=index(buf,'_')
if(l1.ne.0.and.l2.ne.0.and.l1.lt.l2-1)
$ read(buf(l1+1:l2-1),*,err=11) ngroup
close (lun+1)
11 print *,'Process in group number ',ngroup

c Read weight from results.dat if present, to allow event generation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ Program DRIVER
l2=index(buf,'_')
if(l1.ne.0.and.l2.ne.0.and.l1.lt.l2-1)
$ read(buf(l1+1:l2-1),*,err=11) ngroup
close (lun+1)
11 print *,'Process in group number ',ngroup

c Read weight from results.dat if present, to allow event generation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ Program DRIVER
l2=index(buf,'_')
if(l1.ne.0.and.l2.ne.0.and.l1.lt.l2-1)
$ read(buf(l1+1:l2-1),*,err=11) ngroup
close (lun+1)
11 print *,'Process in group number ',ngroup

c Read weight from results.dat if present, to allow event generation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ Program DRIVER
l2=index(buf,'_')
if(l1.ne.0.and.l2.ne.0.and.l1.lt.l2-1)
$ read(buf(l1+1:l2-1),*,err=11) ngroup
close (lun+1)
11 print *,'Process in group number ',ngroup

c Read weight from results.dat if present, to allow event generation
Expand Down
Loading

0 comments on commit a87e640

Please sign in to comment.