Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
ba0f641
[pp4t] revert ggtt.sa CODEGEN log to before the cmsdy MR for easier m…
valassi May 22, 2023
b3a2a94
[pp4t] add pp_tttt to CODEGEN/generateAndCompare.sh
valassi Dec 8, 2022
9ce9daf
[pp4t] in ggtt.sa, move nwf from src/mgOnGpuConfig.h to SubProcesses/…
valassi Apr 26, 2023
193a2aa
[pp4t] in codegen, first attempt to backport #644, move nwf from src/…
valassi Apr 26, 2023
bb06063
[pp4t] in codegen, try to complete the backport #644: define "nwavefu…
valassi Apr 26, 2023
875b5de
[pp4t] regenerate ggtt.sa: P1 directory gets the wrong nwf=7 instead …
valassi Apr 26, 2023
6d27798
[pp4t] revert generation of ggtt.sa... nwf was wrong
valassi Apr 26, 2023
146cd26
[pp4t] in codegen, next (ugly) attempt to fix the P1-specific value o…
valassi Apr 26, 2023
175bf92
[pp4t] reverse the previous (ugly) attempt to fix the P1-specific val…
valassi May 22, 2023
c843f3b
[pp4t] in ggtt.sa try a different fix for #644: move nwf from CPPProc…
valassi Apr 26, 2023
d57d2fa
[pp4t] in ggtt.sa further modify the fix for nwf - move it to the cal…
valassi Apr 26, 2023
f582cd1
[pp4t] finally complete a fully functional CODEGEN with the correct n…
valassi May 22, 2023
65a05bd
[pp4t] in CODEGEN and gg_tt.sa improve the comment about nwavefuncs f…
valassi May 22, 2023
2be8489
[pp4t] regenerate gg_tt.sa with the latest CODEGEN, all ok - code is …
valassi May 22, 2023
df5e56a
[pp4t] regenerate the other 6 processes sa
valassi May 22, 2023
11f04dc
[pp4t] regenerate all 6 processes mad
valassi May 22, 2023
1662298
[pp4t] rerun 78 tput alltees, all ok
valassi May 23, 2023
534f4a9
[pp4t] ** COMPLETE PP4T ** rerun 15 tmad alltees, all ok
valassi May 23, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,6 @@ namespace mgOnGpu

const int nw6 = %(wavefuncsize)d; // dimensions of each wavefunction (HELAS KEK 91-11): e.g. 6 for e+ e- -> mu+ mu- (fermions and vectors)

const int nwf = %(nwavefunc)d; // #wavefunctions = #external (npar) + #internal: e.g. 5 for e+ e- -> mu+ mu- (1 internal is gamma or Z)

// --- Platform-specific software implementation details

// Maximum number of blocks per grid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,14 @@

// Hardcoded parameters for this process (constant class variables)
// [NB: this class assumes nprocesses==1 i.e. a single DSIG1 and no DSIG2 in Fortran (#272 and #343)]
// [NB: these parameters (e.g. nwf) are P1-specific, i.e. they are different for different P1 subdirectories (#644)]
// [NB: I am currently unable to get the right value of nwf in CPPProcess.h - will hardcode it in CPPProcess.cc instead (#644)]
//static const int nwf = ??; // #wavefunctions = #external (npar) + #internal: e.g. 5 for e+ e- -> mu+ mu- (1 internal is gamma or Z)

// Other variables of this instance (???)
//static const int ninitial = mgOnGpu::npari;
//static const int nexternal = %(nexternal)d; // mgOnGpu::npar (nexternal was nioparticles)
//static const int nwavefuncs = %(nwavefuncs)d; // mgOnGpu::nwf
//static const int nwavefuncs = %(nwavefuncs)d; // (?!?! this should be nwf but export_cpp gives the wrong value here)
//static const int namplitudes = %(namp)d;
//static const int ncomb = %(ncomb)d; // mgOnGpu::ncomb

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ namespace mg5amcCpu
using mgOnGpu::npar; // #particles in total (external = initial + final): e.g. 4 for e+ e- -> mu+ mu-
using mgOnGpu::ncomb; // #helicity combinations: e.g. 16 for e+ e- -> mu+ mu- (2**4 = fermion spin up/down ** npar)

using mgOnGpu::nwf; // #wavefunctions = #external (npar) + #internal: e.g. 5 for e+ e- -> mu+ mu- (1 internal is gamma or Z)
using mgOnGpu::nw6; // dimensions of each wavefunction (HELAS KEK 91-11): e.g. 6 for e+ e- -> mu+ mu- (fermions and vectors)

// [NB: I am currently unable to get the right value of nwf in CPPProcess.h - will hardcode it in CPPProcess.cc instead (#644)]
//using CPPProcess::nwf; // #wavefunctions = #external (npar) + #internal: e.g. 5 for e+ e- -> mu+ mu- (1 internal is gamma or Z)

using Parameters_%(model_name)s_dependentCouplings::ndcoup; // #couplings that vary event by event (depend on running alphas QCD)
using Parameters_%(model_name)s_independentCouplings::nicoup; // #couplings that are fixed for all events (do not depend on running alphas QCD)

Expand Down
49 changes: 29 additions & 20 deletions epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/model_handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -1037,6 +1037,9 @@ def __init__(self, *args, **kwargs):
def get_process_class_definitions(self, write=True):
replace_dict = super().get_process_class_definitions(write=False)
replace_dict['process_lines'] = replace_dict['process_lines'].replace('\n','\n ')
###misc.sprint( replace_dict['nwavefuncs'] ) # NB: this (from export_cpp) is the WRONG value of nwf, e.g. 6 for gg_tt (#644)
###misc.sprint( self.matrix_elements[0].get_number_of_wavefunctions() ) # NB: this is a different WRONG value of nwf, e.g. 7 for gg_tt (#644)
###replace_dict['nwavefunc'] = self.matrix_elements[0].get_number_of_wavefunctions() # how do I get HERE the right value of nwf, e.g. 5 for gg_tt?
file = self.read_template_file(self.process_class_template) % replace_dict # HACK! ignore write=False case
file = '\n'.join( file.split('\n')[8:] ) # skip first 8 lines in process_class.inc (copyright)
return file
Expand Down Expand Up @@ -1140,6 +1143,24 @@ def get_all_sigmaKin_lines(self, color_amplitudes, class_name):
ret_lines = []
if self.single_helicities:
###assert self.include_multi_channel # remove this assert: must handle both cases and produce two different code bases (#473)
misc.sprint(type(self.helas_call_writer))
misc.sprint(self.support_multichannel, self.include_multi_channel)
multi_channel = None
if self.include_multi_channel:
if not self.support_multichannel:
raise Exception("link with madevent not supported")
multi_channel = self.get_multi_channel_dictionary(self.matrix_elements[0].get('diagrams'), self.include_multi_channel)
misc.sprint(multi_channel)
###misc.sprint( 'before get_matrix_element_calls', self.matrix_elements[0].get_number_of_wavefunctions() ) # WRONG value of nwf, eg 7 for gg_tt
helas_calls = self.helas_call_writer.get_matrix_element_calls(\
self.matrix_elements[0],
color_amplitudes[0],
multi_channel_map = multi_channel
)
###misc.sprint( 'after get_matrix_element_calls', self.matrix_elements[0].get_number_of_wavefunctions() ) # CORRECT value of nwf, eg 5 for gg_tt
assert len(self.matrix_elements) == 1 # how to handle if this is not true?
self.couplings2order = self.helas_call_writer.couplings2order
self.params2order = self.helas_call_writer.params2order
ret_lines.append("""
// Evaluate |M|^2 for each subprocess
// NB: calculate_wavefunctions ADDS |M|^2 for a given ihel to the running sum of |M|^2 over helicities for the given event(s)
Expand Down Expand Up @@ -1192,8 +1213,13 @@ def get_all_sigmaKin_lines(self, color_amplitudes, class_name):
//printf( \"calculate_wavefunctions: ihel=%2d\\n\", ihel );
#ifndef __CUDACC__
//printf( \"calculate_wavefunctions: ievt00=%d\\n\", ievt00 );
#endif

#endif""")
nwavefuncs = self.matrix_elements[0].get_number_of_wavefunctions()
ret_lines.append("""
// The variable nwf (which is specific to each P1 subdirectory, #644) is only used here
// It is hardcoded here because various attempts to hardcode it in CPPProcess.h at generation time gave the wrong result...
static const int nwf = %i; // #wavefunctions = #external (npar) + #internal: e.g. 5 for e+ e- -> mu+ mu- (1 internal is gamma or Z)"""%nwavefuncs )
ret_lines.append("""
// Local TEMPORARY variables for a subset of Feynman diagrams in the given CUDA event (ievt) or C++ event page (ipagV)
// [NB these variables are reused several times (and re-initialised each time) within the same event or event page]
// ** NB: in other words, amplitudes and wavefunctions still have TRIVIAL ACCESS: there is currently no need
Expand Down Expand Up @@ -1225,23 +1251,6 @@ def get_all_sigmaKin_lines(self, color_amplitudes, class_name):
#ifndef __CUDACC__
const int ievt0 = ievt00 + iParity * neppV;
#endif""")
misc.sprint(type(self.helas_call_writer))
misc.sprint(self.support_multichannel, self.include_multi_channel)
multi_channel = None
if self.include_multi_channel:
if not self.support_multichannel:
raise Exception("link with madevent not supported")
multi_channel = self.get_multi_channel_dictionary(self.matrix_elements[0].get('diagrams'), self.include_multi_channel)
misc.sprint(multi_channel)
helas_calls = self.helas_call_writer.get_matrix_element_calls(\
self.matrix_elements[0],
color_amplitudes[0],
multi_channel_map = multi_channel
)
assert len(self.matrix_elements) == 1 # how to handle if this is not true?
self.couplings2order = self.helas_call_writer.couplings2order
self.params2order = self.helas_call_writer.params2order
nwavefuncs = self.matrix_elements[0].get_number_of_wavefunctions()
ret_lines += helas_calls
else:
ret_lines.extend([self.get_sigmaKin_single_process(i, me) \
Expand Down Expand Up @@ -1335,7 +1344,7 @@ def edit_mgonGPU(self):
replace_dict['nincoming'] = nincoming
replace_dict['noutcoming'] = nexternal - nincoming
replace_dict['nbhel'] = self.matrix_elements[0].get_helicity_combinations() # number of helicity combinations
replace_dict['nwavefunc'] = self.matrix_elements[0].get_number_of_wavefunctions()
###replace_dict['nwavefunc'] = self.matrix_elements[0].get_number_of_wavefunctions() # this is the correct P1-specific nwf, now in CPPProcess.h (#644)
replace_dict['wavefuncsize'] = 6
if self.include_multi_channel:
replace_dict['mgongpu_supports_multichannel'] = '#define MGONGPU_SUPPORTS_MULTICHANNEL 1'
Expand Down
3 changes: 3 additions & 0 deletions epochX/cudacpp/CODEGEN/generateAndCompare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ function codeGenAndDiff()
pp_tt)
cmd="generate p p > t t~"
;;
pp_tttt)
cmd="generate p p > t t~ t t~"
;;
uu_tt)
cmd="generate u u~ > t t~"
;;
Expand Down
54 changes: 27 additions & 27 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.0050487518310546875 
DEBUG: model prefixing takes 0.00481867790222168 
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 @@ -176,31 +176,31 @@ INFO: Creating files in directory P1_epem_mupmum
DEBUG: Entering PLUGIN_OneProcessExporter.__init__ [model_handling.py at line 1027] 
DEBUG: kwargs[prefix] = 0 [model_handling.py at line 1028] 
DEBUG: proc_id =  1 [model_handling.py at line 1033] 
DEBUG: process_exporter_cpp =  <PLUGIN.CUDACPP_SA_OUTPUT.model_handling.PLUGIN_OneProcessExporter object at 0x7fdac9022430> [export_v4.py at line 6163] 
DEBUG: process_exporter_cpp =  <PLUGIN.CUDACPP_SA_OUTPUT.model_handling.PLUGIN_OneProcessExporter object at 0x7fb98cd4f430> [export_v4.py at line 6163] 
INFO: Creating files in directory .
DEBUG: Entering PLUGIN_OneProcessExporter.generate_process_files [model_handling.py at line 1272] 
DEBUG: self.include_multi_channel is already defined: this is madevent+second_exporter mode [model_handling.py at line 1274] 
DEBUG: Entering PLUGIN_OneProcessExporter.generate_process_files [model_handling.py at line 1281] 
DEBUG: self.include_multi_channel is already defined: this is madevent+second_exporter mode [model_handling.py at line 1283] 
FileWriter <class 'PLUGIN.CUDACPP_SA_OUTPUT.model_handling.PLUGIN_CPPWriter'> for ././CPPProcess.h
DEBUG: Entering PLUGIN_OneProcessExporter.write_process_h_file [model_handling.py at line 1415] 
DEBUG: Entering PLUGIN_OneProcessExporter.write_process_h_file [model_handling.py at line 1424] 
FileWriter <class 'PLUGIN.CUDACPP_SA_OUTPUT.model_handling.PLUGIN_CPPWriter'> for ././CPPProcess.cc
DEBUG: Entering PLUGIN_OneProcessExporter.write_process_cc_file [model_handling.py at line 1437] 
DEBUG: Entering PLUGIN_OneProcessExporter.get_sigmaKin_lines [model_handling.py at line 1124] 
DEBUG: self.include_multi_channel =  [1, 2] [model_handling.py at line 1125] 
DEBUG: self.support_multichannel =  True [model_handling.py at line 1126] 
DEBUG: type(self.helas_call_writer) =  <class 'PLUGIN.CUDACPP_SA_OUTPUT.model_handling.PLUGIN_GPUFOHelasCallWriter'> [model_handling.py at line 1228] 
DEBUG: self.support_multichannel, self.include_multi_channel =  True [1, 2] [model_handling.py at line 1229] 
DEBUG: multi_channel =  {1: [0], 2: [1]} [model_handling.py at line 1235] 
DEBUG: multi_channel_map =  {1: [0], 2: [1]} [model_handling.py at line 1616] 
DEBUG: diag_to_config =  {1: 1, 2: 2} [model_handling.py at line 1671] 
DEBUG: Entering PLUGIN_OneProcessExporter.write_process_cc_file [model_handling.py at line 1446] 
DEBUG: Entering PLUGIN_OneProcessExporter.get_sigmaKin_lines [model_handling.py at line 1127] 
DEBUG: self.include_multi_channel =  [1, 2] [model_handling.py at line 1128] 
DEBUG: self.support_multichannel =  True [model_handling.py at line 1129] 
DEBUG: type(self.helas_call_writer) =  <class 'PLUGIN.CUDACPP_SA_OUTPUT.model_handling.PLUGIN_GPUFOHelasCallWriter'> [model_handling.py at line 1146] 
DEBUG: self.support_multichannel, self.include_multi_channel =  True [1, 2] [model_handling.py at line 1147] 
DEBUG: multi_channel =  {1: [0], 2: [1]} [model_handling.py at line 1153] 
DEBUG: multi_channel_map =  {1: [0], 2: [1]} [model_handling.py at line 1625] 
DEBUG: diag_to_config =  {1: 1, 2: 2} [model_handling.py at line 1680] 
INFO: Created files CPPProcess.h and CPPProcess.cc in directory ./.
DEBUG: Entering PLUGIN_OneProcessExporter.edit_CMakeLists [model_handling.py at line 1305] 
DEBUG: Entering PLUGIN_OneProcessExporter.edit_check_sa [model_handling.py at line 1314] 
DEBUG: Entering PLUGIN_OneProcessExporter.edit_mgonGPU [model_handling.py at line 1331] 
DEBUG: Entering PLUGIN_OneProcessExporter.edit_processidfile [model_handling.py at line 1351] 
DEBUG: Entering PLUGIN_OneProcessExporter.edit_coloramps [model_handling.py at line 1363] 
DEBUG: Entering PLUGIN_OneProcessExporter.edit_testxxx [model_handling.py at line 1381] 
DEBUG: Entering PLUGIN_OneProcessExporter.edit_memorybuffers [model_handling.py at line 1392] 
DEBUG: Entering PLUGIN_OneProcessExporter.edit_memoryaccesscouplings [model_handling.py at line 1403] 
DEBUG: Entering PLUGIN_OneProcessExporter.edit_CMakeLists [model_handling.py at line 1314] 
DEBUG: Entering PLUGIN_OneProcessExporter.edit_check_sa [model_handling.py at line 1323] 
DEBUG: Entering PLUGIN_OneProcessExporter.edit_mgonGPU [model_handling.py at line 1340] 
DEBUG: Entering PLUGIN_OneProcessExporter.edit_processidfile [model_handling.py at line 1360] 
DEBUG: Entering PLUGIN_OneProcessExporter.edit_coloramps [model_handling.py at line 1372] 
DEBUG: Entering PLUGIN_OneProcessExporter.edit_testxxx [model_handling.py at line 1390] 
DEBUG: Entering PLUGIN_OneProcessExporter.edit_memorybuffers [model_handling.py at line 1401] 
DEBUG: Entering PLUGIN_OneProcessExporter.edit_memoryaccesscouplings [model_handling.py at line 1412] 
DEBUG: proc_id =  1 [export_cpp.py at line 710] 
DEBUG: config_map =  [1, 2] [export_cpp.py at line 711] 
DEBUG: subproc_number =  0 [export_cpp.py at line 712] 
Expand All @@ -214,14 +214,14 @@ 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.174 s
ALOHA: aloha creates 3 routines in 0.173 s
DEBUG: Entering PLUGIN_ProcessExporter.convert_model (create the model) [output.py at line 187] 
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.221 s
ALOHA: aloha creates 7 routines in 0.216 s
<class 'aloha.create_aloha.AbstractRoutine'> FFV1
<class 'aloha.create_aloha.AbstractRoutine'> FFV1
<class 'aloha.create_aloha.AbstractRoutine'> FFV2
Expand Down Expand Up @@ -259,6 +259,6 @@ Type "launch" to generate events from this process, or see
Run "open index.html" to see more information about this process.
quit

real 0m1.765s
user 0m1.544s
sys 0m0.209s
real 0m1.847s
user 0m1.529s
sys 0m0.217s
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,11 @@ namespace mg5amcCpu
using mgOnGpu::npar; // #particles in total (external = initial + final): e.g. 4 for e+ e- -> mu+ mu-
using mgOnGpu::ncomb; // #helicity combinations: e.g. 16 for e+ e- -> mu+ mu- (2**4 = fermion spin up/down ** npar)

using mgOnGpu::nwf; // #wavefunctions = #external (npar) + #internal: e.g. 5 for e+ e- -> mu+ mu- (1 internal is gamma or Z)
using mgOnGpu::nw6; // dimensions of each wavefunction (HELAS KEK 91-11): e.g. 6 for e+ e- -> mu+ mu- (fermions and vectors)

// [NB: I am currently unable to get the right value of nwf in CPPProcess.h - will hardcode it in CPPProcess.cc instead (#644)]
//using CPPProcess::nwf; // #wavefunctions = #external (npar) + #internal: e.g. 5 for e+ e- -> mu+ mu- (1 internal is gamma or Z)

using Parameters_sm_dependentCouplings::ndcoup; // #couplings that vary event by event (depend on running alphas QCD)
using Parameters_sm_independentCouplings::nicoup; // #couplings that are fixed for all events (do not depend on running alphas QCD)

Expand Down Expand Up @@ -155,6 +157,10 @@ namespace mg5amcCpu
//printf( "calculate_wavefunctions: ievt00=%d\n", ievt00 );
#endif

// The variable nwf (which is specific to each P1 subdirectory, #644) is only used here
// It is hardcoded here because various attempts to hardcode it in CPPProcess.h at generation time gave the wrong result...
static const int nwf = 5; // #wavefunctions = #external (npar) + #internal: e.g. 5 for e+ e- -> mu+ mu- (1 internal is gamma or Z)

// Local TEMPORARY variables for a subset of Feynman diagrams in the given CUDA event (ievt) or C++ event page (ipagV)
// [NB these variables are reused several times (and re-initialised each time) within the same event or event page]
// ** NB: in other words, amplitudes and wavefunctions still have TRIVIAL ACCESS: there is currently no need
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,14 @@ namespace mg5amcCpu

// Hardcoded parameters for this process (constant class variables)
// [NB: this class assumes nprocesses==1 i.e. a single DSIG1 and no DSIG2 in Fortran (#272 and #343)]
// [NB: these parameters (e.g. nwf) are P1-specific, i.e. they are different for different P1 subdirectories (#644)]
// [NB: I am currently unable to get the right value of nwf in CPPProcess.h - will hardcode it in CPPProcess.cc instead (#644)]
//static const int nwf = ??; // #wavefunctions = #external (npar) + #internal: e.g. 5 for e+ e- -> mu+ mu- (1 internal is gamma or Z)

// Other variables of this instance (???)
//static const int ninitial = mgOnGpu::npari;
//static const int nexternal = 4; // mgOnGpu::npar (nexternal was nioparticles)
//static const int nwavefuncs = 6; // mgOnGpu::nwf
//static const int nwavefuncs = 6; // (?!?! this should be nwf but export_cpp gives the wrong value here)
//static const int namplitudes = 2;
//static const int ncomb = 16; // mgOnGpu::ncomb

Expand Down
2 changes: 0 additions & 2 deletions epochX/cudacpp/ee_mumu.mad/src/mgOnGpuConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,6 @@ namespace mgOnGpu

const int nw6 = 6; // dimensions of each wavefunction (HELAS KEK 91-11): e.g. 6 for e+ e- -> mu+ mu- (fermions and vectors)

const int nwf = 5; // #wavefunctions = #external (npar) + #internal: e.g. 5 for e+ e- -> mu+ mu- (1 internal is gamma or Z)

// --- Platform-specific software implementation details

// Maximum number of blocks per grid
Expand Down
Loading