Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
27 changes: 19 additions & 8 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,19 @@ jobs:
run: make BACKEND=${{ matrix.backend }} OMPFLAGS= FPTYPE=${{ matrix.precision }} -C ${{ matrix.folder }}
- name: make test
run: make BACKEND=${{ matrix.backend }} OMPFLAGS= FPTYPE=${{ matrix.precision }} -C ${{ matrix.folder }} -f cudacpp.mk test
GPU:

GPU_Nvidia:
runs-on: self-hosted
# runs-on: madgraph5-h100
# container: registry.cern.ch/ngt/lxplus-like:9
env:
CUDA_HOME: /usr/local/cuda/
FC: gfortran
strategy:
matrix:
folder: [ epochX/cudacpp/ee_mumu.mad/SubProcesses/P1_epem_mupmum , epochX/cudacpp/gg_ttgg.mad/SubProcesses/P1_gg_ttxgg ]
precision: [ d , f , m ]
folder: [ epochX/cudacpp/ee_mumu.mad/SubProcesses/P1_epem_mupmum, epochX/cudacpp/gg_ttgg.mad/SubProcesses/P1_gg_ttxgg ]
precision: [ d, f, m ]
backend: [ cppauto, cuda ]
fail-fast: false
steps:
- uses: actions/checkout@v2
steps: &gpu_steps # allows to recall the steps
- uses: actions/checkout@v4
- name: path
run: echo "PATH=$PATH"
- name: github PR info
Expand All @@ -81,3 +79,16 @@ jobs:
run: make BACKEND=${{ matrix.backend }} FPTYPE=${{ matrix.precision }} -C ${{ matrix.folder }}
- name: make test
run: make BACKEND=${{ matrix.backend }} FPTYPE=${{ matrix.precision }} -C ${{ matrix.folder }} -f cudacpp.mk test

GPU_AMD:
runs-on: madgraph5-mi300x
container: registry.cern.ch/ngt/lxplus-like:9
env:
FC: gfortran
strategy:
matrix:
folder: [ epochX/cudacpp/ee_mumu.mad/SubProcesses/P1_epem_mupmum, epochX/cudacpp/gg_ttgg.mad/SubProcesses/P1_gg_ttxgg ]
precision: [ d, f, m ]
backend: [ hip ]
fail-fast: false
steps: *gpu_steps
Original file line number Diff line number Diff line change
Expand Up @@ -1106,10 +1106,20 @@ else
@cat /proc/cpuinfo | grep "physical id" | sort -u
endif
@echo ""
ifneq ($(shell which nvidia-smi 2>/dev/null),)
nvidia-smi -L
# some systems may have <vendor>-smi installed, but it fails to execute
# because it cannot communicate with the hardware
@if nvidia-smi &>/dev/null ; then \
nvidia-smi -L ;\
else \
echo "No Nvidia GPU detected" ;\
fi
@echo ""
endif
@if amd-smi &>/dev/null ; then \
amd-smi static -a ;\
amd-smi list ;\
else \
echo "No AMD GPU detected" ;\
fi
@echo USECCACHE=$(USECCACHE)
ifeq ($(USECCACHE),1)
ccache --version | head -1
Expand Down
28 changes: 14 additions & 14 deletions epochX/cudacpp/ee_mumu.mad/Cards/ident_card.dat
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,32 @@ ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c written by the UFO converter
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc

mass 5 mdl_MB

mass 6 mdl_MT

mass 15 mdl_MTA

mass 23 mdl_MZ

mass 25 mdl_MH

sminputs 1 aEWM1

sminputs 2 mdl_Gf

sminputs 3 aS

yukawa 5 mdl_ymb

yukawa 6 mdl_ymt

yukawa 15 mdl_ymtau



decay 6 mdl_WT

decay 23 mdl_WZ

decay 24 mdl_WW

decay 25 mdl_WH
decay 6 mdl_WT
mass 15 mdl_MTA
mass 23 mdl_MZ
mass 25 mdl_MH
mass 5 mdl_MB
mass 6 mdl_MT
sminputs 1 aEWM1
sminputs 2 mdl_Gf
sminputs 3 aS
yukawa 15 mdl_ymtau
yukawa 5 mdl_ymb
yukawa 6 mdl_ymt
4 changes: 2 additions & 2 deletions epochX/cudacpp/ee_mumu.mad/Cards/me5_configuration.txt
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@
# pineappl = pineappl


#mg5_path = /data/avalassi/GPU2023/madgraph4gpuX/MG5aMC/mg5amcnlo
mg5_path = /home/dmass/Development/madgraph4gpu/amd-ci/MG5aMC/mg5amcnlo

# MG5 MAIN DIRECTORY
#mg5_path = /data/avalassi/GPU2023/madgraph4gpuX/MG5aMC/mg5amcnlo
mg5_path = /home/dmass/Development/madgraph4gpu/amd-ci/MG5aMC/mg5amcnlo
14 changes: 8 additions & 6 deletions epochX/cudacpp/ee_mumu.mad/Cards/proc_card_mg5.dat
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#* * * *
#* *
#* *
#* VERSION 3.6.0 2024-09-30 *
#* VERSION 3.6.3 2025-06-12 *
#* *
#* WARNING: UNKNOWN DEVELOPMENT VERSION. *
#* WARNING: DO NOT USE FOR PRODUCTION *
Expand All @@ -35,15 +35,17 @@ set loop_color_flows False
set max_npoint_for_channel 0
set default_unset_couplings 99
set max_t_for_channel 99
set zerowidth_tchannel True
set nlo_mixed_expansion True
set stdout_level DEBUG
set zerowidth_tchannel F
generate e+ e- > mu+ mu-
import model sm
define p = g u c d s u~ c~ d~ s~
define j = g u c d s u~ c~ d~ s~
define l+ = e+ mu+
define l- = e- mu-
define vl = ve vm vt
define vl~ = ve~ vm~ vt~
output madevent_simd ../TMPOUT/CODEGEN_mad_ee_mumu --hel_recycling=Fal\
se --vector_size=32
set stdout_level DEBUG
set zerowidth_tchannel F
generate e+ e- > mu+ mu-
output madevent_simd ee_mumu.mad_gen --hel_recycling=False --vector_si\
ze=32
7 changes: 4 additions & 3 deletions epochX/cudacpp/ee_mumu.mad/Cards/run_card.dat
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@
#*********************************************************************
# Compilation flag.
#*********************************************************************
-O3 -ffast-math -fbounds-check = global_flag ! build flags for all Fortran code (for a fair comparison to cudacpp; default is -O)
-O = global_flag ! fortran optimization flag use for the all code.
--fast-math = aloha_flag ! fortran optimization flag for aloha function. Suggestions: '-ffast-math'
-O3 = matrix_flag ! fortran optimization flag for matrix.f function. Suggestions: '-O3'
32 = vector_size ! size of fortran arrays allocated in the multi-event API for SIMD/GPU (VECSIZE_MEMMAX)
512 = nb_warp ! total number of warp/frontwave
16 = vector_size ! size of fortran arrays allocated in the multi-event API for SIMD/GPU (VECSIZE_MEMMAX)
1 = nb_warp ! total number of warp/frontwave

#*********************************************************************
# Customization (custom cuts/scale/bias/...) *
Expand All @@ -112,6 +112,7 @@
# Parton level cuts definition *
#*******************************
0.0 = dsqrt_shat ! minimal shat for full process
-1 = dsqrt_shatmax ! maximum shat for full process
#
#
#*********************************************************************
Expand Down
1 change: 1 addition & 0 deletions epochX/cudacpp/ee_mumu.mad/Cards/run_card_default.dat
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
# Parton level cuts definition *
#*******************************
0.0 = dsqrt_shat ! minimal shat for full process
-1 = dsqrt_shatmax ! maximum shat for full process
#
#
#*********************************************************************
Expand Down
2 changes: 1 addition & 1 deletion epochX/cudacpp/ee_mumu.mad/MGMEVersion.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.6.0
3.6.3
4 changes: 3 additions & 1 deletion epochX/cudacpp/ee_mumu.mad/Source/.make_opts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ endif
ifneq ($(lhapdf),)
CXXFLAGS += $(shell $(lhapdf) --cppflags)
alfas_functions=alfas_functions_lhapdf
alfas_to_clean=alfas_functions.o
llhapdf+= $(shell $(lhapdf) --cflags --libs) -lLHAPDF
# check if we need to activate c++11 (for lhapdf6.2)
ifeq ($(origin CXX),default)
Expand All @@ -113,10 +114,11 @@ ifneq ($(lhapdf),)
endif
else
alfas_functions=alfas_functions
alfas_to_clean=alfas_functions_lhapdf.o
llhapdf=
endif

# Helper function to check MG5 version
define CHECK_MG5AMC_VERSION
python -c 'import re; from distutils.version import StrictVersion; print StrictVersion("$(MG5AMC_VERSION)") >= StrictVersion("$(1)") if re.match("^[\d\.]+$$","$(MG5AMC_VERSION)") else True;'
endef
endef
8 changes: 4 additions & 4 deletions epochX/cudacpp/ee_mumu.mad/Source/DHELAS/FFV4_0.f
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ SUBROUTINE FFV4_0(F1, F2, V3, COUP,VERTEX)
COMPLEX*16 COUP
COMPLEX*16 F1(*)
COMPLEX*16 F2(*)
COMPLEX*16 TMP1
COMPLEX*16 TMP3
COMPLEX*16 TMP4
COMPLEX*16 V3(*)
COMPLEX*16 VERTEX
TMP1 = (F1(3)*(F2(5)*(V3(3)+V3(6))+F2(6)*(V3(4)+CI*(V3(5))))
TMP3 = (F1(3)*(F2(5)*(V3(3)+V3(6))+F2(6)*(V3(4)+CI*(V3(5))))
$ +F1(4)*(F2(5)*(V3(4)-CI*(V3(5)))+F2(6)*(V3(3)-V3(6))))
TMP3 = (F1(5)*(F2(3)*(V3(3)-V3(6))-F2(4)*(V3(4)+CI*(V3(5))))
TMP4 = (F1(5)*(F2(3)*(V3(3)-V3(6))-F2(4)*(V3(4)+CI*(V3(5))))
$ +F1(6)*(F2(3)*(-V3(4)+CI*(V3(5)))+F2(4)*(V3(3)+V3(6))))
VERTEX = COUP*(-1D0)*(+CI*(TMP1)+2D0 * CI*(TMP3))
VERTEX = COUP*(-1D0)*(+CI*(TMP3)+2D0 * CI*(TMP4))
END


12 changes: 6 additions & 6 deletions epochX/cudacpp/ee_mumu.mad/Source/DHELAS/FFV4_3.f
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ SUBROUTINE FFV4_3(F1, F2, COUP, M3, W3,V3)
REAL*8 OM3
REAL*8 P3(0:3)
COMPLEX*16 TMP2
COMPLEX*16 TMP4
COMPLEX*16 TMP5
COMPLEX*16 V3(6)
REAL*8 W3
COMPLEX*16 DENOM
Expand All @@ -27,18 +27,18 @@ SUBROUTINE FFV4_3(F1, F2, COUP, M3, W3,V3)
P3(3) = -DIMAG(V3(1))
TMP2 = (F1(3)*(F2(5)*(P3(0)+P3(3))+F2(6)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F1(4)*F2(6))-F1(5)*F2(3)+F1(6)
$ *F2(4)))
END
Expand Down
4 changes: 4 additions & 0 deletions epochX/cudacpp/ee_mumu.mad/Source/alfas_functions.f
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ SUBROUTINE NEWTON1(T,A_IN,A_OUT,NLOOP,NF)

A_OUT=A_IN/(1D0+A_IN*B0(NF)*T)
IF (NLOOP .EQ. 1) RETURN
if (1D0+A_IN*B0(NF)*T.le.0d0)THEN
A_OUT = 9d98
RETURN
ENDIF
A_OUT=A_IN/(1D0+B0(NF)*A_IN*T+C1(NF)*A_IN*LOG(1D0+A_IN*B0(NF)*T))
IF (A_OUT .LT. 0D0) AS=0.3D0
30 AS=A_OUT
Expand Down
4 changes: 2 additions & 2 deletions epochX/cudacpp/ee_mumu.mad/Source/cuts.inc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ C
REAL*8 misset,missetmax,ptheavy
REAL*8 ptllmin,ptllmax
integer maxjetflavor
REAl*8 dsqrt_shat
REAl*8 dsqrt_shat,dsqrt_shatmax

COMMON /to_min_max_cuts/
& PTJmax,PTBmax,PTAmax,PTLmax,
Expand All @@ -60,7 +60,7 @@ C
& ht2max,ht3max,ht4max,
& htjmin,htjmax,ihtmin,ihtmax,
& misset,missetmax,ptheavy,
& ptllmin,ptllmax,dsqrt_shat,
& ptllmin,ptllmax,dsqrt_shat,dsqrt_shatmax,
& maxjetflavor

C
Expand Down
11 changes: 6 additions & 5 deletions epochX/cudacpp/ee_mumu.mad/Source/make_opts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
DEFAULT_CPP_COMPILER=g++
DEFAULT_F2PY_COMPILER=f2py3
DEFAULT_F_COMPILER=gfortran
GLOBAL_FLAG=-O3 -ffast-math -fbounds-check
MACFLAG=
STDLIB=-lstdc++
STDLIB_FLAG=
DEFAULT_F2PY_COMPILER=f2py
DEFAULT_F_COMPILER=gfortran
MG5AMC_VERSION=SpecifiedByMG5aMCAtRunTime
PYTHIA8_PATH=NotInstalled
STDLIB_FLAG=
STDLIB=-lstdc++
#end_of_make_opts_variables

BIASLIBDIR=../../../lib/
Expand Down Expand Up @@ -103,6 +102,7 @@ endif
ifneq ($(lhapdf),)
CXXFLAGS += $(shell $(lhapdf) --cppflags)
alfas_functions=alfas_functions_lhapdf
alfas_to_clean=alfas_functions.o
llhapdf+= $(shell $(lhapdf) --cflags --libs) -lLHAPDF
# check if we need to activate c++11 (for lhapdf6.2)
ifeq ($(origin CXX),default)
Expand All @@ -114,6 +114,7 @@ endif
endif
else
alfas_functions=alfas_functions
alfas_to_clean=alfas_functions_lhapdf.o
llhapdf=
endif

Expand Down
5 changes: 4 additions & 1 deletion epochX/cudacpp/ee_mumu.mad/Source/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@ all: $(LIBRARIES) $(LIBDIR)libdhelas.$(libext) $(LIBDIR)libpdf.$(libext) $(LIBDI
$(LIBDIR)libdsample.$(libext): $(DSAMPLE)
$(call CREATELIB, $@, $^)
$(LIBDIR)libgeneric.$(libext): $(GENERIC)
rm -f $@ 2>/dev/null
$(call CREATELIB, $@, $^)
rm -f $(alfas_to_clean) 2>/dev/null
$(LIBDIR)libdhelas.$(libext): DHELAS
cd DHELAS; make; cd ..
$(LIBDIR)libpdf.$(libext): PDF make_opts
$(LIBDIR)libpdf.$(libext): PDF $(alfas_functions).o
cd PDF; make; cd ..
ifneq (,$(filter edff chff, $(pdlabel1) $(pdlabel2)))
$(LIBDIR)libgammaUPC.$(libext): PDF/gammaUPC
Expand Down Expand Up @@ -73,6 +75,7 @@ $(BINDIR)gensudgrid: $(GENSUDGRID) $(LIBDIR)libpdf.$(libext) $(LIBDIR)libgammaUP
# Dependencies

dsample.o: DiscreteSampler.o dsample.f genps.inc StringCast.o vector.inc
pawgraph.o: vector.inc
DiscreteSampler.o: StringCast.o
invarients.o: invarients.f genps.inc
gen_ximprove.o: gen_ximprove.f run_config.inc run_card.inc
Expand Down
6 changes: 4 additions & 2 deletions epochX/cudacpp/ee_mumu.mad/Source/vector.inc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ C
INTEGER WARP_SIZE
PARAMETER (WARP_SIZE=32)
INTEGER NB_WARP
PARAMETER (NB_WARP=512)
PARAMETER (NB_WARP=1)
INTEGER VECSIZE_MEMMAX
PARAMETER (VECSIZE_MEMMAX=16384)
PARAMETER (VECSIZE_MEMMAX=32)


Loading