Skip to content

Commit eb7e826

Browse files
committed
Merge remote-tracking branch 'upstream/master' (including new CI and Source/makefile madgraph5#980) into prof
(Checked that regenerating gg_tt.mad is all ok)
2 parents ef82161 + c4c6e13 commit eb7e826

File tree

62 files changed

+959
-256
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+959
-256
lines changed
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# WARNING THIS FILE IS AUTOGENERATED -> edit test_simd_madevent.template
2+
3+
4+
# This is a basic workflow to help you get started with Actions
5+
6+
name: running acceptance test
7+
# Controls when the workflow will run
8+
# branches: [ main LTS ]
9+
on:
10+
# Triggers the workflow on push or pull request events but only for the 3.4.0 branch
11+
push:
12+
paths-ignore:
13+
- 'docs/**'
14+
# - '.github/**'
15+
16+
# Allows you to run this workflow manually from the Actions tab
17+
workflow_dispatch:
18+
inputs:
19+
message:
20+
description: 'running acceptance test'
21+
required: true
22+
23+
env:
24+
commitmsg: ${{ github.event.head_commit.message }}
25+
26+
concurrency:
27+
group: ${{ github.workflow }}-${{ github.ref }}
28+
cancel-in-progress: true
29+
30+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
31+
jobs:
32+
# This workflow contains a single job called "build"
33+
34+
simd_cpp_heft_ggh_double:
35+
# The type of runner that the job will run on
36+
runs-on: ubuntu-latest
37+
38+
# Steps represent a sequence of tasks that will be executed as part of the job
39+
steps:
40+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
41+
- uses: actions/checkout@v2
42+
with:
43+
submodules: 'true'
44+
45+
# Runs a set of commands using the runners shell
46+
- name: test one of the test testIO_AcceptanceProcOutputIOTests
47+
run: |
48+
cd $GITHUB_WORKSPACE
49+
cd MG5aMC/mg5amcnlo/
50+
cp input/.mg5_configuration_default.txt input/mg5_configuration.txt
51+
cp Template/LO/Source/.make_opts Template/LO/Source/make_opts
52+
./tests/test_manager.py -p./PLUGIN/CUDACPP_OUTPUT/acceptance_tests/ test_simd_cpp_heft_ggh_double
53+
54+
simd_cpp_pptt_mixed:
55+
# The type of runner that the job will run on
56+
runs-on: ubuntu-latest
57+
58+
# Steps represent a sequence of tasks that will be executed as part of the job
59+
steps:
60+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
61+
- uses: actions/checkout@v2
62+
with:
63+
submodules: 'true'
64+
65+
# Runs a set of commands using the runners shell
66+
- name: test one of the test testIO_AcceptanceProcOutputIOTests
67+
run: |
68+
cd $GITHUB_WORKSPACE
69+
cd MG5aMC/mg5amcnlo/
70+
cp input/.mg5_configuration_default.txt input/mg5_configuration.txt
71+
cp Template/LO/Source/.make_opts Template/LO/Source/make_opts
72+
./tests/test_manager.py -p./PLUGIN/CUDACPP_OUTPUT/acceptance_tests/ test_simd_cpp_pptt_mixed
73+
74+
simd_cpp_eemumua_float:
75+
# The type of runner that the job will run on
76+
runs-on: ubuntu-latest
77+
78+
# Steps represent a sequence of tasks that will be executed as part of the job
79+
steps:
80+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
81+
- uses: actions/checkout@v2
82+
with:
83+
submodules: 'true'
84+
85+
# Runs a set of commands using the runners shell
86+
- name: test one of the test testIO_AcceptanceProcOutputIOTests
87+
run: |
88+
cd $GITHUB_WORKSPACE
89+
cd MG5aMC/mg5amcnlo/
90+
cp input/.mg5_configuration_default.txt input/mg5_configuration.txt
91+
cp Template/LO/Source/.make_opts Template/LO/Source/make_opts
92+
./tests/test_manager.py -p./PLUGIN/CUDACPP_OUTPUT/acceptance_tests/ test_simd_cpp_eemumua_float
93+
94+
simd_cpp_vector_size:
95+
# The type of runner that the job will run on
96+
runs-on: ubuntu-latest
97+
98+
# Steps represent a sequence of tasks that will be executed as part of the job
99+
steps:
100+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
101+
- uses: actions/checkout@v2
102+
with:
103+
submodules: 'true'
104+
105+
# Runs a set of commands using the runners shell
106+
- name: test one of the test testIO_AcceptanceProcOutputIOTests
107+
run: |
108+
cd $GITHUB_WORKSPACE
109+
cd MG5aMC/mg5amcnlo/
110+
cp input/.mg5_configuration_default.txt input/mg5_configuration.txt
111+
cp Template/LO/Source/.make_opts Template/LO/Source/make_opts
112+
./tests/test_manager.py -p./PLUGIN/CUDACPP_OUTPUT/acceptance_tests/ test_simd_cpp_vector_size

epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/MG5aMC_patches/PROD/patch.common

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -81,31 +81,6 @@ index a59181c70..af7e0efbc 100644
8181
INTEGER MAXTRIES
8282
PARAMETER(MAXTRIES=25)
8383
C To pass the helicity configuration chosen by the DiscreteSampler to
84-
diff --git b/epochX/cudacpp/gg_tt.mad/Source/makefile a/epochX/cudacpp/gg_tt.mad/Source/makefile
85-
index 617f10b93..00c73099a 100644
86-
--- b/epochX/cudacpp/gg_tt.mad/Source/makefile
87-
+++ a/epochX/cudacpp/gg_tt.mad/Source/makefile
88-
@@ -120,7 +120,7 @@ $(LIBDIR)libiregi.a: $(IREGIDIR)
89-
cd $(IREGIDIR); make
90-
ln -sf ../Source/$(IREGIDIR)libiregi.a $(LIBDIR)libiregi.a
91-
92-
-clean:
93-
+cleanSource:
94-
$(RM) *.o $(LIBRARIES) $(BINARIES)
95-
cd PDF; make clean; cd ..
96-
cd PDF/gammaUPC; make clean; cd ../../
97-
@@ -132,4 +132,11 @@ clean:
98-
cd BIAS/ptj_bias; make clean; cd ../..
99-
if [ -d $(CUTTOOLSDIR) ]; then cd $(CUTTOOLSDIR); make clean; cd ..; fi
100-
if [ -d $(IREGIDIR) ]; then cd $(IREGIDIR); make clean; cd ..; fi
101-
+
102-
+clean: cleanSource
103-
for i in `ls -d ../SubProcesses/P*`; do cd $$i; make clean; cd -; done;
104-
+
105-
+cleanavx:
106-
+ for i in `ls -d ../SubProcesses/P*`; do cd $$i; make cleanavxs; cd -; done;
107-
+cleanall: cleanSource # THIS IS THE ONE
108-
+ for i in `ls -d ../SubProcesses/P*`; do cd $$i; make cleanavxs; cd -; done;
10984
diff --git b/epochX/cudacpp/gg_tt.mad/SubProcesses/makefile a/epochX/cudacpp/gg_tt.mad/SubProcesses/makefile
11085
index 348c283be..64b33c4f1 100644
11186
--- b/epochX/cudacpp/gg_tt.mad/SubProcesses/makefile
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
####
2+
## Automatic creation of CI/CD for the plugin repo
3+
## and automatic test in madgraph format style
4+
## test can be added easily by adding a file in the directory
5+
## simple_cross_check
6+
## format of the file is the cmd file to pass to the code
7+
## two type of additional metadata line are present
8+
## #title provide the documentation information for the unittest (docstring)
9+
## #check RUN_NAME CROSS ERROR NB_EVENT provide the target cross-section/error/requested event
10+
11+
12+
import os
13+
import glob
14+
15+
curr_dir = os.path.dirname(__file__)
16+
pjoin = os.path.join
17+
template_runtest = """
18+
# WARNING THIS FILE IS AUTOGENERATED -> edit test_simd_madevent.template
19+
def test_%(name)s(self):
20+
\"\"\"%(doc)s\"\"\"
21+
22+
if logging.getLogger('madgraph').level <= 20:
23+
stdout=None
24+
stderr=None
25+
else:
26+
devnull =open(os.devnull,'w')
27+
stdout=devnull
28+
stderr=devnull
29+
30+
try:
31+
shutil.rmtree('/tmp/MGPROCESS/')
32+
except Exception as error:
33+
pass
34+
35+
cmd = \"\"\"%(cmd)s
36+
\"\"\" %%self.run_dir
37+
38+
open(pjoin(self.path, 'mg5_cmd'),'w').write(cmd)
39+
40+
subprocess.call([sys.executable, pjoin(MG5DIR, 'bin','mg5_aMC'),
41+
pjoin(self.path, 'mg5_cmd')],
42+
#cwd=self.path,
43+
stdout=stdout, stderr=stderr)
44+
"""
45+
46+
template_onecheck = """
47+
self.check_parton_output(cross=%(cross)s, error=%(err)s, run_name='%(run_name)s', html=%(html)s)
48+
event = '%%s/Events/%(run_name)s/unweighted_events.lhe' %% self.run_dir
49+
if not os.path.exists(event):
50+
misc.gunzip(event)
51+
52+
lhefile = lhe_parser.EventFile(event)
53+
nb_event = 0
54+
for event in lhe_parser.EventFile(event):
55+
event.check()
56+
nb_event+=1
57+
58+
self.assertEqual(nb_event, %(nb_event)s)"""
59+
60+
61+
def create_test_simd_madevent():
62+
63+
text = "# WARNING THIS FILE IS AUTOGENERATED -> edit test_simd_madevent.template\n\n\n"
64+
text += open(pjoin(curr_dir, 'test_simd_madevent.template'),'r').read()
65+
66+
for filename in os.listdir(pjoin(curr_dir, 'simple_cross_check')):
67+
68+
opt = {}
69+
opt['name'] = filename
70+
opt['cmd'] = open(pjoin(curr_dir, 'simple_cross_check',filename)).read()
71+
opt['doc'] = "\n".join([line[5:] for line in opt['cmd'].split('\n') if line.startswith('#title')])
72+
73+
text += template_runtest % opt
74+
75+
checks = [line.split() for line in opt['cmd'].split('\n') if line.startswith('#check')]
76+
77+
for i, check in enumerate(checks):
78+
_, name, cross, err, nb_event = check
79+
opt['run_name'] = name
80+
opt['cross'] = cross
81+
opt['err'] = err
82+
opt['nb_event'] = nb_event
83+
opt['html'] = 'True' if i==0 else 'False'
84+
85+
text += template_onecheck % opt
86+
87+
open(pjoin(curr_dir, 'test_simd_madevent.py'), 'w').write(text)
88+
89+
template_one_cicd="""
90+
%(name)s:
91+
# The type of runner that the job will run on
92+
runs-on: ubuntu-latest
93+
94+
# Steps represent a sequence of tasks that will be executed as part of the job
95+
steps:
96+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
97+
- uses: actions/checkout@v2
98+
with:
99+
submodules: 'true'
100+
101+
# Runs a set of commands using the runners shell
102+
- name: test one of the test testIO_AcceptanceProcOutputIOTests
103+
run: |
104+
cd $GITHUB_WORKSPACE
105+
cd MG5aMC/mg5amcnlo/
106+
cp input/.mg5_configuration_default.txt input/mg5_configuration.txt
107+
cp Template/LO/Source/.make_opts Template/LO/Source/make_opts
108+
./tests/test_manager.py -p./PLUGIN/CUDACPP_OUTPUT/acceptance_tests/ test_%(name)s
109+
"""
110+
111+
def create_cicd():
112+
113+
text = "# WARNING THIS FILE IS AUTOGENERATED -> edit test_simd_madevent.template\n\n\n"
114+
text += open(pjoin(curr_dir, 'madgraph_launch.template'),'r').read()
115+
116+
for filename in os.listdir(pjoin(curr_dir, 'simple_cross_check')):
117+
text += template_one_cicd % {'name': filename}
118+
119+
GITDIR =pjoin(os.path.realpath(curr_dir), os.path.pardir,os.path.pardir,os.path.pardir,os.path.pardir,os.path.pardir,os.path.pardir)
120+
GITDIR = os.path.realpath(GITDIR)
121+
open(pjoin(GITDIR, '.github', 'workflows', 'madgraph_launch_test.yml'), 'w').write(text)
122+
123+
124+
if __name__ == '__main__':
125+
create_test_simd_madevent()
126+
create_cicd()
127+
128+
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: running acceptance test
4+
# Controls when the workflow will run
5+
# branches: [ main LTS ]
6+
on:
7+
# Triggers the workflow on push or pull request events but only for the 3.4.0 branch
8+
push:
9+
paths-ignore:
10+
- 'docs/**'
11+
# - '.github/**'
12+
13+
# Allows you to run this workflow manually from the Actions tab
14+
workflow_dispatch:
15+
inputs:
16+
message:
17+
description: 'running acceptance test'
18+
required: true
19+
20+
env:
21+
commitmsg: ${{ github.event.head_commit.message }}
22+
23+
concurrency:
24+
group: ${{ github.workflow }}-${{ github.ref }}
25+
cancel-in-progress: true
26+
27+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
28+
jobs:
29+
# This workflow contains a single job called "build"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#title check eemumua in single precision
2+
import model sm
3+
set automatic_html_opening False --no_save
4+
set notification_center False --no_save
5+
generate e+ e- > mu+ mu- a
6+
output madevent_simd %s -f -nojpeg
7+
launch
8+
set nevents 100
9+
set floating_type f
10+
#check run_01 0.0266 0.0002854 100
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#title testing a HEFT process gg>aa in double precision
2+
import model heft
3+
set automatic_html_opening False --no_save
4+
set notification_center False --no_save
5+
generate g g > h > a a
6+
output madevent_simd %s -f -nojpeg
7+
launch
8+
set nevents 100
9+
set floating_type d
10+
#check run_01 0.01859 0.0002853789088650386 100
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#title check ggtt within mixed mode
2+
import model sm
3+
set automatic_html_opening False --no_save
4+
set notification_center False --no_save
5+
generate p p > t t~
6+
output madevent_simd %s -f -nojpeg
7+
launch
8+
set nevents 100
9+
set floating_type m
10+
#check run_01 505.5 2.749 100
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#title: check that multiple vector size returns the same value
2+
import model sm
3+
set automatic_html_opening False --no_save
4+
set notification_center False --no_save
5+
generate p p > t t~
6+
output madevent_simd %s -f -nojpeg
7+
launch
8+
set nevents 100
9+
set floating_type m
10+
set vector_size 16
11+
launch
12+
set vector_size 32
13+
launch
14+
set vector_size 64
15+
#check run_01 505.5 2.749 100
16+
#check run_02 505.5 2.749 100
17+
#check run_03 505.5 2.749 100

0 commit comments

Comments
 (0)