path is not defined in CPPRunCard when treatcards is called outside launch
Closed this issue · 2 comments
valassi commented
Hi @oliviermattelaer this is one pending issue from #780. I take this and assign it to you. I have no idea how to solve it.
The problem is that reset_simd relies on self.path from CPPRunCard. This is correctly called in launch. But it is not if treatcards is called outside launch.
I added two debug lines
class CPPRunCard(banner_mod.RunCardLO):
def reset_simd(self, old_value, new_value, name):
+ print('DEBUG CPPRUNCARD', dir(self))
+ print('DEBUG CPPRUNCARD path', self.path)
if not hasattr(self, 'path'):
logger.warning('WARNING! CPPRunCard instance has no attribute path')
return
From launch
./bin/mg5_aMC
set stdout_level DEBUG
set zerowidth_tchannel F
generate g g > t t~
output madevent ../TMPOUT/CODEGEN_mad_gg_tt --hel_recycling=False --vector_size=16384 --me_exporter=standalone_cudacpp
launch
...
DEBUG CPPRUNCARD ['LO', '__add__', '__class__', '__class_getitem__', '__contains__', '__copy__', '__delattr__', '__delitem__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__ior__', '__iter__', '__le__', '__len__', '__lt__', '__module__', '__ne__', '__new__', '__or__', '__radd__', '__reduce__', '__reduce_ex__', '__repr__', '__reversed__', '__ror__', '__setattr__', '__setitem__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'add_param', 'add_unknown_entry', 'allowed_lep_densities', 'allowed_value', 'auto_set', 'blocks', 'check_validity', 'clear', 'comments', 'copy', 'create_default_for_process', 'cut_class', 'cuts_parameter', 'default_autodef_file', 'default_include_file', 'default_run_card', 'default_setup', 'definition_path', 'dict_parameter', 'display_block', 'do_help', 'donewarning', 'dummy_fct_file', 'edit_dummy_fct_from_file', 'f77_formatting', 'fct_mod', 'filename', 'fill_post_set_from_blocks', 'format_variable', 'fortran_name', 'fromkeys', 'get', 'get_banner_init_information', 'get_default', 'get_idbmup', 'get_last_value_include', 'get_lepton_densities', 'get_lhapdf_id', 'get_pdf_id', 'get_value_from_include', 'guess_entry_fromname', 'guess_type_from_value', 'hidden_param', 'include_as_parameter', 'includepath', 'items', 'keys', 'legacy_parameter', 'list_parameter', 'lower_to_case', 'make_Ptouch', 'make_clean', 'mod_inc_pdlabel', 'parameter_in_block', 'path', 'plugin_input', 'pop', 'popitem', 'post_set', 'post_set_fixed_fac_scale', 'post_set_fixed_fac_scale1', 'post_set_fixed_fac_scale2', 'post_set_pdlabel', 'post_set_pdlabel1', 'post_set_pdlabel2', 'read', 'remove_all_cut', 'reset_simd', 'set', 'setdefault', 'system_default', 'system_only', 'update', 'update_system_parameter_for_include', 'user_set', 'valid_line', 'values', 'warn', 'warned', 'write', 'write_autodef', 'write_include_file', 'write_one_include_file']
DEBUG CPPRUNCARD path /data/avalassi/GPU2023/madgraph4gpuX/MG5aMC/TMPOUT/CODEGEN_mad_gg_tt/Cards/run_card.dat
Outside launch
./bin/mg5_aMC
set stdout_level DEBUG
set zerowidth_tchannel F
generate g g > t t~
output madevent ../TMPOUT/CODEGEN_mad_gg_tt --hel_recycling=False --vector_size=16384 --me_exporter=standalone_cudacpp
quit
../TMPOUT/CODEGEN_mad_gg_tt/bin/madevent treatcards
...
DEBUG CPPRUNCARD ['LO', '__add__', '__class__', '__class_getitem__', '__contains__', '__copy__', '__delattr__', '__delitem__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__ior__', '__iter__', '__le__', '__len__', '__lt__', '__module__', '__ne__', '__new__', '__or__', '__radd__', '__reduce__', '__reduce_ex__', '__repr__', '__reversed__', '__ror__', '__setattr__', '__setitem__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'add_param', 'add_unknown_entry', 'allowed_lep_densities', 'allowed_value', 'auto_set', 'blocks', 'check_validity', 'clear', 'comments', 'copy', 'create_default_for_process', 'cut_class', 'cuts_parameter', 'default_autodef_file', 'default_include_file', 'default_run_card', 'default_setup', 'definition_path', 'dict_parameter', 'display_block', 'do_help', 'donewarning', 'dummy_fct_file', 'edit_dummy_fct_from_file', 'f77_formatting', 'fct_mod', 'filename', 'fill_post_set_from_blocks', 'format_variable', 'fortran_name', 'fromkeys', 'get', 'get_banner_init_information', 'get_default', 'get_idbmup', 'get_last_value_include', 'get_lepton_densities', 'get_lhapdf_id', 'get_pdf_id', 'get_value_from_include', 'guess_entry_fromname', 'guess_type_from_value', 'hidden_param', 'include_as_parameter', 'includepath', 'items', 'keys', 'legacy_parameter', 'list_parameter', 'lower_to_case', 'make_Ptouch', 'make_clean', 'mod_inc_pdlabel', 'parameter_in_block', 'plugin_input', 'pop', 'popitem', 'post_set', 'post_set_fixed_fac_scale', 'post_set_fixed_fac_scale1', 'post_set_fixed_fac_scale2', 'post_set_pdlabel', 'post_set_pdlabel1', 'post_set_pdlabel2', 'read', 'remove_all_cut', 'reset_simd', 'set', 'setdefault', 'system_default', 'system_only', 'update', 'update_system_parameter_for_include', 'user_set', 'valid_line', 'values', 'warn', 'warned', 'write', 'write_autodef', 'write_include_file', 'write_one_include_file']
Command "treatcards" interrupted with error:
AttributeError : 'CPPRunCard' object has no attribute 'path'
Please report this bug on https://bugs.launchpad.net/mg5amcnlo
More information is found in 'ME5_debug'.
Please attach this file to your report.
Thanks Andrea
oliviermattelaer commented
I have pushed in the gpucpp branch a fix about this, I let you include it in this repo by updating the sub-repo