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

generate_events tries to remove GpuAbstraction.h #947

Closed
valassi opened this issue Aug 2, 2024 · 7 comments · Fixed by #949
Closed

generate_events tries to remove GpuAbstraction.h #947

valassi opened this issue Aug 2, 2024 · 7 comments · Fixed by #949
Assignees

Comments

@valassi
Copy link
Member

valassi commented Aug 2, 2024

Trying to create a gridpack and use generate_events I get

INFO: Creating gridpack 
Command "generate_events -f" interrupted with error:
OSError : Cannot call rmtree on a symbolic link
Please report this bug on https://bugs.launchpad.net/mg5amcnlo
More information is found in '/data/avalassi/GPU2023/madgraph4gpuX/epochX/cudacpp/gg_tt.mad/run_01_tag_1_debug.log'.
Please attach this file to your report.
removing %s /data/avalassi/GPU2023/madgraph4gpuX/epochX/cudacpp/gg_tt.mad/SubProcesses/P1_gg_ttx/GpuAbstraction.h

(I had to add a manual print to show the path, because of mg5amcnlo/mg5amcnlo#123)

I guess it just tries to delete G* and it does not expect GpuAbstraction.h, which it should not remove...

@valassi valassi self-assigned this Aug 2, 2024
valassi added a commit to valassi/madgraph4gpu that referenced this issue Aug 2, 2024
valassi added a commit to valassi/madgraph4gpu that referenced this issue Aug 2, 2024
…eleting GpuAbstraction.h and GpuRuntime.h madgraph5#947

./CODEGEN/generateAndCompare.sh gg_tt --mad --nopatch
git diff --no-ext-diff -R gg_tt.mad/Source/makefile gg_tt.mad/Source/dsample.f gg_tt.mad/Source/genps.inc gg_tt.mad/SubProcesses/makefile > CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/MG5aMC_patches/PROD/patch.common
git diff --no-ext-diff -R gg_tt.mad/bin/internal/banner.py gg_tt.mad/bin/internal/gen_ximprove.py gg_tt.mad/bin/internal/madevent_interface.py >> CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/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/PLUGIN/CUDACPP_SA_OUTPUT/MG5aMC_patches/PROD/patch.P1
git checkout gg_tt.mad
@valassi
Copy link
Member Author

valassi commented Aug 2, 2024

This is a possible fix 8e29029

@oliviermattelaer I guess this is best only in cudacpp, but maybe you have better ideas

(Yes I know this is using patches, but this is what we have now, and this file is already included there)

@oliviermattelaer
Copy link
Member

Hi Andrea,

Sorry but not, python file CAN NOT be modified via patch.
For python file, this is not a question of style of coding/support/...

It is just WRONG to do that, the reason is that the code has priority to use MG5DIR/madgraph/interface/madevent_interface.py (same for other file) over bin/internal/madevent_interface.py
But since you do not patch (and you should not) MG5DIR/madgraph/interface/madevent_interface.py
the effect of the patch will be applied for some user and not for others.

I did implement the full framework needed to avoid any patch to any python file, so for sure we do not need any patch for any python file. We can do a peer programing together if you want to see how such change need to be properly handle if you want (or I can do it and you take a look, as you want)

@oliviermattelaer
Copy link
Member

Actually here, the best is likely to update upstream madgraph to add a check that this is a directory and not a file (or to change the name of the file to avoid the conflict).

valassi added a commit to valassi/mg5amcnlo that referenced this issue Aug 2, 2024
…te G* if it is not a directory (e.g. GpuAbstraction.h)
@valassi
Copy link
Member Author

valassi commented Aug 2, 2024

I did implement the full framework needed to avoid any patch to any python file,

Thanks (and apologies), my mistake. Indeed you had implemented this. I should have removed this madevent_interface.py from my instructions.

Now I created a patch upstream instead mg5amcnlo/mg5amcnlo#125

Actually here, the best is likely to update upstream madgraph to add a check that this is a directory and not a file

Thanks, this is exactly what I did in mg5amcnlo/mg5amcnlo#125

@valassi
Copy link
Member Author

valassi commented Aug 2, 2024

(Yes I know this is using patches, but this is what we have now, and this file is already included there)

Specifically, my mistake: "this file is already included there" was wrong, you had already removed it

oliviermattelaer pushed a commit to mg5amcnlo/mg5amcnlo that referenced this issue Aug 2, 2024
 do not delete G* if it is not a directory (e.g. GpuAbstraction.h)  madgraph5/madgraph4gpu#947
valassi added a commit to valassi/madgraph4gpu that referenced this issue Aug 2, 2024
…aph5#947 fix: do not delete G* if it is not a directory (e.g. GpuAbstraction.h)
valassi added a commit to valassi/madgraph4gpu that referenced this issue Aug 2, 2024
…adgraph5#947 fix: do not delete G* if it is not a directory (e.g. GpuAbstraction.h)
valassi added a commit to valassi/madgraph4gpu that referenced this issue Aug 2, 2024
…madgraph5#947 in madevent_interface.py (do not delete GpuAbstraction.h) via mg5amcnlo#125
valassi added a commit to valassi/madgraph4gpu that referenced this issue Aug 2, 2024
…ing any python file* as suggested by Olivier, after moving the fix for madgraph5#947 to mg5amcnlo#125

./CODEGEN/generateAndCompare.sh gg_tt --mad --nopatch
git diff --no-ext-diff -R gg_tt.mad/Source/makefile gg_tt.mad/Source/dsample.f gg_tt.mad/Source/genps.inc gg_tt.mad/SubProcesses/makefile > CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/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/PLUGIN/CUDACPP_SA_OUTPUT/MG5aMC_patches/PROD/patch.P1
git checkout gg_tt.mad
valassi added a commit to valassi/madgraph4gpu that referenced this issue Aug 2, 2024
@valassi
Copy link
Member Author

valassi commented Aug 2, 2024

I did implement the full framework needed to avoid any patch to any python file, so for sure we do not need any patch for any python file

Thanks again. I confirm that now my patches are created without any check on .py files. (I added a comment in #948 using mg5amcnlo/mg5amcnlo#125)

valassi added a commit to valassi/madgraph4gpu that referenced this issue Aug 2, 2024
…ing any python file* as suggested by Olivier, after moving the fix for madgraph5#947 to mg5amcnlo#125

Also remove Source/dsample.f from patch.common as this is no longer modified.

The only files that still need to be patched are
- 3 in patch.common: Source/makefile, Source/genps.inc, SubProcesses/makefile
- 3 in patch.P1: auto_dsig1.f, driver.f, matrix1.f

./CODEGEN/generateAndCompare.sh gg_tt --mad --nopatch
git diff --no-ext-diff -R gg_tt.mad/Source/makefile gg_tt.mad/Source/genps.inc gg_tt.mad/SubProcesses/makefile > CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/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/PLUGIN/CUDACPP_SA_OUTPUT/MG5aMC_patches/PROD/patch.P1
git checkout gg_tt.mad
valassi added a commit to valassi/madgraph4gpu that referenced this issue Aug 2, 2024
valassi added a commit to valassi/madgraph4gpu that referenced this issue Aug 2, 2024
valassi added a commit to valassi/madgraph4gpu that referenced this issue Aug 2, 2024
…eleting GpuAbstraction.h and GpuRuntime.h madgraph5#947

./CODEGEN/generateAndCompare.sh gg_tt --mad --nopatch
git diff --no-ext-diff -R gg_tt.mad/Source/makefile gg_tt.mad/Source/dsample.f gg_tt.mad/Source/genps.inc gg_tt.mad/SubProcesses/makefile > CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/MG5aMC_patches/PROD/patch.common
git diff --no-ext-diff -R gg_tt.mad/bin/internal/banner.py gg_tt.mad/bin/internal/gen_ximprove.py gg_tt.mad/bin/internal/madevent_interface.py >> CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/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/PLUGIN/CUDACPP_SA_OUTPUT/MG5aMC_patches/PROD/patch.P1
git checkout gg_tt.mad
valassi added a commit to valassi/madgraph4gpu that referenced this issue Aug 2, 2024
…aph5#947 fix: do not delete G* if it is not a directory (e.g. GpuAbstraction.h)
valassi added a commit to valassi/madgraph4gpu that referenced this issue Aug 2, 2024
…adgraph5#947 fix: do not delete G* if it is not a directory (e.g. GpuAbstraction.h)
valassi added a commit to valassi/madgraph4gpu that referenced this issue Aug 2, 2024
…madgraph5#947 in madevent_interface.py (do not delete GpuAbstraction.h) via mg5amcnlo#125
valassi added a commit to valassi/madgraph4gpu that referenced this issue Aug 2, 2024
…ing any python file* as suggested by Olivier, after moving the fix for madgraph5#947 to mg5amcnlo#125

Also remove Source/dsample.f from patch.common as this is no longer modified.

The only files that still need to be patched are
- 3 in patch.common: Source/makefile, Source/genps.inc, SubProcesses/makefile
- 3 in patch.P1: auto_dsig1.f, driver.f, matrix1.f

./CODEGEN/generateAndCompare.sh gg_tt --mad --nopatch
git diff --no-ext-diff -R gg_tt.mad/Source/makefile gg_tt.mad/Source/genps.inc gg_tt.mad/SubProcesses/makefile > CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/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/PLUGIN/CUDACPP_SA_OUTPUT/MG5aMC_patches/PROD/patch.P1
git checkout gg_tt.mad
valassi added a commit to valassi/madgraph4gpu that referenced this issue Aug 2, 2024
valassi added a commit to valassi/madgraph4gpu that referenced this issue Aug 2, 2024
…gpucpp after merging/squashing mg5amcnlo#125 fixing madgraph5#947, with an additional fix by Olivier)
@valassi
Copy link
Member Author

valassi commented Aug 2, 2024

This is fixed in mg5amcnlo/mg5amcnlo#125

Submodule being updated in PR #949

Closing

@valassi valassi closed this as completed Aug 2, 2024
valassi added a commit to valassi/madgraph4gpu that referenced this issue Aug 2, 2024
…ne24) to f0b429915 (current valassi_gpucpp_june24 including merge of mg5amcnlo#125 to fix madgraph5#947)
valassi added a commit to valassi/madgraph4gpu that referenced this issue Aug 2, 2024
…dgraph5#949 fixing madgraph5#947 via mg5amcnlo#125) into june24

Fix conflicts: epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/MG5aMC_patches/PROD/patch.common (keep the upstream/master version)
valassi added a commit to valassi/madgraph4gpu that referenced this issue Aug 2, 2024
…5#949 fixing madgraph5#947) into pptt

Fix conflicts in epochX/cudacpp/pp_tt.mad/CODEGEN_mad_pp_tt_log.txt (git checkout pptt pp_tt.mad/CODEGEN_mad_pp_tt_log.txt)
valassi added a commit to valassi/madgraph4gpu that referenced this issue Aug 2, 2024
Note: there is no change here, which is strange because pp_tt.mad/bin/internal/madevent_interface.py should have changed?
Strangely, git blame shows that this is considered as a move of gg_tt01g.mad...

git blame pp_tt.mad/bin/internal/madevent_interface.py  | grep 947
8a8ee1a epochX/cudacpp/gg_tt01g.mad/bin/internal/madevent_interface.py (Andrea Valassi 2024-08-02 17:28:18 +0200 3970)                 # avoid case where some file starts with G (madgraph5#947)
valassi added a commit to valassi/madgraph4gpu that referenced this issue Aug 2, 2024
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