Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

path is not defined in CPPRunCard when treatcards is called outside launch #790

Closed
valassi opened this issue Nov 3, 2023 · 2 comments · Fixed by #788
Closed

path is not defined in CPPRunCard when treatcards is called outside launch #790

valassi opened this issue Nov 3, 2023 · 2 comments · Fixed by #788
Assignees

Comments

@valassi
Copy link
Member

valassi commented Nov 3, 2023

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
Copy link
Member

I have pushed in the gpucpp branch a fix about this, I let you include it in this repo by updating the sub-repo

valassi added a commit to valassi/madgraph4gpu that referenced this issue Nov 15, 2023
valassi added a commit to valassi/madgraph4gpu that referenced this issue Nov 15, 2023
valassi added a commit to valassi/madgraph4gpu that referenced this issue Nov 15, 2023
valassi added a commit to valassi/madgraph4gpu that referenced this issue Nov 15, 2023
@valassi valassi linked a pull request Nov 15, 2023 that will close this issue
@valassi
Copy link
Member Author

valassi commented Nov 15, 2023

Thanks Olivier, I added this fix in PR #788, this can be closed

@valassi valassi closed this as completed Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants