Skip to content

Commit 4ef15ca

Browse files
committed
Merge remote-tracking branch 'origin/gpucpp' (including gpucpp_fixci mg5amcnlo#132) into valassi_gpucpp_june24
Fix conflicts: madgraph/various/banner.py (keep a debug printout in get_value_from_include)
2 parents f0b4299 + d7242c1 commit 4ef15ca

File tree

7 files changed

+41
-23
lines changed

7 files changed

+41
-23
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ ptest*
1111
*.pkl
1212
p_ME_*
1313
*.log
14+
.DS_Store
1415
input/default_run_card_lo.dat
1516
input/default_run_card_nlo.dat
1617
input/mg5_configuration.txt

madgraph/interface/madgraph_interface.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1534,7 +1534,7 @@ def check_set(self, args, log=True):
15341534

15351535
if args[0] in ['group_subprocesses']:
15361536
if args[1].lower() not in ['false', 'true', 'auto', 'gpu']:
1537-
raise self.InvalidCmd('%s needs argument False, True or Auto, got %s' % \
1537+
raise self.InvalidCmd('%s needs argument False, True, gpu or Auto, got %s' % \
15381538
(args[0], args[1]))
15391539
if args[0] in ['ignore_six_quark_processes']:
15401540
if args[1] not in list(self._multiparticles.keys()) and args[1].lower() != 'false':
@@ -2596,11 +2596,13 @@ def complete_set(self, text, line, begidx, endidx):
25962596
return self.list_completion(text, opts)
25972597

25982598
if len(args) == 2:
2599-
if args[1] in ['group_subprocesses', 'complex_mass_scheme',\
2599+
if args[1] in ['complex_mass_scheme',\
26002600
'loop_optimized_output', 'loop_color_flows',\
26012601
'include_lepton_initiated_processes',\
26022602
'low_mem_multicore_nlo_generation', 'nlo_mixed_expansion']:
26032603
return self.list_completion(text, ['False', 'True', 'default'])
2604+
elif args[1] in ['group_subprocesses']:
2605+
return self.list_completion(text, ['False', 'True', 'Auto', 'gpu', 'nlo'])
26042606
elif args[1] in ['ignore_six_quark_processes']:
26052607
return self.list_completion(text, list(self._multiparticles.keys()))
26062608
elif args[1].lower() == 'ewscheme':

madgraph/iolibs/export_v4.py

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -359,9 +359,7 @@ def copy_template(self, model):
359359
MG_version['version'])
360360

361361
# add the makefile in Source directory
362-
filename = pjoin(self.dir_path,'Source','makefile')
363-
self.write_source_makefile(writers.FileWriter(filename))
364-
362+
# now moved to finalize
365363

366364
self.write_vector_size(writers.FortranWriter('vector.inc'))
367365

@@ -476,7 +474,14 @@ def pass_information_from_cmd(self, cmd):
476474
#===========================================================================
477475
def finalize(self, matrix_elements, history='', mg5options={}, flaglist=[], second_exporter=None):
478476
"""Function to finalize v4 directory, for inheritance."""
479-
477+
478+
filename = pjoin(self.dir_path,'Source','makefile')
479+
if not second_exporter:
480+
self.write_source_makefile(writers.FileWriter(filename))
481+
else:
482+
replace_dict = self.write_source_makefile(None)
483+
second_exporter.write_source_makefile(writers.FileWriter(filename), default=replace_dict)
484+
480485
if second_exporter:
481486
self.has_second_exporter = second_exporter
482487

@@ -725,17 +730,18 @@ def write_source_makefile(self, writer):
725730
path = pjoin(_file_path,'iolibs','template_files','madevent_makefile_source')
726731
set_of_lib = ' '.join(['$(LIBRARIES)']+self.get_source_libraries_list())
727732
if self.opt['model'] == 'mssm' or self.opt['model'].startswith('mssm-'):
728-
model_line='''$(LIBDIR)libmodel.$(libext): MODEL param_card.inc\n\tcd MODEL; make
733+
model_line='''$(LIBDIR)libmodel.$(libext): MODEL param_card.inc vector.inc\n\tcd MODEL; make
729734
MODEL/MG5_param.dat: ../Cards/param_card.dat\n\t../bin/madevent treatcards param
730735
param_card.inc: MODEL/MG5_param.dat\n\t../bin/madevent treatcards param\n'''
731736
else:
732-
model_line='''$(LIBDIR)libmodel.$(libext): MODEL param_card.inc\n\tcd MODEL; make
737+
model_line='''$(LIBDIR)libmodel.$(libext): MODEL param_card.inc vector.inc\n\tcd MODEL; make
733738
param_card.inc: ../Cards/param_card.dat\n\t../bin/madevent treatcards param\n'''
734739

735740
replace_dict= {'libraries': set_of_lib,
736741
'model':model_line,
737742
'additional_dsample': '',
738743
'additional_dependencies':'',
744+
'additional_clean':'',
739745
'running': ''}
740746

741747
if self.opt['running']:
@@ -3024,6 +3030,7 @@ def write_source_makefile(self, writer, model):
30243030
'model':model_line,
30253031
'additional_dsample': '',
30263032
'additional_dependencies':'',
3033+
'additional_clean':'',
30273034
'running': running_line}
30283035

30293036
text = open(path).read() % replace_dict
@@ -6308,7 +6315,6 @@ def generate_subprocess_directory(self, subproc_group,
63086315

63096316
if second_exporter:
63106317
process_exporter_cpp = second_exporter.oneprocessclass(matrix_element,second_helas, prefix=ime)
6311-
misc.sprint(process_exporter_cpp)
63126318
dirpath = '.'
63136319
with misc.chdir(dirpath):
63146320
logger.info('Creating files in directory %s' % dirpath)
@@ -6845,7 +6851,15 @@ def finalize(self,*args, second_exporter=None, **opts):
68456851
self.has_second_exporter = second_exporter
68466852
super(ProcessExporterFortranMEGroup, self).finalize(*args, second_exporter=None, **opts)
68476853
#ensure that the grouping information is on the correct value
6848-
self.proc_characteristic['grouped_matrix'] = True
6854+
self.proc_characteristic['grouped_matrix'] = True
6855+
6856+
filename = pjoin(self.dir_path,'Source','makefile')
6857+
if not second_exporter:
6858+
self.write_source_makefile(writers.FileWriter(filename))
6859+
else:
6860+
replace_dict = self.write_source_makefile(None)
6861+
second_exporter.write_source_makefile(writers.FileWriter(filename), default=replace_dict)
6862+
68496863
if second_exporter:
68506864
second_exporter.finalize(*args, **opts)
68516865

madgraph/iolibs/template_files/madevent_makefile_source

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,14 @@ $(BINDIR)gensudgrid: $(GENSUDGRID) $(LIBDIR)libpdf.$(libext) $(LIBDIR)libgammaUP
6868

6969
# Dependencies
7070

71-
dsample.o: DiscreteSampler.o dsample.f genps.inc StringCast.o
71+
dsample.o: DiscreteSampler.o dsample.f genps.inc StringCast.o vector.inc
7272
DiscreteSampler.o: StringCast.o
7373
invarients.o: invarients.f genps.inc
74-
setrun.o: setrun.f nexternal.inc leshouche.inc genps.inc
75-
gen_ximprove.o: gen_ximprove.f run_config.inc run_card.inc
74+
gen_ximprove.o: gen_ximprove.f run_config.inc run_card.inc
7675
#combine_events.o: combine_events.f run_config.inc run_card.inc
7776
combine_runs.o: combine_runs.f run_config.inc run_card.inc
7877
select_events.o: select_events.f run_config.inc
79-
setrun.o: setrun.f nexternal.inc leshouche.inc run_card.inc run_config.inc
78+
setrun.o: setrun.f nexternal.inc leshouche.inc run_card.inc run_config.inc genps.inc vector.inc
8079
rw_events.o: rw_events.f run_config.inc
8180
%(additional_dependencies)s
8281
run_card.inc: ../Cards/run_card.dat
@@ -116,7 +115,7 @@ $(LIBDIR)libiregi.a: $(IREGIDIR)
116115
cd $(IREGIDIR); make
117116
ln -sf ../Source/$(IREGIDIR)libiregi.a $(LIBDIR)libiregi.a
118117

119-
clean:
118+
cleanSource: # Clean builds: fortran in this Source
120119
$(RM) *.o $(LIBRARIES) $(BINARIES)
121120
cd PDF; make clean; cd ..
122121
cd PDF/gammaUPC; make clean; cd ../../
@@ -128,4 +127,8 @@ clean:
128127
cd BIAS/ptj_bias; make clean; cd ../..
129128
if [ -d $(CUTTOOLSDIR) ]; then cd $(CUTTOOLSDIR); make clean; cd ..; fi
130129
if [ -d $(IREGIDIR) ]; then cd $(IREGIDIR); make clean; cd ..; fi
130+
131+
clean: cleanSource # Clean builds: fortran in this Source and in all P*
131132
for i in `ls -d ../SubProcesses/P*`; do cd $$i; make clean; cd -; done;
133+
134+
%(additional_clean)s

madgraph/various/banner.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3166,13 +3166,9 @@ def get_value_from_include(self, path, list_of_params, output_dir):
31663166
with open(pjoin(output_dir,path), 'r') as fsock:
31673167
text = fsock.read()
31683168

3169-
for name in list_of_params:
3170-
misc.sprint(name, name in self.fortran_name)
3171-
misc.sprint(self.fortran_name[name] if name in self.fortran_name[name] else name)
31723169
to_track = [self.fortran_name[name] if name in self.fortran_name else name for name in list_of_params]
31733170
pattern = re.compile(r"\(?(%(names)s)\s?=\s?([^)]*)\)?" % {'names':'|'.join(to_track)}, re.I)
31743171
out = dict(pattern.findall(text))
3175-
misc.sprint(out)
31763172
for name in list_of_params:
31773173
if name in self.fortran_name:
31783174
value = out[self.fortran_name[name]]

models/template_files/fortran/makefile_madevent

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,11 @@ $(LIBDIR)$(LIBRARY): $(MODEL)
4141
clean:
4242
$(RM) *.o $(LIBDIR)$(LIBRARY)
4343

44-
couplings.f: ../maxparticles.inc ../run.inc
44+
couplings.o: ../maxparticles.inc ../run.inc ../vector.inc
45+
couplings2.o: ../vector.inc
4546

4647
../run.inc:
4748
touch ../run.inc
4849

4950
../maxparticles.inc:
50-
touch ../maxparticles.inc
51+
touch ../maxparticles.inc

models/template_files/fortran/makefile_standalone

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ $(LIBDIR)$(LIBRARY): $(MODEL)
3535
clean:
3636
$(RM) *.o $(LIBDIR)$(LIBRARY)
3737

38-
couplings.f: ../maxparticles.inc ../run.inc ../cuts.inc
38+
couplings.o: ../maxparticles.inc ../run.inc ../cuts.inc ../vector.inc
39+
3940

4041
../maxparticles.inc:
4142
touch ../maxparticles.inc
@@ -47,4 +48,4 @@ couplings.f: ../maxparticles.inc ../run.inc ../cuts.inc
4748
echo " logical fixed_extra_scale" > ../cuts.inc
4849
echo " integer maxjetflavor" >> ../cuts.inc
4950
echo " double precision mue_ref_fixed, mue_over_ref" >> ../cuts.inc
50-
51+

0 commit comments

Comments
 (0)