Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
74604d6
Add CUDACPP files as PLUGIN
Qubitol Feb 6, 2026
b81c14d
Integrate CUDACPP with MadSpace for mg7 output mode
Qubitol Feb 10, 2026
127968f
Update UMAMI with flavor indices
Qubitol Feb 10, 2026
7c2f5ce
Remove multichannel ifdefs, ok to cherry-pick
Qubitol Feb 10, 2026
9f9af1e
Fix order of args in umami - ok to cherry-pick
Qubitol Feb 10, 2026
e626a45
Set compilation command for MadSpace - cherry pick with caution
Qubitol Feb 10, 2026
a40db84
Use CUDACPP backends in the run card - cherry pick with caution
Qubitol Feb 10, 2026
daa9938
Update madgraph interface to run generate events when using mg7 - ok …
Qubitol Feb 10, 2026
ab9c5a2
Modified output
Qubitol Feb 10, 2026
6af2370
Very ugly hack (please don't judge) to get channel mappings
Qubitol Feb 10, 2026
1b369b5
Rename library path to me_path and include also subprocess folder pat…
Qubitol Feb 10, 2026
ce2a577
Use full process name for the library, to interface better with MadSp…
Qubitol Feb 10, 2026
5fb2cbe
Just a workaround to not use the broken simd vector size
Qubitol Feb 10, 2026
d5ee2d1
Merge branch 'main' into heidelberg26
theoheimel Feb 10, 2026
c32f460
make launch command work
theoheimel Feb 10, 2026
411fbb8
flavor index bugfix
theoheimel Feb 10, 2026
30eeef7
Merge branch 'main' into heidelberg26
theoheimel Feb 10, 2026
04c3f00
Fix issue with double defined variable in GPU case - ok to cherry pick
Qubitol Feb 10, 2026
9d77de4
Modify FLV coupling view handling, given sometimes the size is zero -…
Qubitol Feb 11, 2026
2f7b979
Remove warning for host default ALOHAOBJ constructor
Qubitol Feb 11, 2026
a9a98c9
change some run card defaults
theoheimel Feb 11, 2026
2e1b7b6
Merge branch 'main' into heidelberg26
theoheimel Feb 11, 2026
6f07707
Change default for device (backend) parameter in run card
Qubitol Feb 11, 2026
955e7eb
fix device selection
theoheimel Feb 11, 2026
5de3f5f
added some instructions for installation and usage
theoheimel Feb 11, 2026
f45d340
Merge branch 'heidelberg26' of github.com:MadGraphTeam/MadGraph7 into…
theoheimel Feb 11, 2026
2a7b01f
Fix LHAPDF path when it is not absolute
Qubitol Feb 11, 2026
5b3d748
Update tutorial.md with PDF instructions
Qubitol Feb 11, 2026
2545a89
update tutorial
theoheimel Feb 12, 2026
e0033d4
two test processes
roiser Mar 31, 2026
68bdc20
initial commit github->github
roiser Mar 31, 2026
1811cc4
adapt to gitlab.cern
roiser Mar 31, 2026
637a3c8
fix invoation
roiser Mar 31, 2026
8a4eff6
run on every push
roiser Mar 31, 2026
d602f81
fix typo
roiser Mar 31, 2026
67fe626
its intended to run only for a pr
roiser Mar 31, 2026
dd14b15
empty
roiser Mar 31, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/check-formatting.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
if [ ! -d "src" ] && [ ! -d "SubProcesses" ]; then
echo "Error: Neither 'src' nor 'SubProcesses' directory exists, script needs to be run from the root directory of a generated process" >&2
exit 255
fi

count=0
total=0
files_needing_format=()
patch_file="format-changes.patch"
num_file="files2format"

# clean patch file if it exists
> "$patch_file"
> "$num_file"

echo ""
echo "Checking formatting with clang-format..."
echo ""

while IFS= read -r file; do
((total++))
if ! clang-format --dry-run --Werror "$file" 2>/dev/null; then
echo "=== $file needs formatting ==="
clang-format "$file" | diff -u "$file" - >> "$patch_file"
echo "" >> "$patch_file"
((count++))
files_needing_format+=("$file")
fi
done < <(find src SubProcesses -type f \( -name "*.cc" -o -name "*.h" \) 2>/dev/null)


echo ""
echo "Files needing formatting: $count"
echo "Total files checked: $total"

if [ $count -gt 0 ]; then
echo "Detailed patch saved to '$patch_file'"
echo "If this scrpt is run in the CI workflow, detailed patches are provided as comment on the PR."
else
echo "All files are properly formatted."
rm "$patch_file"
fi
echo ""

echo $count | tr -d \\n >> $num_file
146 changes: 146 additions & 0 deletions .github/workflows/code2gitlab.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
name: Generate code, check format and push to generated processes repo

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
generate-and-check:
runs-on: ubuntu-latest
strategy:
matrix:
process: [pp_ttx, pp_ttxj]

env:
PROC_DIR: PROC_${{ matrix.process }}
TARGET_HOST: gitlab.cern.ch
TARGET_DIR: Madgraph7GenCode
TARGET_REPO: MadgraphTeam/${TARGET_DIR}

steps:
- name: Checkout codegen repo
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true

- name: Run code generator
run: |
cd ${GITHUB_WORKSPACE}
./bin/mg5_aMC tests/processes/${{ matrix.process }}/output.mg5

- name: Check code format with clang-format
id: clang-format-check
run: |
chmod +x ${GITHUB_WORKSPACE}/.github/workflows/check-formatting.sh
cd ${GITHUB_WORKSPACE}/${{ env.PROC_DIR }}
${GITHUB_WORKSPACE}/.github/workflows/check-formatting.sh
files2format=$(cat files2format)
echo "files2format=$files2format" >> $GITHUB_OUTPUT

if [ "$files2format" -eq 0 ]; then
echo "✅ clang-format check passed."
else
echo "❌ clang-format check failed."
fi
- name: Commit to target repository
if: ${{ steps.clang-format-check.outputs.files2format == '0' }}
id: commit_to_target_repository
run: |
# Configure git

git config --global user.name "github-actions"
git config --global user.email "github-actions@users.noreply.github.com"

# Clone target repo
cd ${GITHUB_WORKSPACE}
git clone https://oauth2:${{ secrets.GITLAB_ACCESS_TOKEN }}@${TARGET_HOST}/${TARGET_REPO}.git
cd ${GITHUB_WORKSPACE}/${TARGET_DIR}

# Create branch based on PR number
BRANCH_NAME="codegen-pr-${{ github.event.pull_request.number }}"
git checkout -b ${BRANCH_NAME}

# Copy generated files (adjust paths as needed)
cp -r ${GITHUB_WORKSPACE}/${{ env.PROC_DIR }} .

# Commit and push
git add .
git commit -m "Code generated from PR #${{ github.event.pull_request.number }}" \
-m "Source PR: ${{ github.event.pull_request.html_url }}"

git push -f origin ${BRANCH_NAME}

echo "✅ Pushed to ${TARGET_REPO} on branch ${BRANCH_NAME}"

- name: Set up Python
if: ${{ steps.commit_to_target_repository.outcome == 'success' }}
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Update README.md
if: ${{ steps.commit_to_target_repository.outcome == 'success' }}
run: |
cd ${GITHUB_WORKSPACE}/${TARGET_DIR}
git checkout main

python ${GITHUB_WORKSPACE}/.github/workflows/update_readme.py \
--title "${{ github.event.pull_request.title }}" \
--url "${{ github.event.pull_request.html_url }}" \
--pr_num "${{ github.event.pull_request.number }}" \
--created "${{ github.event.pull_request.created_at }}" \
--last_updated "${{ github.event.pull_request.updated_at }}" \
--wip "${{ github.event.pull_request.draft }}" \
--num_commits "${{ github.event.pull_request.commits }}" \
--author "${{ github.event.pull_request.user.login }}"

git add .
git commit -m "Update README for PR #${{ github.event.pull_request.number }}"
git push -f origin main

echo "✅ Pushed to ${TARGET_REPO} on branch main"

- name: Read patch file
if: ${{ steps.clang-format-check.outputs.files2format != '0' }}
run: |
{
echo "patch_file_content<<EOF"
cat ${{ env.PROC_DIR }}/format-changes.patch
echo "EOF"
} >> $GITHUB_OUTPUT

- name: Comment on PR with format issues
if: ${{ steps.clang-format-check.outputs.files2format != '0' }}
uses: actions/github-script@v7
env:
FILES2FORMAT: ${{ steps.clang-format-check.outputs.files2format }}
with:
script: |

const fs = require('fs');
const filesToFormat = parseInt(process.env.FILES2FORMAT);
const patchContent = fs.readFileSync(`${process.env.PROC_DIR}/format-changes.patch`, 'utf8');

const comment = `## ❌ Code Format Check Failed

The generated code does not conform to clang-format rules.

Please update your code generator to produce properly formatted code.
${filesToFormat} files need formatting.

Note: The CI is setup so it fails early, if formatting issues are detected for any of the processes.
The report below is for process **${process.env.PROC_DIR}** with backend **${process.env.BACKEND}**.

See attached patch for details:`;

github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: `${comment} \n \`\`\` \n ${patchContent} \n \`\`\``
});

- name: Fail if format check failed
if: ${{ steps.clang-format-check.outputs.files2format != '0' }}
run: exit 1
77 changes: 77 additions & 0 deletions .github/workflows/update_readme.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#!/usr/bin/env python3

import json
import optparse

class UpdateReadme:
def __init__(self, title, url, pr_num, created, last_updated, wip, num_commits, author):
self.title = title
self.url = url
self.pr_num = pr_num
self.created = created
self.last_updated = last_updated
self.wip = wip
self.num_commits = num_commits
self.author = author
self.remote_repo_url = "https://gitlab.cern.ch/MadGraphTeam/Madgraph7GenCode/"

def update_json(self):
fh = open('readme_data.json', 'r')
data = json.load(fh)
fh.close()

if self.pr_num not in data:
new_entry = {
"title": self.title,
"branch": self.remote_repo_url + "tree/codegen-pr-" + str(self.pr_num),
"url": self.url,
"created": self.created,
"last_updated": self.last_updated,
"wip": self.wip,
"num_commits": self.num_commits,
"author": self.author
}
data[self.pr_num] = new_entry
else:
data[self.pr_num]['last_updated'] = self.last_updated
data[self.pr_num]['wip'] = self.wip
data[self.pr_num]['num_commits'] = self.num_commits
data[self.pr_num]['title'] = self.title

fh = open('readme_data.json', 'w')
json.dump(data, fh, indent=4)
fh.close()

def write_readme(self):
fh = open('readme_data.json', 'r')
data = json.load(fh)
fh.close()

sorted_prs = sorted(data.items(), key=lambda x: x[1]['last_updated'], reverse=True)

with open('README.md', 'w') as fh:
fh.write("# Pull Request Summary\n\n")
fh.write("| PR Number | Local Branch | Title | WIP | # Commits | Author | Created | Last Update |\n")
fh.write("|-----------|--------------|-------|-----|-----------|--------|---------|-------------|\n")
for pr_num, details in sorted_prs:
fh.write(f"| [{pr_num}]({details['url']}) | [{details['branch'].split('/')[-1]}]({details['branch']}) | {details['title']} | {details['wip']} | {details['num_commits']} | {details['author']} | {details['created']} | {details['last_updated']} |\n")

def run(self):
self.update_json()
self.write_readme()

if __name__ == "__main__":
parser = optparse.OptionParser()
parser.add_option('--title', dest='title', help='PR title')
parser.add_option('--url', dest='url', help='PR URL')
parser.add_option('--pr_num', dest='pr_num', help='PR number')
parser.add_option('--created', dest='created', help='PR creation date')
parser.add_option('--last_updated', dest='last_updated', help='PR last updated date')
parser.add_option('--wip', dest='wip', help='Is PR WIP')
parser.add_option('--num_commits', dest='num_commits', help='Number of commits in PR')
parser.add_option('--author', dest='author', help='PR author')

options, _ = parser.parse_args()

updater = UpdateReadme(options.title, options.url, options.pr_num, options.created, options.last_updated, options.wip, options.num_commits, options.author)
updater.run()
1 change: 1 addition & 0 deletions PLUGIN/CUDACPP_OUTPUT/AUTHORS
67 changes: 67 additions & 0 deletions PLUGIN/CUDACPP_OUTPUT/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is loosely based on [Keep a Changelog](https://keepachangelog.com).

--------------------------------------------------------------------------------

## [Unreleased] - 2024-10-06

### Changed

- Updated cudacpp version to 1.00.01.

### Fixed

- Platform-specific issues
- AV ([#1011]) Added workaround for Floating Point Exceptions in vxxxxx in the HIP backend.

- Infrastructure issues
- AV ([#1013]) Fix release scripts to create 'v1.00.01' tags from a '(1,0,1)' python tuple.
- AV ([#1015]) Remove add_input_for_banner from output.py (plugin_run_card is not needed in cudacpp).
- AV ([#995]) In cudacpp_config.mk move default FPTYPE from 'd' to 'm' (already the default floating_type in run_card.dat).

--------------------------------------------------------------------------------

## [1.00.00] - 2024-10-03

### Added

- (OM+AV+SR+SH+ZW+JT+DM) First release of the MG5aMC CUDACPP plugin.
- Validated and released for MG5aMC version 3.6.0.
- Hosted in the https://github.com/madgraph5/madgraph4gpu original repo.
- Repo uses the original directory structure (plugin is epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT).

### Known issues

- This section lists some of the main new issues identified in release v1.00.00.

- General issues
- ([#959]) Cross-section instabilities when changing vector size between 32 and 16384.
- ([#993]) LHE file mismatch (fortran vs cudacpp) in the experimental multi-backend gridpacks.

- Platform-specific issues
- ([#1011]) Floating Point Exceptions in vxxxxx in the HIP backend.

- Physics-process-specific issues
- ([#944]) Cross-section mismatch (fortran vs cudacpp) in Drell-Yan plus 4 jets.
- ([#942]) Floating Point Exceptions in Drell-Yan plus 0 to 2 jets (workaround: `CUDACPP_RUNTIME_DISABLEFPE=1`).
- ([#846]) ME mismatch (HRDCOD=1 vs HRDCOD=1) in EWdim6 models.
- ([#601]) Builds fail with very complex final states (e.g. gg to ttgggg).

--------------------------------------------------------------------------------

[1.00.00]: https://github.com/madgraph5/madgraph4gpu/releases/tag/cudacpp_for3.6.0_v1.00.00
[Unreleased]: https://github.com/madgraph5/madgraph4gpu/releases/compare/cudacpp_for3.6.0_v1.00.00...HEAD

[#601]: https://github.com/madgraph5/madgraph4gpu/issues/601
[#846]: https://github.com/madgraph5/madgraph4gpu/issues/846
[#942]: https://github.com/madgraph5/madgraph4gpu/issues/942
[#944]: https://github.com/madgraph5/madgraph4gpu/issues/944
[#959]: https://github.com/madgraph5/madgraph4gpu/issues/959
[#993]: https://github.com/madgraph5/madgraph4gpu/issues/993
[#995]: https://github.com/madgraph5/madgraph4gpu/issues/995
[#1011]: https://github.com/madgraph5/madgraph4gpu/issues/1011
[#1013]: https://github.com/madgraph5/madgraph4gpu/issues/1013
[#1015]: https://github.com/madgraph5/madgraph4gpu/issues/1015
1 change: 1 addition & 0 deletions PLUGIN/CUDACPP_OUTPUT/COPYING
1 change: 1 addition & 0 deletions PLUGIN/CUDACPP_OUTPUT/COPYING.LESSER
1 change: 1 addition & 0 deletions PLUGIN/CUDACPP_OUTPUT/COPYRIGHT
Loading
Loading