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

Port post-generation patches (patchMad.sh) upstream to mg5amcnlo or to the plugin #656

Closed
valassi opened this issue May 23, 2023 · 4 comments · Fixed by #747
Closed

Port post-generation patches (patchMad.sh) upstream to mg5amcnlo or to the plugin #656

valassi opened this issue May 23, 2023 · 4 comments · Fixed by #747
Assignees

Comments

@valassi
Copy link
Member

valassi commented May 23, 2023

Presently code generation in cudacpp goes through the patchMad.sh script, currently:
https://github.com/madgraph5/madgraph4gpu/blob/3a4850184f1de483bbab1bff5a6a322590692291/epochX/cudacpp/CODEGEN/patchMad.sh

This applies post-generation patches to the code generated using the python madgraph machinery. For a release, these patches must be instead moved upstream to mg5amcnlo (or to the plugin itself).

The main ingredients of this are the following (I may be forgetting a few):

Assigning this to me, cc @roiser and @oliviermattelaer

@valassi valassi self-assigned this May 23, 2023
@valassi
Copy link
Member Author

valassi commented May 23, 2023

Note, this is part of point 2 in #576

valassi added a commit to valassi/madgraph4gpu that referenced this issue Jun 2, 2023
…NAL)

The plan is to eventually copy these files from here rather than using patch.P1 and patch.common madgraph5#656
valassi added a commit to valassi/madgraph4gpu that referenced this issue Jun 2, 2023
…ified Fortran makefile if this is madevent + cudacpp madgraph5#656
valassi added a commit to valassi/madgraph4gpu that referenced this issue Jun 2, 2023
valassi added a commit to valassi/madgraph4gpu that referenced this issue Jun 3, 2023
…NAL)

The plan is to eventually copy these files from here rather than using patch.P1 and patch.common madgraph5#656
valassi added a commit to valassi/madgraph4gpu that referenced this issue Jun 3, 2023
…ified Fortran makefile if this is madevent + cudacpp madgraph5#656
valassi added a commit to valassi/madgraph4gpu that referenced this issue Jun 3, 2023
@valassi
Copy link
Member Author

valassi commented Jun 3, 2023

I have started a WIP patch for this in MR #675

valassi added a commit to valassi/madgraph4gpu that referenced this issue Jun 12, 2023
…g a modified MG5AMC for codegen

I used it to understand that run_card.dat is created by export_v4.py at the very end of everything...
It seems very difficult to imagine I can modify the runcard in the cudacpp plugin:
to add the -O3 global flags, I will have to do it in patchMad madgraph5#656 - and tell users to do it themselves
By the way I still need to test that the fastmath actually does not change much... madgraph5#252

I will therefore move both make_opts and runcard to patch.common and patch.P1...
valassi added a commit to valassi/madgraph4gpu that referenced this issue Jun 12, 2023
…5 more files in patch.common

./CODEGEN/generateAndCompare.sh gg_tt --mad --nopatch
git diff --no-ext-diff -R gg_tt.mad/Source/dsample.f gg_tt.mad/Source/genps.inc gg_tt.mad/Source/vector.inc gg_tt.mad/SubProcesses/makefile > CODEGEN/MG5aMC_patches/PROD/patch.common
git diff --no-ext-diff -R gg_tt.mad/Cards/run_card.dat gg_tt.mad/Source/make_opts gg_tt.mad/bin/internal/banner.py gg_tt.mad/bin/internal/gen_ximprove.py gg_tt.mad/bin/internal/madevent_interface.py >> CODEGEN/MG5aMC_patches/PROD/patch.common
git diff --no-ext-diff -R gg_tt.mad/SubProcesses/P1_gg_ttx/auto_dsig1.f gg_tt.mad/SubProcesses/P1_gg_ttx/driver.f gg_tt.mad/SubProcesses/P1_gg_ttx/matrix1.f > CODEGEN/MG5aMC_patches/PROD/patch.P1
git checkout gg_tt.mad

Clearly, this will make the removal of patchMad.sh more complex madgraph5#656
@valassi
Copy link
Member Author

valassi commented Aug 10, 2023

Note: the coloramps.h patch has now been removed from patchMad.sh (see #713, fixing #655)

@valassi valassi linked a pull request Aug 14, 2023 that will close this issue
@valassi valassi changed the title Remove patchMad.sh (port post-generation patches upstream to mg5amcnlo or to the plugin) Port post-generation patches (patchMad.sh) upstream to mg5amcnlo or to the plugin Aug 14, 2023
@valassi
Copy link
Member Author

valassi commented Aug 14, 2023

The strategy for integrating patchMad.sh patches upstream has changed:

This will be closed when we merge #747

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.

3 participants