Skip to content

Commit

Permalink
Merge branch 'runcard' (including latest upstream/master with "june24…
Browse files Browse the repository at this point in the history
…") into grid
  • Loading branch information
valassi committed Sep 10, 2024
2 parents 58f4e11 + e02dfd1 commit 13f73b6
Show file tree
Hide file tree
Showing 2,527 changed files with 1,122,567 additions and 167,322 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: C/C++ CI

on:
push:
branches: [ master ]
branches: [ master, master_june24 ]
pull_request:
branches: [ master ]
branches: [ master, master_june24 ]

jobs:
debug_builds:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/testsuite_allprocesses.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:

# Trigger the all-processes workflow for pull requests to master
pull_request:
branches: [ master ]
branches: [ master, master_june24 ]

# Trigger the all-processes workflow when new changes to the workflow are pushed
# (NB: this is now disabled to avoid triggering two jobs when pushing to a branch for which a PR is opened)
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/testsuite_oneprocess.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ function ECHO() { echo " "; }
echo "Executing $0 $*"; ECHO
topdir=$(cd $(dirname $0)/../..; pwd)

# Disable OpenMP in the CI tests
# To do this, set OMPFLAGS externally to an empty string (#758)
export OMPFLAGS=
# Enable OpenMP in the CI tests? (#758)
###export USEOPENMP=1

# Debug channelid in MatrixElementKernelBase?
export MG5AMC_CHANNELID_DEBUG=1

# Bypass known issues?
BYPASS_KNOWN_ISSUES=0 # do not bypass known issues (fail)
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/testsuite_oneprocess.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ on:
required: true
type: choice
# FIXME? Can the list of supported processes be specified only once in oneprocess.yml or allprocesses.yml?
options: [gg_tt.mad, gg_ttg.mad, gg_ttgg.mad, gg_ttggg.mad, ee_mumu.mad, nobm_pp_ttW.mad]
###options: [ee_mumu.mad, gg_tt.mad, gg_ttg.mad, gg_ttgg.mad, gg_ttggg.mad, gg_tt01g.mad, gq_ttq.mad, pp_tt012j.mad]
options: [gg_tt.mad, gg_ttg.mad, gg_ttgg.mad, gg_ttggg.mad, ee_mumu.mad, nobm_pp_ttW.mad, susy_gg_tt.mad]

#----------------------------------------------------------------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion MG5aMC/mg5amcnlo
Submodule mg5amcnlo updated 1998 files
Original file line number Diff line number Diff line change
@@ -1,163 +1,3 @@
diff --git b/epochX/cudacpp/gg_tt.mad/SubProcesses/P1_gg_ttx/auto_dsig1.f a/epochX/cudacpp/gg_tt.mad/SubProcesses/P1_gg_ttx/auto_dsig1.f
index 4fbb8e6ba..d5accb9fb 100644
--- b/epochX/cudacpp/gg_tt.mad/SubProcesses/P1_gg_ttx/auto_dsig1.f
+++ a/epochX/cudacpp/gg_tt.mad/SubProcesses/P1_gg_ttx/auto_dsig1.f
@@ -484,23 +484,142 @@ C
INTEGER VECSIZE_USED

INTEGER IVEC
-
-
+ INTEGER IEXT
+
+ INTEGER ISUM_HEL
+ LOGICAL MULTI_CHANNEL
+ COMMON/TO_MATRIX/ISUM_HEL, MULTI_CHANNEL
+
+ LOGICAL FIRST_CHID
+ SAVE FIRST_CHID
+ DATA FIRST_CHID/.TRUE./
+
+#ifdef MG5AMC_MEEXPORTER_CUDACPP
+ INCLUDE 'coupl.inc' ! for ALL_G
+ INCLUDE 'fbridge.inc'
+ INCLUDE 'fbridge_common.inc'
+ INCLUDE 'genps.inc'
+ INCLUDE 'run.inc'
+ DOUBLE PRECISION OUT2(VECSIZE_MEMMAX)
+ INTEGER SELECTED_HEL2(VECSIZE_MEMMAX)
+ INTEGER SELECTED_COL2(VECSIZE_MEMMAX)
+ DOUBLE PRECISION CBYF1
+ INTEGER*4 NGOODHEL, NTOTHEL
+
+ INTEGER*4 NWARNINGS
+ SAVE NWARNINGS
+ DATA NWARNINGS/0/
+
+ LOGICAL FIRST
+ SAVE FIRST
+ DATA FIRST/.TRUE./
+
+ IF( FBRIDGE_MODE .LE. 0 ) THEN ! (FortranOnly=0 or BothQuiet=-1 or BothDebug=-2)
+#endif
+ call counters_smatrix1multi_start( -1, VECSIZE_USED ) ! fortranMEs=-1
!$OMP PARALLEL
!$OMP DO
- DO IVEC=1, VECSIZE_USED
- CALL SMATRIX1(P_MULTI(0,1,IVEC),
- & hel_rand(IVEC),
- & col_rand(IVEC),
- & channel,
- & IVEC,
- & out(IVEC),
- & selected_hel(IVEC),
- & selected_col(IVEC)
- & )
- ENDDO
+ DO IVEC=1, VECSIZE_USED
+ CALL SMATRIX1(P_MULTI(0,1,IVEC),
+ & hel_rand(IVEC),
+ & col_rand(IVEC),
+ & channel,
+ & IVEC,
+ & out(IVEC),
+ & selected_hel(IVEC),
+ & selected_col(IVEC)
+ & )
+ ENDDO
!$OMP END DO
!$OMP END PARALLEL
+ call counters_smatrix1multi_stop( -1 ) ! fortranMEs=-1
+#ifdef MG5AMC_MEEXPORTER_CUDACPP
+ ENDIF
+
+ IF( FBRIDGE_MODE .EQ. 1 .OR. FBRIDGE_MODE .LT. 0 ) THEN ! (CppOnly=1 or BothQuiet=-1 or BothDebug=-2)
+ IF( LIMHEL.NE.0 ) THEN
+ WRITE(6,*) 'ERROR! The cudacpp bridge only supports LIMHEL=0'
+ STOP
+ ENDIF
+ IF ( FIRST ) THEN ! exclude first pass (helicity filtering) from timers (#461)
+ call counters_smatrix1multi_start( 1, VECSIZE_USED ) ! cudacppHEL=1
+ CALL FBRIDGESEQUENCE_NOMULTICHANNEL( FBRIDGE_PBRIDGE, ! multi channel disabled for helicity filtering
+ & P_MULTI, ALL_G, HEL_RAND, COL_RAND, OUT2,
+ & SELECTED_HEL2, SELECTED_COL2, .TRUE.) ! quit after computing helicities
+ FIRST = .FALSE.
+c ! This is a workaround for https://github.com/oliviermattelaer/mg5amc_test/issues/22 (see PR #486)
+ IF( FBRIDGE_MODE .EQ. 1 ) THEN ! (CppOnly=1 : SMATRIX1 is not called at all)
+ CALL RESET_CUMULATIVE_VARIABLE() ! mimic 'avoid bias of the initialization' within SMATRIX1
+ ENDIF
+ CALL FBRIDGEGETNGOODHEL(FBRIDGE_PBRIDGE,NGOODHEL,NTOTHEL)
+ IF( NTOTHEL .NE. NCOMB ) THEN
+ WRITE(6,*) 'ERROR! Cudacpp/Fortran mismatch',
+ & ' in total number of helicities', NTOTHEL, NCOMB
+ STOP
+ ENDIF
+ WRITE (6,*) 'NGOODHEL =', NGOODHEL
+ WRITE (6,*) 'NCOMB =', NCOMB
+ call counters_smatrix1multi_stop( 1 ) ! cudacppHEL=1
+ ENDIF
+ call counters_smatrix1multi_start( 0, VECSIZE_USED ) ! cudacppMEs=0
+ IF ( .NOT. MULTI_CHANNEL ) THEN
+ CALL FBRIDGESEQUENCE_NOMULTICHANNEL( FBRIDGE_PBRIDGE, ! multi channel disabled
+ & P_MULTI, ALL_G, HEL_RAND, COL_RAND, OUT2,
+ & SELECTED_HEL2, SELECTED_COL2, .FALSE.) ! do not quit after computing helicities
+ ELSE
+ IF( SDE_STRAT.NE.1 ) THEN
+ WRITE(6,*) 'ERROR! The cudacpp bridge requires SDE=1' ! multi channel single-diagram enhancement strategy
+ STOP
+ ENDIF
+ CALL FBRIDGESEQUENCE(FBRIDGE_PBRIDGE, P_MULTI, ALL_G, ! multi channel enabled
+ & HEL_RAND, COL_RAND, CHANNEL, OUT2,
+ & SELECTED_HEL2, SELECTED_COL2, .FALSE.) ! do not quit after computing helicities
+ ENDIF
+ call counters_smatrix1multi_stop( 0 ) ! cudacppMEs=0
+ ENDIF
+
+ IF( FBRIDGE_MODE .LT. 0 ) THEN ! (BothQuiet=-1 or BothDebug=-2)
+ DO IVEC=1, VECSIZE_USED
+ CBYF1 = OUT2(IVEC)/OUT(IVEC) - 1
+ FBRIDGE_NCBYF1 = FBRIDGE_NCBYF1 + 1
+ FBRIDGE_CBYF1SUM = FBRIDGE_CBYF1SUM + CBYF1
+ FBRIDGE_CBYF1SUM2 = FBRIDGE_CBYF1SUM2 + CBYF1 * CBYF1
+ IF( CBYF1 .GT. FBRIDGE_CBYF1MAX ) FBRIDGE_CBYF1MAX = CBYF1
+ IF( CBYF1 .LT. FBRIDGE_CBYF1MIN ) FBRIDGE_CBYF1MIN = CBYF1
+ IF( FBRIDGE_MODE .EQ. -2 ) THEN ! (BothDebug=-2)
+ WRITE (*,'(I4,2E16.8,F23.11,I3,I3,I4,I4)')
+ & IVEC, OUT(IVEC), OUT2(IVEC), 1+CBYF1,
+ & SELECTED_HEL(IVEC), SELECTED_HEL2(IVEC),
+ & SELECTED_COL(IVEC), SELECTED_COL2(IVEC)
+ ENDIF
+ IF( ABS(CBYF1).GT.5E-5 .AND. NWARNINGS.LT.20 ) THEN
+ NWARNINGS = NWARNINGS + 1
+ WRITE (*,'(A,I4,A,I4,2E16.8,F23.11)')
+ & 'WARNING! (', NWARNINGS, '/20) Deviation more than 5E-5',
+ & IVEC, OUT(IVEC), OUT2(IVEC), 1+CBYF1
+ ENDIF
+ END DO
+ ENDIF
+
+ IF( FBRIDGE_MODE .EQ. 1 .OR. FBRIDGE_MODE .LT. 0 ) THEN ! (CppOnly=1 or BothQuiet=-1 or BothDebug=-2)
+ DO IVEC=1, VECSIZE_USED
+ OUT(IVEC) = OUT2(IVEC) ! use the cudacpp ME instead of the fortran ME!
+ SELECTED_HEL(IVEC) = SELECTED_HEL2(IVEC) ! use the cudacpp helicity instead of the fortran helicity!
+ SELECTED_COL(IVEC) = SELECTED_COL2(IVEC) ! use the cudacpp color instead of the fortran color!
+ END DO
+ ENDIF
+#endif
+
+ IF ( FIRST_CHID ) THEN
+ IF ( MULTI_CHANNEL ) THEN
+ WRITE (*,*) 'MULTI_CHANNEL = TRUE'
+ ELSE
+ WRITE (*,*) 'MULTI_CHANNEL = FALSE'
+ ENDIF
+ WRITE (*,*) 'CHANNEL_ID =', CHANNEL
+ FIRST_CHID = .FALSE.
+ ENDIF
+
RETURN
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 1124a9164..27a6e4674 100644
--- b/epochX/cudacpp/gg_tt.mad/SubProcesses/P1_gg_ttx/driver.f
Expand Down Expand Up @@ -286,7 +126,7 @@ index 1124a9164..27a6e4674 100644
open(unit=lun,file=tempname,status='old',ERR=20)
fopened=.true.
diff --git b/epochX/cudacpp/gg_tt.mad/SubProcesses/P1_gg_ttx/matrix1.f a/epochX/cudacpp/gg_tt.mad/SubProcesses/P1_gg_ttx/matrix1.f
index e73e654d4..3072054f2 100644
index 8b73188ef..710fd1297 100644
--- b/epochX/cudacpp/gg_tt.mad/SubProcesses/P1_gg_ttx/matrix1.f
+++ a/epochX/cudacpp/gg_tt.mad/SubProcesses/P1_gg_ttx/matrix1.f
@@ -72,7 +72,10 @@ C
Expand All @@ -301,7 +141,7 @@ index e73e654d4..3072054f2 100644
C
C This is just to temporarily store the reference grid for
C helicity of the DiscreteSampler so as to obtain its number of
@@ -217,6 +220,17 @@ C ----------
@@ -230,6 +233,17 @@ C update.
ENDIF
IF(NTRY(IMIRROR).EQ.MAXTRIES)THEN
ISHEL(IMIRROR)=MIN(ISUM_HEL,NGOOD(IMIRROR))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ index a59181c70..af7e0efbc 100644
PARAMETER(MAXTRIES=25)
C To pass the helicity configuration chosen by the DiscreteSampler to
diff --git b/epochX/cudacpp/gg_tt.mad/SubProcesses/makefile a/epochX/cudacpp/gg_tt.mad/SubProcesses/makefile
index 348c283be..504e41ea5 100644
index 348c283be..205014f49 100644
--- b/epochX/cudacpp/gg_tt.mad/SubProcesses/makefile
+++ a/epochX/cudacpp/gg_tt.mad/SubProcesses/makefile
@@ -1,6 +1,40 @@
Expand Down Expand Up @@ -79,7 +79,7 @@ index 348c283be..504e41ea5 100644

LIBS = $(LIBDIR)libbias.$(libext) $(LIBDIR)libdhelas.$(libext) $(LIBDIR)libdsample.$(libext) $(LIBDIR)libgeneric.$(libext) $(LIBDIR)libpdf.$(libext) $(LIBDIR)libgammaUPC.$(libext) $(LIBDIR)libmodel.$(libext) $(LIBDIR)libcernlib.$(libext) $(MADLOOP_LIB) $(LOOP_LIBS)

@@ -43,41 +90,147 @@ ifeq ($(strip $(MATRIX_HEL)),)
@@ -43,41 +90,150 @@ ifeq ($(strip $(MATRIX_HEL)),)
endif


Expand Down Expand Up @@ -123,6 +123,8 @@ index 348c283be..504e41ea5 100644

-$(LIBDIR)libmodel.$(libext): ../../Cards/param_card.dat
- cd ../../Source/MODEL; make
+# Disable OpenMP by default: enable OpenMP only if USEOPENMP=1 (#758)
+ifeq ($(USEOPENMP),1)
+ifneq ($(shell $(CXX) --version | egrep '^Intel'),)
+override OMPFLAGS = -fopenmp
+LINKLIBS += -liomp5 # see #578
Expand All @@ -135,11 +137,12 @@ index 348c283be..504e41ea5 100644
+else
+override OMPFLAGS = -fopenmp
+endif
-$(LIBDIR)libgeneric.$(libext): ../../Cards/run_card.dat
+endif
+
+$(PROG)_fortran: $(PROCESS) $(DSIG) auto_dsig.o $(LIBS) $(MATRIX) counters.o ompnumthreads.o
+ $(FC) -o $(PROG)_fortran $(PROCESS) $(DSIG) auto_dsig.o $(MATRIX) $(LINKLIBS) $(BIASDEPENDENCIES) $(OMPFLAGS) counters.o ompnumthreads.o $(LDFLAGS)
+

-$(LIBDIR)libgeneric.$(libext): ../../Cards/run_card.dat
+$(LIBS): .libs
+
+.libs: ../../Cards/param_card.dat ../../Cards/run_card.dat
Expand Down Expand Up @@ -243,7 +246,7 @@ index 348c283be..504e41ea5 100644

# Dependencies

@@ -97,5 +250,80 @@ unwgt.o: genps.inc nexternal.inc symswap.inc cluster.inc run.inc message.inc \
@@ -97,5 +253,80 @@ unwgt.o: genps.inc nexternal.inc symswap.inc cluster.inc run.inc message.inc \
run_config.inc
initcluster.o: message.inc

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ def reset_simd(self, old_value, new_value, name):
if name == "vector_size" and new_value <= int(old_value):
# code can handle the new size -> do not recompile
return

# ok need to force recompilation of the cpp part
Sourcedir = pjoin(os.path.dirname(os.path.dirname(self.path)), 'Source')
subprocess.call(['make', 'cleanall'], cwd=Sourcedir, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)

Expand Down Expand Up @@ -119,7 +121,7 @@ def default_setup(self):
def write_one_include_file(self, output_dir, incname, output_file=None):
"""write one include file at the time"""
if incname == "vector.inc":
if 'vector_size' not in self.user_set: return
if 'vector_size' not in self.user_set and 'wrap_size' not in self.user_set: return
if output_file is None: vectorinc=pjoin(output_dir,incname)
else: vectorinc=output_file
with open(vectorinc+'.new','w') as fileout:
Expand Down
Loading

0 comments on commit 13f73b6

Please sign in to comment.