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

Remove smatrix counters and regenerate all processes #762

Merged
merged 9 commits into from
Sep 12, 2023

Conversation

hageboeck
Copy link
Member

@hageboeck hageboeck commented Sep 8, 2023

  • Add a script to regenerate code and automatically stage changes to git.
  • Remove smatrix counters from smatrix function in Fortran MEs. The counter is never read, but dramatically slows down the matrix elements. See here.
  • Remove pickle files from version control
  • Regenerate all processes. Due to mg5 updates, a few more things change:
    • zero-width t-channel is enabled for some processes
    • ident_card.dat is generated differently
    • The argument FK_MDL_WT for FFV functions changes to ZERO

@hageboeck hageboeck self-assigned this Sep 8, 2023
@hageboeck hageboeck requested a review from roiser September 8, 2023 17:00
@roiser
Copy link
Member

roiser commented Sep 11, 2023

Thanks @hageboeck very good. Just a few comments inline. Only thing, especially for the last point of your initial message I would ask @oliviermattelaer to check that this is all good?

I also see some re-ordering happening, e.g. in Cards files or a variable ALOHARoutine, do we understand that this is all good?

@oliviermattelaer
Copy link
Member

Hi,

Yes the ordering for the variable in the makefile is irrelevant and the ordering in that file too.
So I'm not worry about any of those changes.

Thanks a lot @hageboeck, It is ready to go!

@hageboeck
Copy link
Member Author

I also see some re-ordering happening, e.g. in Cards files or a variable ALOHARoutine, do we understand that this is all good?

At least for the makefile, I can easily fix this in upstream mg5. For the cards, I haven't found the code yet.

@roiser
Could you please check
https://github.com/madgraph5/madgraph4gpu/pull/762/files#diff-33c49abaf9d894a2f30e3eb3767639cef0f25755f905817f963fe343f43dd50e

Is this the coupling bug you were mentioning?

@hageboeck hageboeck marked this pull request as ready for review September 11, 2023 11:34
@oliviermattelaer
Copy link
Member

No need to fix it, those ordering have no meaning (and no impact)

Copy link
Member

@oliviermattelaer oliviermattelaer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is an "official" comment to approve the merge

@roiser
Copy link
Member

roiser commented Sep 11, 2023

@roiser Could you please check https://github.com/madgraph5/madgraph4gpu/pull/762/files#diff-33c49abaf9d894a2f30e3eb3767639cef0f25755f905817f963fe343f43dd50e

Is this the coupling bug you were mentioning?

This is a fix done for respecting the order of the couplings as they appear in the code generation, see also #757

There was another fix done last Friday which fixes the problem that the non-running couplings need to be filtered out before this re-ordering is applied, see #761

In order to facilitate the code generation, add a script to generate the
processes in this repo. Pass all processes to be generated as argument,
e.g:
  ./runCodegen.sh gg_tt.mad ee_mumu.mad

It is assumed that each process directory contains mg5.in with all
madgraph commands that are needed to generate the corresponding process.

The script will try to stage the changes, so they can be committed.
Instead of one copy per subprocess, link these files into the subprocess directories.
Since matrix1 is called in a loop over all events, instrumenting it
with a timer and counter creates significant overhead.
Curiously, this counter is never read, so it can be removed.

For pp -> tt~ 012j, the difference for 1M events on 16 cores is:
Walltime: 35:48 m --> 7:45 m
CPU time: 13:14 h --> 2:56 h
To be able to run the code generator from every directory, the path to
patchMad needs to be relative to the plugin directory.
The following changes are included:
- Updated mg5. mg5 sets zero-width t-channel to True.
- Removed all timers from smatrix function. This signficantly slowed
  down the Fortran MEs.
- Link counters.cc and ompnumthreads into subprocesses instead of
copying them.
The files seem to be regenerated when ufomodel runs, and they only
create noise in git.
@hageboeck hageboeck merged commit f75e994 into madgraph5:master Sep 12, 2023
@hageboeck hageboeck deleted the fixTimingCounters branch September 12, 2023 09:30
valassi added a commit to valassi/madgraph4gpu that referenced this pull request Oct 28, 2023
This adds the following commits by Stephan (first part of PR madgraph5#762)
c586208       Stephan Hageboeck       Wed Sep 6 19:15:44 2023 +0200   [CODEGEN] Fix the path to patchMad
57313ae       Stephan Hageboeck       Fri Sep 1 17:43:19 2023 +0200   [CODEGEN] Remove matrix1 counter from Fortran MEs.
9635bbb       Stephan Hageboeck       Fri Sep 1 17:31:56 2023 +0200   [CODEGEN] Move counters.cc and ompnumthreads to SubProcesses.
30ca6cf       Stephan Hageboeck       Fri Sep 8 18:04:25 2023 +0200   Add codegen inputs for standalone directories.
3823214       Stephan Hageboeck       Wed Sep 6 19:19:03 2023 +0200   Add a script for running code generator from mg5 interface.
5ca48d7       Stephan Hageboeck       Fri Sep 8 18:00:34 2023 +0200   Add gitignore for cudacpp.

The main two effects of these changes are
- functions counters_matrix1_(start|stop)_ and calls to them are removed
- a runCodegen.sh script has been added, which also leaves a file mg5.in in each generated directory

Fix conflicts:
  epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/output.py
  epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/patchMad.sh
valassi added a commit to valassi/madgraph4gpu that referenced this pull request Oct 28, 2023
valassi added a commit to valassi/madgraph4gpu that referenced this pull request Oct 28, 2023
…ts with Stephan's PR madgraph5#762

git checkout c586208 $(git ls-tree --name-only HEAD *.mad)
git checkout c586208 $(git ls-tree --name-only HEAD *.sa)
valassi added a commit to valassi/madgraph4gpu that referenced this pull request Oct 28, 2023
This adds the following commits by Stephan (second part of PR madgraph5#762)
f1244bf       Stephan Hageboeck       Fri Sep 8 18:14:31 2023 +0200   Regenerate code for standalone directories.
4c02578       Stephan Hageboeck       Fri Sep 8 17:39:53 2023 +0200   Regenerate code for all .mad directories.

I will in any case regenerate all processes with my current oct23av (and compare)
valassi added a commit to valassi/madgraph4gpu that referenced this pull request Oct 28, 2023
…ndo temporary changes before merging PR madgraph5#762)

git checkout 8a0c4d7 $(git ls-tree --name-only HEAD *.mad)
git checkout 8a0c4d7 $(git ls-tree --name-only HEAD *.sa)
valassi added a commit to valassi/madgraph4gpu that referenced this pull request Oct 28, 2023
This adds the following commit by Stephan (third and last part of PR madgraph5#762)
f75e994       Stephan Hageboeck       Fri Sep 8 18:41:44 2023 +0200   Remove pickle files from version control.

Fix conflicts. Remove manually all 8 *.mad/bin/internal/ufomodel/py3_model.pkl as intended by Stephan
git rm $(git ls-tree --name-only HEAD *.mad/bin/internal/ufomodel/py3_model.pkl)
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 this pull request may close these issues.

3 participants