Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MPI-BugBench
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
High Performance Computing - Public
MPI-BugBench
Commits
d918d38f
Commit
d918d38f
authored
1 year ago
by
Jammer, Tim
Browse files
Options
Downloads
Patches
Plain Diff
organize generated codes per feature
parent
9749bb20
Branches
Branches containing commit
No related tags found
2 merge requests
!13
Infrasructure patch 1
,
!12
More improvements to Infrastructure
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
scripts/Infrastructure/GeneratorManager.py
+7
-3
7 additions, 3 deletions
scripts/Infrastructure/GeneratorManager.py
scripts/main.py
+10
-7
10 additions, 7 deletions
scripts/main.py
with
17 additions
and
10 deletions
scripts/Infrastructure/GeneratorManager.py
+
7
−
3
View file @
d918d38f
...
@@ -69,7 +69,8 @@ class GeneratorManager:
...
@@ -69,7 +69,8 @@ class GeneratorManager:
return
case_name
+
"
-
"
+
str
(
num
).
zfill
(
digits_to_use
)
+
suffix
return
case_name
+
"
-
"
+
str
(
num
).
zfill
(
digits_to_use
)
+
suffix
def
generate
(
self
,
outpath
:
str
|
Path
|
os
.
PathLike
[
str
],
filterlist_
:
typing
.
Sequence
[
str
]
=
None
,
print_progress_bar
:
bool
=
True
,
overwrite
:
bool
=
True
,
generate_full_set
:
bool
=
False
,
def
generate
(
self
,
outpath
:
str
|
Path
|
os
.
PathLike
[
str
],
filterlist_
:
typing
.
Sequence
[
str
]
=
None
,
print_progress_bar
:
bool
=
True
,
overwrite
:
bool
=
True
,
generate_full_set
:
bool
=
False
,
try_compile
:
bool
=
False
,
max_mpi_version
:
str
=
"
4.0
"
,
use_clang_format
:
bool
=
True
):
try_compile
:
bool
=
False
,
max_mpi_version
:
str
=
"
4.0
"
,
use_clang_format
:
bool
=
True
):
"""
"""
Generates test cases based on the specified parameters.
Generates test cases based on the specified parameters.
...
@@ -115,6 +116,9 @@ class GeneratorManager:
...
@@ -115,6 +116,9 @@ class GeneratorManager:
cases_generated
=
0
cases_generated
=
0
for
generator
in
generators_to_use
:
for
generator
in
generators_to_use
:
# use first feature as category if generatro has multiple
categroy_path
=
os
.
path
.
join
(
outpath
,
generator
.
get_feature
()[
0
])
os
.
makedirs
(
categroy_path
,
exist_ok
=
True
)
for
result_error
in
generator
.
generate
(
generate_full_set
):
for
result_error
in
generator
.
generate
(
generate_full_set
):
assert
isinstance
(
result_error
,
TemplateManager
)
assert
isinstance
(
result_error
,
TemplateManager
)
...
@@ -122,7 +126,7 @@ class GeneratorManager:
...
@@ -122,7 +126,7 @@ class GeneratorManager:
if
not
float
(
result_error
.
get_version
())
>
float
(
max_mpi_version
):
if
not
float
(
result_error
.
get_version
())
>
float
(
max_mpi_version
):
case_name
=
result_error
.
get_short_descr
()
case_name
=
result_error
.
get_short_descr
()
fname
=
self
.
get_filename
(
case_name
)
fname
=
self
.
get_filename
(
case_name
)
full_name
=
os
.
path
.
join
(
out
path
,
fname
)
full_name
=
os
.
path
.
join
(
categroy_
path
,
fname
)
if
not
overwrite
and
os
.
path
.
isfile
(
full_name
):
if
not
overwrite
and
os
.
path
.
isfile
(
full_name
):
assert
False
and
"
File Already exists
"
assert
False
and
"
File Already exists
"
...
...
This diff is collapsed.
Click to expand it.
scripts/main.py
+
10
−
7
View file @
d918d38f
...
@@ -6,14 +6,17 @@ from scripts.Infrastructure.GeneratorManager import GeneratorManager
...
@@ -6,14 +6,17 @@ from scripts.Infrastructure.GeneratorManager import GeneratorManager
if
__name__
==
"
__main__
"
:
if
__name__
==
"
__main__
"
:
gencodes_dir
=
"
../gencodes/
"
gencodes_dir
=
"
../gencodes/
"
#gm = GeneratorManager("./errors")
gm
=
GeneratorManager
(
"
./errors
"
)
gm
=
GeneratorManager
(
"
./errors/devel
"
)
# gm = GeneratorManager("./errors/devel")
# remove all testcases from previous execution (ease of debugging)
# remove all testcases from previous execution (ease of debugging)
filelist
=
[
f
for
f
in
os
.
listdir
(
gencodes_dir
)
if
f
.
endswith
(
"
.c
"
)]
for
root
,
dirs
,
files
in
os
.
walk
(
gencodes_dir
):
for
f
in
filelist
:
for
file
in
files
:
os
.
remove
(
os
.
path
.
join
(
gencodes_dir
,
f
))
if
file
.
endswith
(
"
.c
"
):
os
.
remove
(
os
.
path
.
join
(
root
,
file
))
# gm.generate(gencodes_dir, try_compile=True, generate_full_set=False) # default
# gm.generate(gencodes_dir, try_compile=True, generate_full_set=False) # default
gm
.
generate
(
gencodes_dir
,
try_compile
=
True
,
generate_full_set
=
True
,
max_mpi_version
=
"
3.1
"
)
#all cases that can compile for my local mpi installation
gm
.
generate
(
gencodes_dir
,
try_compile
=
True
,
generate_full_set
=
True
,
max_mpi_version
=
"
3.1
"
)
# all cases that can compile for my local mpi installation
pass
pass
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment