From a8262594c77e0932732a20c35a0f08466065e9d9 Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Tue, 6 Aug 2024 20:49:12 +0200 Subject: [PATCH 1/5] fix patch to be compatible with mg5 branch gpucpp_goodhel --- MG5aMC/mg5amcnlo | 2 +- .../CUDACPP_SA_OUTPUT/MG5aMC_patches/PROD/patch.P1 | 8 ++++---- .../MG5aMC_patches/PROD/patch.common | 14 -------------- 3 files changed, 5 insertions(+), 19 deletions(-) diff --git a/MG5aMC/mg5amcnlo b/MG5aMC/mg5amcnlo index 8c70b1ba4c..895fe72b2f 160000 --- a/MG5aMC/mg5amcnlo +++ b/MG5aMC/mg5amcnlo @@ -1 +1 @@ -Subproject commit 8c70b1ba4c0f01257d8aa2d337fff716f1ef7e55 +Subproject commit 895fe72b2fae27caa2057d86771b1a7418ab107c diff --git a/epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/MG5aMC_patches/PROD/patch.P1 b/epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/MG5aMC_patches/PROD/patch.P1 index b90ef84b47..d1a87f1a79 100644 --- a/epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/MG5aMC_patches/PROD/patch.P1 +++ b/epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/MG5aMC_patches/PROD/patch.P1 @@ -304,13 +304,13 @@ index e73e654d4..27fbe7302 100644 C ---------- + call counters_smatrix1_start() - NTRY(IMIRROR)=NTRY(IMIRROR)+1 - THIS_NTRY(IMIRROR) = THIS_NTRY(IMIRROR)+1 + NTRY(1)=NTRY(1)+1 DO I=1,NEXTERNAL + JC(I) = +1 @@ -217,6 +221,17 @@ C ---------- ENDIF - IF(NTRY(IMIRROR).EQ.MAXTRIES)THEN - ISHEL(IMIRROR)=MIN(ISUM_HEL,NGOOD(IMIRROR)) + IF(NTRY(1).EQ.MAXTRIES)THEN + ISHEL=MIN(ISUM_HEL,NGOOD) +C Print the number of good helicities + IF (NGOODHEL(IMIRROR).EQ.-1) THEN + NGOODHEL(IMIRROR)=0 diff --git a/epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/MG5aMC_patches/PROD/patch.common b/epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/MG5aMC_patches/PROD/patch.common index a04d216c10..0e387c74f4 100644 --- a/epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/MG5aMC_patches/PROD/patch.common +++ b/epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/MG5aMC_patches/PROD/patch.common @@ -1,17 +1,3 @@ -diff --git b/epochX/cudacpp/gg_tt.mad/Source/genps.inc a/epochX/cudacpp/gg_tt.mad/Source/genps.inc -index a59181c70..af7e0efbc 100644 ---- b/epochX/cudacpp/gg_tt.mad/Source/genps.inc -+++ a/epochX/cudacpp/gg_tt.mad/Source/genps.inc -@@ -30,7 +30,8 @@ c************************************************************************* - c Parameters for helicity sums in matrixN.f - c************************************************************************* - REAL*8 LIMHEL -- PARAMETER(LIMHEL=1e-8) ! ME threshold for helicity filtering -+c PARAMETER(LIMHEL=1e-8) ! ME threshold for helicity filtering (Fortran default) -+ PARAMETER(LIMHEL=0) ! ME threshold for helicity filtering (force Fortran to mimic cudacpp, see #419) - INTEGER MAXTRIES - PARAMETER(MAXTRIES=25) - C To pass the helicity configuration chosen by the DiscreteSampler to diff --git b/epochX/cudacpp/gg_tt.mad/Source/makefile a/epochX/cudacpp/gg_tt.mad/Source/makefile index 617f10b93..00c73099a 100644 --- b/epochX/cudacpp/gg_tt.mad/Source/makefile From 76ba27a505121f08b9ebe6844fe3b33624730634 Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Tue, 6 Aug 2024 21:07:27 +0200 Subject: [PATCH 2/5] change mg5amc version to use --- MG5aMC/mg5amcnlo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MG5aMC/mg5amcnlo b/MG5aMC/mg5amcnlo index 895fe72b2f..ffb7a2e013 160000 --- a/MG5aMC/mg5amcnlo +++ b/MG5aMC/mg5amcnlo @@ -1 +1 @@ -Subproject commit 895fe72b2fae27caa2057d86771b1a7418ab107c +Subproject commit ffb7a2e013ac7dbba5a4c94329bb5d6b40f7a11f From df130b07727d2f99bb564c30e39206e152147aa8 Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Tue, 6 Aug 2024 21:41:21 +0200 Subject: [PATCH 3/5] temporary fix to set limhel to 0 for cudacpp --- epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/launch_plugin.py | 1 + 1 file changed, 1 insertion(+) diff --git a/epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/launch_plugin.py b/epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/launch_plugin.py index 7b4e0b7a30..059bc74f10 100644 --- a/epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/launch_plugin.py +++ b/epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/launch_plugin.py @@ -96,6 +96,7 @@ def default_setup(self): self['vector_size'] = 16 # already setup in default class (just change value) self['aloha_flag'] = '--fast-math' self['matrix_flag'] = '-O3' + self['limhel'] = 0 self.display_block.append('simd') self.display_block.append('psoptim') From b304cc90549be184a59cc1d8f17042d52a187d02 Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Tue, 6 Aug 2024 22:09:32 +0200 Subject: [PATCH 4/5] fixing a patch that was relying on imirror --- .../CUDACPP_SA_OUTPUT/MG5aMC_patches/PROD/patch.P1 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/MG5aMC_patches/PROD/patch.P1 b/epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/MG5aMC_patches/PROD/patch.P1 index d1a87f1a79..f1a4eb9143 100644 --- a/epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/MG5aMC_patches/PROD/patch.P1 +++ b/epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/MG5aMC_patches/PROD/patch.P1 @@ -293,9 +293,9 @@ index e73e654d4..27fbe7302 100644 EXTERNAL GET_CHANNEL_CUT - +C -+ INTEGER NGOODHEL(2) ! -1 if not yet retrieved and printed ++ INTEGER NGOODHEL ! -1 if not yet retrieved and printed + SAVE NGOODHEL -+ DATA NGOODHEL/-1,-1/ ++ DATA NGOODHEL/-1/ C C This is just to temporarily store the reference grid for C helicity of the DiscreteSampler so as to obtain its number of @@ -312,14 +312,14 @@ index e73e654d4..27fbe7302 100644 IF(NTRY(1).EQ.MAXTRIES)THEN ISHEL=MIN(ISUM_HEL,NGOOD) +C Print the number of good helicities -+ IF (NGOODHEL(IMIRROR).EQ.-1) THEN -+ NGOODHEL(IMIRROR)=0 ++ IF (NGOODHEL.EQ.-1) THEN ++ NGOODHEL=0 + DO I=1,NCOMB -+ IF (GOODHEL(I,IMIRROR)) THEN -+ NGOODHEL(IMIRROR)=NGOODHEL(IMIRROR)+1 ++ IF (GOODHEL(I,1)) THEN ++ NGOODHEL=NGOODHEL+1 + ENDIF + END DO -+ WRITE (6,*) 'NGOODHEL =', NGOODHEL(IMIRROR) ! no need to print imirror? ++ WRITE (6,*) 'NGOODHEL =', NGOODHEL + WRITE (6,*) 'NCOMB =', NCOMB + ENDIF ENDIF From c448e89db8f48c2231b6538c3135cf38a82d0a93 Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Tue, 6 Aug 2024 22:30:18 +0200 Subject: [PATCH 5/5] random test --- .../PLUGIN/CUDACPP_SA_OUTPUT/MG5aMC_patches/PROD/patch.P1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/MG5aMC_patches/PROD/patch.P1 b/epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/MG5aMC_patches/PROD/patch.P1 index f1a4eb9143..8ec5bf7a8e 100644 --- a/epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/MG5aMC_patches/PROD/patch.P1 +++ b/epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/MG5aMC_patches/PROD/patch.P1 @@ -82,9 +82,9 @@ index 4fbb8e6ba..f9e2335de 100644 + & SELECTED_HEL2, SELECTED_COL2 ) + 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 ++c IF( FBRIDGE_MODE .EQ. 1 ) THEN ! (CppOnly=1 : SMATRIX1 is not called at all) ++c CALL RESET_CUMULATIVE_VARIABLE() ! mimic 'avoid bias of the initialization' within SMATRIX1 ++c ENDIF + CALL FBRIDGEGETNGOODHEL(FBRIDGE_PBRIDGE,NGOODHEL,NTOTHEL) + IF( NTOTHEL .NE. NCOMB ) THEN + WRITE(6,*) 'ERROR! Cudacpp/Fortran mismatch',