Skip to content

Commit

Permalink
Merge pull request madgraph5#980 from madgraph5/testsuite_only_fixed
Browse files Browse the repository at this point in the history
implement new CI and fixed the one related to the compilation issue.
  • Loading branch information
valassi authored Sep 1, 2024
2 parents 2d95c01 + c153482 commit c4c6e13
Show file tree
Hide file tree
Showing 75 changed files with 599 additions and 793 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,6 @@ index a59181c70..af7e0efbc 100644
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
+++ a/epochX/cudacpp/gg_tt.mad/Source/makefile
@@ -120,7 +120,7 @@ $(LIBDIR)libiregi.a: $(IREGIDIR)
cd $(IREGIDIR); make
ln -sf ../Source/$(IREGIDIR)libiregi.a $(LIBDIR)libiregi.a

-clean:
+cleanSource:
$(RM) *.o $(LIBRARIES) $(BINARIES)
cd PDF; make clean; cd ..
cd PDF/gammaUPC; make clean; cd ../../
@@ -132,4 +132,11 @@ clean:
cd BIAS/ptj_bias; make clean; cd ../..
if [ -d $(CUTTOOLSDIR) ]; then cd $(CUTTOOLSDIR); make clean; cd ..; fi
if [ -d $(IREGIDIR) ]; then cd $(IREGIDIR); make clean; cd ..; fi
+
+clean: cleanSource
for i in `ls -d ../SubProcesses/P*`; do cd $$i; make clean; cd -; done;
+
+cleanavx:
+ for i in `ls -d ../SubProcesses/P*`; do cd $$i; make cleanavxs; cd -; done;
+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..64b33c4f1 100644
--- b/epochX/cudacpp/gg_tt.mad/SubProcesses/makefile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def reset_simd(self, old_value, new_value, name):
# code can handle the new size -> do not recompile
return
Sourcedir = pjoin(os.path.dirname(os.path.dirname(self.path)), 'Source')
subprocess.call(['make', 'cleanavx'], cwd=Sourcedir, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
subprocess.call(['make', 'cleanall'], cwd=Sourcedir, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)

def reset_makeopts(self, old_value, new_value, name):
if not hasattr(self, 'path'):
Expand All @@ -78,7 +78,7 @@ def reset_makeopts(self, old_value, new_value, name):
else:
raise Exception
Sourcedir = pjoin(os.path.dirname(os.path.dirname(self.path)), 'Source')
subprocess.call(['make', 'cleanavx'], cwd=Sourcedir, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
subprocess.call(['make', 'cleanall'], cwd=Sourcedir, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)

def plugin_input(self, finput):
return
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
cleanavxs: # Clean builds: fortran in all P*; cudacpp for all AVX in all P* and in src
for i in `ls -d ../SubProcesses/P*`; do cd $$i; make cleanavxs; cd -; done;

cleanall: cleanSource cleanavxs # Clean builds: fortran in this Source and in all P*; cudacpp for all AVX in all P* and in src
15 changes: 14 additions & 1 deletion epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
# AV - create a plugin-specific logger
import logging
logger = logging.getLogger('madgraph.PLUGIN.CUDACPP_OUTPUT.output')

from madgraph import MG5DIR
#------------------------------------------------------------------------------------

from os.path import join as pjoin
Expand Down Expand Up @@ -191,6 +191,19 @@ def copy_template(self, model):
makefile_test = self.read_template_file(self.template_tst_make) % {'model': self.get_model_name(model.get('name'))}
open(os.path.join('test', 'cudacpp_test.mk'), 'w').write(makefile_test)

# OM - overload export_v4.py version to add additional_clean section (and avoid patchMad.sh for Source/makefile)
def write_source_makefile(self, writer, default=None):
if default:
replace_dict = default
else:
raise Exception('primary exporter should have been run first')
path = pjoin(PLUGINDIR , 'madgraph', 'iolibs', 'template_files', 'madevent_makefile_source_addon')
replace_dict['additional_clean'] += open(path).read()
if writer:
path = pjoin(MG5DIR, 'madgraph', 'iolibs','template_files','madevent_makefile_source')
text = open(path).read() % replace_dict
writer.write(text)

# AV - add debug printouts (in addition to the default one from OM's tutorial)
def generate_subprocess_directory(self, subproc_group, fortran_model, me=None):
misc.sprint('Entering PLUGIN_ProcessExporter.generate_subprocess_directory (create the directory)')
Expand Down
36 changes: 16 additions & 20 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.005307912826538086 
DEBUG: model prefixing takes 0.00567936897277832 
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 @@ -154,7 +154,7 @@ INFO: Checking for minimal orders which gives processes.
INFO: Please specify coupling orders to bypass this step.
INFO: Trying process: e+ e- > mu+ mu- WEIGHTED<=4 @1
INFO: Process has 2 diagrams
1 processes with 2 diagrams generated in 0.004 s
1 processes with 2 diagrams generated in 0.005 s
Total: 1 processes with 2 diagrams
output madevent_simd ../TMPOUT/CODEGEN_mad_ee_mumu --hel_recycling=False --vector_size=32
Load PLUGIN.CUDACPP_OUTPUT
Expand All @@ -177,7 +177,6 @@ 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 1152] 
DEBUG: process_exporter_cpp =  <PLUGIN.CUDACPP_OUTPUT.model_handling.PLUGIN_OneProcessExporter object at 0x7f09ed66e490> [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 @@ -186,30 +185,30 @@ INFO: Created files CPPProcess.h and CPPProcess.cc in directory ./.
DEBUG: config_map =  [1, 2] [export_cpp.py at line 711] 
DEBUG: subproc_number =  0 [export_cpp.py at line 712] 
DEBUG: Done [export_cpp.py at line 713] 
DEBUG: vector, subproc_group,self.opt['vector_size'] =  False True 32 [export_v4.py at line 1871] 
DEBUG: vector, subproc_group,self.opt['vector_size'] =  False True 32 [export_v4.py at line 1871] 
DEBUG: vector, subproc_group,self.opt['vector_size'] =  32 True 32 [export_v4.py at line 1871] 
DEBUG: vector, subproc_group,self.opt['vector_size'] =  False True 32 [export_v4.py at line 1877] 
DEBUG: vector, subproc_group,self.opt['vector_size'] =  False True 32 [export_v4.py at line 1877] 
DEBUG: vector, subproc_group,self.opt['vector_size'] =  32 True 32 [export_v4.py at line 1877] 
WARNING: vector code for lepton pdf not implemented. We removed the option to run dressed lepton 
DEBUG: vector, subproc_group,self.opt['vector_size'] =  32 True 32 [export_v4.py at line 1871] 
DEBUG: vector, subproc_group,self.opt['vector_size'] =  32 True 32 [export_v4.py at line 1877] 
INFO: Generating Feynman diagrams for Process: e+ e- > mu+ mu- WEIGHTED<=4 @1
INFO: Finding symmetric diagrams for subprocess group epem_mupmum
DEBUG: os.getcwd() =  /data/avalassi/GPU2023/madgraph4gpuX/MG5aMC/TMPOUT/CODEGEN_mad_ee_mumu/SubProcesses/P1_epem_mupmum [export_v4.py at line 6438] 
DEBUG: os.getcwd() =  /data/avalassi/GPU2023/madgraph4gpuX/MG5aMC/TMPOUT/CODEGEN_mad_ee_mumu/SubProcesses/P1_epem_mupmum [export_v4.py at line 6444] 
DEBUG: len(subproc_diagrams_for_config) =  2 [model_handling.py at line 1520] 
DEBUG: iconfig_to_diag =  {1: 1, 2: 2} [model_handling.py at line 1544] 
DEBUG: diag_to_iconfig =  {1: 1, 2: 2} [model_handling.py at line 1545] 
Generated helas calls for 1 subprocesses (2 diagrams) in 0.004 s
Wrote files for 8 helas calls in 0.112 s
Wrote files for 8 helas calls in 0.107 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.198 s
ALOHA: aloha creates 3 routines in 0.202 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 FFV2_4 routines
ALOHA: aloha creates 7 routines in 0.253 s
ALOHA: aloha creates 7 routines in 0.258 s
<class 'aloha.create_aloha.AbstractRoutine'> FFV1
<class 'aloha.create_aloha.AbstractRoutine'> FFV1
<class 'aloha.create_aloha.AbstractRoutine'> FFV2
Expand All @@ -235,27 +234,24 @@ INFO: Generate jpeg diagrams
INFO: Generate web pages
DEBUG: cd /data/avalassi/GPU2023/madgraph4gpuX/MG5aMC/TMPOUT/CODEGEN_mad_ee_mumu; patch -p4 -i /data/avalassi/GPU2023/madgraph4gpuX/epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/MG5aMC_patches/PROD/patch.common
patching file Source/genps.inc
patching file Source/makefile
patching file SubProcesses/makefile
DEBUG: cd /data/avalassi/GPU2023/madgraph4gpuX/MG5aMC/TMPOUT/CODEGEN_mad_ee_mumu/SubProcesses/P1_epem_mupmum; patch -p6 -i /data/avalassi/GPU2023/madgraph4gpuX/epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/MG5aMC_patches/PROD/patch.P1
patching file auto_dsig1.f
Hunk #1 succeeded at 496 (offset 12 lines).
patching file driver.f
patching file matrix1.f
Hunk #3 succeeded at 230 (offset 9 lines).
Hunk #4 succeeded at 267 (offset 18 lines).
Hunk #5 succeeded at 312 (offset 18 lines).
DEBUG: p.returncode =  0 [output.py at line 242] 
Hunk #2 succeeded at 229 (offset 9 lines).
DEBUG: p.returncode =  0 [output.py at line 255] 
Output to directory /data/avalassi/GPU2023/madgraph4gpuX/MG5aMC/TMPOUT/CODEGEN_mad_ee_mumu done.
Type "launch" to generate events from this process, or see
/data/avalassi/GPU2023/madgraph4gpuX/MG5aMC/TMPOUT/CODEGEN_mad_ee_mumu/README
Run "open index.html" to see more information about this process.
quit

real 0m2.067s
user 0m1.807s
sys 0m0.251s
Code generation completed in 2 seconds
real 0m2.783s
user 0m1.820s
sys 0m0.261s
Code generation completed in 3 seconds
************************************************************
* *
* W E L C O M E to *
Expand Down
5 changes: 3 additions & 2 deletions epochX/cudacpp/ee_mumu.mad/Source/MODEL/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@ $(LIBDIR)$(LIBRARY): $(MODEL)
clean:
$(RM) *.o $(LIBDIR)$(LIBRARY)

couplings.f: ../maxparticles.inc ../run.inc
couplings.o: ../maxparticles.inc ../run.inc ../vector.inc
couplings2.o: ../vector.inc

../run.inc:
touch ../run.inc

../maxparticles.inc:
touch ../maxparticles.inc
touch ../maxparticles.inc
19 changes: 9 additions & 10 deletions epochX/cudacpp/ee_mumu.mad/Source/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ $(LIBDIR)libcernlib.$(libext): CERNLIB
$(LIBDIR)libbias.$(libext): BIAS/dummy
cd BIAS/dummy; make; cd ../../

$(LIBDIR)libmodel.$(libext): MODEL param_card.inc
$(LIBDIR)libmodel.$(libext): MODEL param_card.inc vector.inc
cd MODEL; make
param_card.inc: ../Cards/param_card.dat
../bin/madevent treatcards param
Expand All @@ -72,15 +72,14 @@ $(BINDIR)gensudgrid: $(GENSUDGRID) $(LIBDIR)libpdf.$(libext) $(LIBDIR)libgammaUP

# Dependencies

dsample.o: DiscreteSampler.o dsample.f genps.inc StringCast.o
dsample.o: DiscreteSampler.o dsample.f genps.inc StringCast.o vector.inc
DiscreteSampler.o: StringCast.o
invarients.o: invarients.f genps.inc
setrun.o: setrun.f nexternal.inc leshouche.inc genps.inc
gen_ximprove.o: gen_ximprove.f run_config.inc run_card.inc
gen_ximprove.o: gen_ximprove.f run_config.inc run_card.inc
#combine_events.o: combine_events.f run_config.inc run_card.inc
combine_runs.o: combine_runs.f run_config.inc run_card.inc
select_events.o: select_events.f run_config.inc
setrun.o: setrun.f nexternal.inc leshouche.inc run_card.inc run_config.inc
setrun.o: setrun.f nexternal.inc leshouche.inc run_card.inc run_config.inc genps.inc vector.inc
rw_events.o: rw_events.f run_config.inc

run_card.inc: ../Cards/run_card.dat
Expand Down Expand Up @@ -120,7 +119,7 @@ $(LIBDIR)libiregi.a: $(IREGIDIR)
cd $(IREGIDIR); make
ln -sf ../Source/$(IREGIDIR)libiregi.a $(LIBDIR)libiregi.a

cleanSource:
cleanSource: # Clean builds: fortran in this Source
$(RM) *.o $(LIBRARIES) $(BINARIES)
cd PDF; make clean; cd ..
cd PDF/gammaUPC; make clean; cd ../../
Expand All @@ -133,10 +132,10 @@ cleanSource:
if [ -d $(CUTTOOLSDIR) ]; then cd $(CUTTOOLSDIR); make clean; cd ..; fi
if [ -d $(IREGIDIR) ]; then cd $(IREGIDIR); make clean; cd ..; fi

clean: cleanSource
clean: cleanSource # Clean builds: fortran in this Source and in all P*
for i in `ls -d ../SubProcesses/P*`; do cd $$i; make clean; cd -; done;

cleanavx:
for i in `ls -d ../SubProcesses/P*`; do cd $$i; make cleanavxs; cd -; done;
cleanall: cleanSource # THIS IS THE ONE
cleanavxs: # Clean builds: fortran in all P*; cudacpp for all AVX in all P* and in src
for i in `ls -d ../SubProcesses/P*`; do cd $$i; make cleanavxs; cd -; done;

cleanall: cleanSource cleanavxs # Clean builds: fortran in this Source and in all P*; cudacpp for all AVX in all P* and in src
5 changes: 0 additions & 5 deletions epochX/cudacpp/ee_mumu.mad/bin/internal/banner.py
Original file line number Diff line number Diff line change
Expand Up @@ -3157,7 +3157,6 @@ def get_value_from_include(self, path, list_of_params, output_dir):
if path does not exists return the current value in self for all parameter"""

#WARNING DOES NOT HANDLE LIST/DICT so far

# handle case where file is missing
if not os.path.exists(pjoin(output_dir,path)):
misc.sprint("include file not existing", pjoin(output_dir,path))
Expand All @@ -3166,13 +3165,9 @@ def get_value_from_include(self, path, list_of_params, output_dir):
with open(pjoin(output_dir,path), 'r') as fsock:
text = fsock.read()

for name in list_of_params:
misc.sprint(name, name in self.fortran_name)
misc.sprint(self.fortran_name[name] if name in self.fortran_name[name] else name)
to_track = [self.fortran_name[name] if name in self.fortran_name else name for name in list_of_params]
pattern = re.compile(r"\(?(%(names)s)\s?=\s?([^)]*)\)?" % {'names':'|'.join(to_track)}, re.I)
out = dict(pattern.findall(text))
misc.sprint(out)
for name in list_of_params:
if name in self.fortran_name:
value = out[self.fortran_name[name]]
Expand Down
4 changes: 2 additions & 2 deletions epochX/cudacpp/ee_mumu.mad/bin/internal/launch_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def reset_simd(self, old_value, new_value, name):
# code can handle the new size -> do not recompile
return
Sourcedir = pjoin(os.path.dirname(os.path.dirname(self.path)), 'Source')
subprocess.call(['make', 'cleanavx'], cwd=Sourcedir, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
subprocess.call(['make', 'cleanall'], cwd=Sourcedir, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)

def reset_makeopts(self, old_value, new_value, name):
if not hasattr(self, 'path'):
Expand All @@ -78,7 +78,7 @@ def reset_makeopts(self, old_value, new_value, name):
else:
raise Exception
Sourcedir = pjoin(os.path.dirname(os.path.dirname(self.path)), 'Source')
subprocess.call(['make', 'cleanavx'], cwd=Sourcedir, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
subprocess.call(['make', 'cleanall'], cwd=Sourcedir, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)

def plugin_input(self, finput):
return
Expand Down
Loading

0 comments on commit c4c6e13

Please sign in to comment.