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
0fd7778a
Commit
0fd7778a
authored
Jan 31, 2024
by
Jammer, Tim
Browse files
Options
Downloads
Patches
Plain Diff
Added ability to format generated testcases on the fly
parent
2ea7a43c
No related branches found
No related tags found
1 merge request
!5
more work on infrastructure III
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/Infrastructure/GeneratorManager.py
+10
-4
10 additions, 4 deletions
scripts/Infrastructure/GeneratorManager.py
with
10 additions
and
4 deletions
scripts/Infrastructure/GeneratorManager.py
+
10
−
4
View file @
0fd7778a
...
@@ -65,7 +65,7 @@ class GeneratorManager:
...
@@ -65,7 +65,7 @@ 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
,
filterlist_
=
None
,
print_progress_bar
=
True
,
overwrite
=
True
,
generate_full_set
=
False
,
def
generate
(
self
,
outpath
,
filterlist_
=
None
,
print_progress_bar
=
True
,
overwrite
=
True
,
generate_full_set
=
False
,
try_compile
=
False
,
max_mpi_version
=
4.0
):
try_compile
=
False
,
max_mpi_version
=
4.0
,
use_clang_format
=
True
):
"""
"""
Generates test cases based on the specified parameters.
Generates test cases based on the specified parameters.
Parameters:
Parameters:
...
@@ -75,6 +75,7 @@ class GeneratorManager:
...
@@ -75,6 +75,7 @@ class GeneratorManager:
- `overwrite` (bool, optional): Whether to overwrite existing files. Defaults to True.
- `overwrite` (bool, optional): Whether to overwrite existing files. Defaults to True.
- `generate_full_set` (bool, optional): Whether to generate the full (extended) set of errors. Defaults to False.
- `generate_full_set` (bool, optional): Whether to generate the full (extended) set of errors. Defaults to False.
- `try_compile` (bool, optional): Whether to try compiling the generated test cases. Defaults to False.
- `try_compile` (bool, optional): Whether to try compiling the generated test cases. Defaults to False.
- `use_clang_format` (bool, optional): Whether to format the generated test cases. Defaults to True.
- `max_mpi_version` (float, optional): The maximum MPI version allowed for generated test cases. Defaults to 4.0.
- `max_mpi_version` (float, optional): The maximum MPI version allowed for generated test cases. Defaults to 4.0.
Returns:
Returns:
...
@@ -82,11 +83,11 @@ class GeneratorManager:
...
@@ -82,11 +83,11 @@ class GeneratorManager:
Raises:
Raises:
AssertionError: If the environment variable
'
MPICC
'
is not set when `try_compile` is True.
AssertionError: If the environment variable
'
MPICC
'
is not set when `try_compile` is True.
CalledProcessError: If compilation fails during the try_compile process.
CalledProcessError: If compilation fails during the try_compile process
or clang-formart fails
.
Note:
Note:
- The progress bar is printed using the tqdm module.
- The progress bar is printed using the tqdm module.
- If `try_compile` is True, it uses the compiler specified via
'
MPICC
'
environment variable to attempt compilation.
#
- If `try_compile` is True, it uses the compiler specified via
'
MPICC
'
environment variable to attempt compilation.
- the Features and if a test belongs to the base of frull test set is defined by the respective generators
- the Features and if a test belongs to the base of frull test set is defined by the respective generators
- Generators can Raise CorrectTestcase, therefore the number of discovered testcases may not match the number of generated cases
- Generators can Raise CorrectTestcase, therefore the number of discovered testcases may not match the number of generated cases
"""
"""
...
@@ -136,8 +137,13 @@ class GeneratorManager:
...
@@ -136,8 +137,13 @@ class GeneratorManager:
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
"
result_str
=
str
(
result_error
)
if
use_clang_format
:
result_str
=
subprocess
.
check_output
([
"
clang-format
"
],
text
=
True
,
input
=
result_str
)
with
open
(
full_name
,
"
w
"
)
as
text_file
:
with
open
(
full_name
,
"
w
"
)
as
text_file
:
text_file
.
write
(
str
(
result_
error
)
)
text_file
.
write
(
result_
str
)
cases_generated
+=
1
cases_generated
+=
1
if
try_compile
:
if
try_compile
:
...
...
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