Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Further cleanup of makefiles after separating C++ and CUDA targets #841

Merged
merged 51 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
6ae84d9
[jtmk2] gg_tt.mad cudacpp.mk cleanup: rename 'runTest.exe' executable…
valassi May 15, 2024
a89836e
[jtmk2] gg_tt.mad cudacpp.mk cleanup: replace '_main' variables by '_…
valassi May 15, 2024
fedf7ed
[jtmk2] gg_tt.mad cudacpp.mk cleanup: split 'testmain' variable into …
valassi May 15, 2024
a389865
[jtmk2] gg_tt.mad cudacpp.mk cleanup: rename '[f]check.exe' as '[f]ch…
valassi May 15, 2024
d63be57
[jtmk2] gg_tt.mad cudacpp.mk bug fix: replace gCrossSectionKernels.o …
valassi May 15, 2024
bd6c487
[jtmk2] gg_tt.mad cudacpp.mk cleanup: fix runTest, runCheck, runFchec…
valassi May 15, 2024
bdcd2ea
[jtmk2] bug fix in CODEGEN cudacpp.mk: replace gCrossSectionKernels.o…
valassi May 15, 2024
5735824
[jtmk2] gg_tt.mad cudacpp.mk cleanup: rename fcheck_sa.o as fcheck_sa…
valassi May 15, 2024
8156fb5
[jtmk2] gg_tt.mad cudacpp.mk cleanup: rename all xxx.o compiled via C…
valassi May 15, 2024
cb608bd
[jtmk2] gg_tt.mad cudacpp_src.mk cleanup: rename all xxx.o compiled v…
valassi May 15, 2024
fb1c1f5
[jtmk2] gg_tt.mad cudacpp_src.mk cleanup: reorder command blocks to a…
valassi May 15, 2024
531e456
[jtmk2] gg_tt.mad cudacpp.mk cleanup: reorder command blocks to alway…
valassi May 15, 2024
ef8a779
[jtmk2] CODEGEN cudacpp_src.mk cleanup (backport gg_tt.mad)
valassi May 15, 2024
1a3a555
[jtmk2] CODEGEN cudacpp.mk cleanup (backport gg_tt.mad)
valassi May 15, 2024
77cdc09
[jtmk2] regenerate gg_tt.mad, check all is ok so far
valassi May 15, 2024
9ecb791
[jtmk2] in gg_tt.mad makefile, add suffix cpp or $(GPUSUFFIX) to lib$…
valassi May 15, 2024
6cbe373
[jtmk2] in gg_tt.mad cudacpp.mk and cudacpp_src.mk: add suffix cpp or…
valassi May 15, 2024
2dfdd3e
[jtmk2] in gg_tt.mad cudacpp.mk: move GPUCC definition as early as po…
valassi May 15, 2024
2f74cb9
[jtmk2] in CODEGEN cudacpp.mk: move GPUCC definition as early as poss…
valassi May 15, 2024
1b9f167
[jtmk2] in CODEGEN cudacpp.mk and cudacpp_src.mk: add suffix cpp or $…
valassi May 15, 2024
f3419b2
[jtmk2] in CODEGEN (recreate patch from gg_tt.mad) makefile, add suff…
valassi May 15, 2024
19d5277
[jtmk2] regenerate gg_tt.mad, check all is ok so far
valassi May 15, 2024
709a355
[jtmk2] in gg_tt.mad cudacpp.mk, finally rename 'make check' as 'make…
valassi May 15, 2024
b5eba12
[jtmk2] in CODEGEN cudacpp.mk, finally rename 'make check' as 'make t…
valassi May 15, 2024
5b83a1d
[jtmk2] regenerate gg_tt.mad, check all is ok so far
valassi May 15, 2024
a96d88a
[jtmk2] in workflows/c-cpp.yml for the github CI, finally rename 'mak…
valassi May 15, 2024
e0375b1
[jtmk2] regenerate all processes
valassi May 15, 2024
6a6e2b9
[jtmk2] prepare to merge the latest jtmk: go back to the last common …
valassi May 15, 2024
27d3950
Merge branch 'jtmk' (including updated copyright years, new test logs…
valassi May 15, 2024
ea91ca6
[jtmk2] regenerate all processes after merging jtmk - strange, input.…
valassi May 15, 2024
1339c8b
[jtmk2] adapt tput/throughputX.sh to the new executable names (e.g. n…
valassi May 15, 2024
9aa47d4
[jtmk2] adapt tput/throughputX.sh and tput/simdSym.sh to the new name…
valassi May 15, 2024
a19105b
[jtmk2] fix tput/throughputX.sh (the new name CPPProcess_cpp.o is som…
valassi May 15, 2024
d73d17a
[jtmk2] adapt tmad/madX.sh to the new executable names (e.g. no more …
valassi May 15, 2024
0595a79
[jtmk] go back to itscrd90 logs for tput and tmad
valassi May 16, 2024
7f1ee3b
[jtmk2] rerun 30 tmad tests on itscrd90 - one new FPE issue #845 in l…
valassi May 16, 2024
510decd
[jtmk2] rerun tmad gqttq test, the FPE #845 disappears, I will close …
valassi May 16, 2024
c73b719
[jtmk2] additional bug fixes in tput/throughputX.sh, remove the last …
valassi May 16, 2024
2fdea8f
[jtmk2] in tput/throughputX.sh, improve '---' and '===' separators (u…
valassi May 16, 2024
5fec65c
[jtmk2] rerun 102 tput tests on itscrd90 - after fixing various issue…
valassi May 16, 2024
7112ba6
[jtmk2] rerun 102 tput tests on itgold91, all ok
valassi May 16, 2024
7bfe75c
[jtmk2] rerun 30 tmad tests on itgold91, all as expected
valassi May 16, 2024
8b75ddf
[jtmk2] go back to itscrd90 logs
valassi May 17, 2024
687c1e5
[jtmk2] bug fix for -short|-ggttggg and -nobsm|-bsmonly options in tm…
valassi May 16, 2024
6c81781
[jtmk2] rerun 96 tput tests on LUMI worker node - all as expected
valassi May 17, 2024
be946ae
[jtmk2] rerun 30 tmad tests on LUMI - all as expected
valassi May 17, 2024
32a5b40
[jtmk2] ** (ALMOST COMPLETE JTMK2) ** go back to itscrd90 logs again
valassi May 17, 2024
e33c1f7
[jtmk2] revert to previous CODEGEN logs - prepare to merge the latest…
valassi May 21, 2024
c1acd1c
Merge branch 'jtmk' into jtmk2
valassi May 21, 2024
dac61e3
[jtmk2] regenerate all processes = no change except for codegen logs
valassi May 21, 2024
3ab0a88
Merge remote-tracking branch 'upstream/master' (including jtmk PR #79…
valassi May 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ jobs:
run: make BACKEND=${{ matrix.backend }} FPTYPE=${{ matrix.precision }} -C ${{ matrix.folder }} -f cudacpp.mk info
- name: make
run: make BACKEND=${{ matrix.backend }} FPTYPE=${{ matrix.precision }} -C ${{ matrix.folder }}
- name: make check
run: make BACKEND=${{ matrix.backend }} FPTYPE=${{ matrix.precision }} -C ${{ matrix.folder }} -f cudacpp.mk check
- name: make test
run: make BACKEND=${{ matrix.backend }} FPTYPE=${{ matrix.precision }} -C ${{ matrix.folder }} -f cudacpp.mk test
CPU_MAC:
runs-on: macos-latest
env:
Expand All @@ -53,8 +53,8 @@ jobs:
run: make BACKEND=${{ matrix.backend }} OMPFLAGS= FPTYPE=${{ matrix.precision }} -C ${{ matrix.folder }} -f cudacpp.mk info
- name: make
run: make BACKEND=${{ matrix.backend }} OMPFLAGS= FPTYPE=${{ matrix.precision }} -C ${{ matrix.folder }}
- name: make check
run: make BACKEND=${{ matrix.backend }} OMPFLAGS= FPTYPE=${{ matrix.precision }} -C ${{ matrix.folder }} -f cudacpp.mk check
- name: make test
run: make BACKEND=${{ matrix.backend }} OMPFLAGS= FPTYPE=${{ matrix.precision }} -C ${{ matrix.folder }} -f cudacpp.mk test
GPU:
runs-on: self-hosted
env:
Expand All @@ -76,5 +76,5 @@ jobs:
run: make BACKEND=${{ matrix.backend }} FPTYPE=${{ matrix.precision }} -C ${{ matrix.folder }} -f cudacpp.mk info
- name: make
run: make BACKEND=${{ matrix.backend }} FPTYPE=${{ matrix.precision }} -C ${{ matrix.folder }}
- name: make check
run: make BACKEND=${{ matrix.backend }} FPTYPE=${{ matrix.precision }} -C ${{ matrix.folder }} -f cudacpp.mk check
- name: make test
run: make BACKEND=${{ matrix.backend }} FPTYPE=${{ matrix.precision }} -C ${{ matrix.folder }} -f cudacpp.mk test
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ index 617f10b93..00c73099a 100644
+cleanall: cleanSource # THIS IS THE ONE
+ for i in `ls -d ../SubProcesses/P*`; do cd $$i; make cleanavxs; cd -; done;
diff --git b/epochX/cudacpp/gg_tt.mad/SubProcesses/makefile a/epochX/cudacpp/gg_tt.mad/SubProcesses/makefile
index 348c283be..22517d0cc 100644
index 348c283be..6a21300f7 100644
--- b/epochX/cudacpp/gg_tt.mad/SubProcesses/makefile
+++ a/epochX/cudacpp/gg_tt.mad/SubProcesses/makefile
@@ -1,6 +1,37 @@
Expand Down Expand Up @@ -79,27 +79,29 @@ index 348c283be..22517d0cc 100644
# Load additional dependencies of the bias module, if present
ifeq (,$(wildcard ../bias_dependencies))
BIASDEPENDENCIES =
@@ -24,7 +55,18 @@ else
@@ -24,7 +55,20 @@ else
MADLOOP_LIB =
endif

-LINKLIBS = $(LINK_MADLOOP_LIB) $(LINK_LOOP_LIBS) -L../../lib/ -ldhelas -ldsample -lmodel -lgeneric -lpdf -lgammaUPC -lcernlib $(llhapdf) -lbias
+LINKLIBS = $(LINK_MADLOOP_LIB) $(LINK_LOOP_LIBS) -L$(LIBDIR) -ldhelas -ldsample -lmodel -lgeneric -lpdf -lcernlib $(llhapdf) -lbias
+
+CUDACPP_MAKEFILE=cudacpp.mk
+CUDACPP_COMMONLIB=mg5amc_common
+processid_short=$(shell basename $(CURDIR) | awk -F_ '{print $$(NF-1)"_"$$NF}')
+ifeq ($(BACKEND),cuda)
+CUDACPP_COMMONLIB=mg5amc_common_cuda
+CUDACPP_BACKENDLIB=mg5amc_$(processid_short)_cuda
+else ifeq ($(BACKEND),hip)
+CUDACPP_COMMONLIB=mg5amc_common_hip
+CUDACPP_BACKENDLIB=mg5amc_$(processid_short)_hip
+else
+CUDACPP_COMMONLIB=mg5amc_common_cpp
+CUDACPP_BACKENDLIB=mg5amc_$(processid_short)_cpp
+endif

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 +85,145 @@ ifeq ($(strip $(MATRIX_HEL)),)
@@ -43,41 +87,145 @@ ifeq ($(strip $(MATRIX_HEL)),)
endif


Expand Down Expand Up @@ -261,7 +263,7 @@ index 348c283be..22517d0cc 100644

# Dependencies

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

Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,11 @@ endif
# NB1: there are no CUDA targets in src as we avoid RDC!
# NB2: CUDA includes for curand.h are no longer needed in the C++ code anywhere in src!

MG5AMC_COMMONLIB = mg5amc_common
ifeq ($(GPUCC),)
MG5AMC_COMMONLIB = mg5amc_common_cpp
else
MG5AMC_COMMONLIB = mg5amc_common_$(GPUSUFFIX)
endif

# Explicitly define the default goal (this is not necessary as it is the first target, which is implicitly the default goal)
.DEFAULT_GOAL := all.$(TAG)
Expand Down Expand Up @@ -126,7 +130,7 @@ $(LIBDIR)/.build.$(TAG):
#-------------------------------------------------------------------------------

# Generic target and build rules: objects from C++ compilation
$(BUILDDIR)/%%.o : %%.cc *.h $(BUILDDIR)/.build.$(TAG)
$(BUILDDIR)/%%_cpp.o : %%.cc *.h $(BUILDDIR)/.build.$(TAG)
@if [ ! -d $(BUILDDIR) ]; then echo "mkdir -p $(BUILDDIR)"; mkdir -p $(BUILDDIR); fi
$(CXX) $(CPPFLAGS) $(INCFLAGS) $(CXXFLAGS) -c $< -o $@

Expand All @@ -139,22 +143,22 @@ endif

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

cxx_objects=$(addprefix $(BUILDDIR)/, read_slha.o)
ifneq ($(GPUCC),)
gpu_objects=$(addprefix $(BUILDDIR)/, Parameters_%(model)s_$(GPUSUFFIX).o)
cxx_objects=$(addprefix $(BUILDDIR)/, read_slha_cpp.o)
ifeq ($(GPUCC),)
cxx_objects+=$(addprefix $(BUILDDIR)/, Parameters_%(model)s_cpp.o)
else
cxx_objects+=$(addprefix $(BUILDDIR)/, Parameters_%(model)s.o)
gpu_objects=$(addprefix $(BUILDDIR)/, Parameters_%(model)s_$(GPUSUFFIX).o)
endif

# Target (and build rules): common (src) library
ifneq ($(GPUCC),)
$(LIBDIR)/lib$(MG5AMC_COMMONLIB).so : $(cxx_objects) $(gpu_objects)
@if [ ! -d $(LIBDIR) ]; then echo "mkdir -p $(LIBDIR)"; mkdir -p $(LIBDIR); fi
$(GPUCC) -shared -o $@ $(cxx_objects) $(gpu_objects) $(LDFLAGS)
else
ifeq ($(GPUCC),)
$(LIBDIR)/lib$(MG5AMC_COMMONLIB).so : $(cxx_objects)
@if [ ! -d $(LIBDIR) ]; then echo "mkdir -p $(LIBDIR)"; mkdir -p $(LIBDIR); fi
$(CXX) -shared -o $@ $(cxx_objects) $(LDFLAGS)
else
$(LIBDIR)/lib$(MG5AMC_COMMONLIB).so : $(cxx_objects) $(gpu_objects)
@if [ ! -d $(LIBDIR) ]; then echo "mkdir -p $(LIBDIR)"; mkdir -p $(LIBDIR); fi
$(GPUCC) -shared -o $@ $(cxx_objects) $(gpu_objects) $(LDFLAGS)
endif

#-------------------------------------------------------------------------------
Expand Down
16 changes: 8 additions & 8 deletions epochX/cudacpp/ee_mumu.mad/CODEGEN_mad_ee_mumu_log.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ generate e+ e- > mu+ mu-
No model currently active, so we import the Standard Model
INFO: load particles
INFO: load vertices
DEBUG: model prefixing takes 0.005721330642700195 
DEBUG: model prefixing takes 0.0057582855224609375 
INFO: Restrict model sm with file models/sm/restrict_default.dat .
DEBUG: Simplifying conditional expressions 
DEBUG: remove interactions: u s w+ at order: QED=1 
Expand Down Expand Up @@ -177,7 +177,7 @@ INFO: Generating Helas calls for process: e+ e- > mu+ mu- WEIGHTED<=4 @1
INFO: Processing color information for process: e+ e- > mu+ mu- @1
INFO: Creating files in directory P1_epem_mupmum
DEBUG: kwargs[prefix] = 0 [model_handling.py at line 1148] 
DEBUG: process_exporter_cpp =  <PLUGIN.CUDACPP_OUTPUT.model_handling.PLUGIN_OneProcessExporter object at 0x7efd14431700> [export_v4.py at line 6261] 
DEBUG: process_exporter_cpp =  <PLUGIN.CUDACPP_OUTPUT.model_handling.PLUGIN_OneProcessExporter object at 0x7f21a0e4e700> [export_v4.py at line 6261] 
INFO: Creating files in directory .
FileWriter <class 'PLUGIN.CUDACPP_OUTPUT.model_handling.PLUGIN_CPPWriter'> for ././CPPProcess.h
FileWriter <class 'PLUGIN.CUDACPP_OUTPUT.model_handling.PLUGIN_CPPWriter'> for ././CPPProcess.cc
Expand All @@ -194,19 +194,19 @@ INFO: Created files CPPProcess.h and CPPProcess.cc in directory ./.
INFO: Generating Feynman diagrams for Process: e+ e- > mu+ mu- WEIGHTED<=4 @1
INFO: Finding symmetric diagrams for subprocess group epem_mupmum
Generated helas calls for 1 subprocesses (2 diagrams) in 0.004 s
Wrote files for 8 helas calls in 0.102 s
Wrote files for 8 helas calls in 0.103 s
ALOHA: aloha starts to compute helicity amplitudes
ALOHA: aloha creates FFV1 routines
ALOHA: aloha creates FFV2 routines
ALOHA: aloha creates FFV4 routines
ALOHA: aloha creates 3 routines in 0.205 s
ALOHA: aloha creates 3 routines in 0.209 s
DEBUG: Entering PLUGIN_ProcessExporter.convert_model (create the model) [output.py at line 205] 
ALOHA: aloha starts to compute helicity amplitudes
ALOHA: aloha creates FFV1 routines
ALOHA: aloha creates FFV2 routines
ALOHA: aloha creates FFV4 routines
ALOHA: aloha creates FFV2_4 routines
ALOHA: aloha creates 7 routines in 0.263 s
ALOHA: aloha creates 7 routines in 0.272 s
<class 'aloha.create_aloha.AbstractRoutine'> FFV1
<class 'aloha.create_aloha.AbstractRoutine'> FFV1
<class 'aloha.create_aloha.AbstractRoutine'> FFV2
Expand Down Expand Up @@ -250,9 +250,9 @@ Type "launch" to generate events from this process, or see
Run "open index.html" to see more information about this process.
quit

real 0m2.183s
user 0m1.677s
sys 0m0.231s
real 0m1.930s
user 0m1.716s
sys 0m0.204s
Code generation completed in 2 seconds
************************************************************
* *
Expand Down
Loading
Loading