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
520c696b
Verified
Commit
520c696b
authored
11 months ago
by
Simon Schwitanski
Browse files
Options
Downloads
Plain Diff
Merge branch 'tools'
parents
2e933471
ae156f97
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
MBB.py
+51
-32
51 additions, 32 deletions
MBB.py
README.md
+4
-0
4 additions, 0 deletions
README.md
with
55 additions
and
32 deletions
MBB.py
+
51
−
32
View file @
520c696b
...
...
@@ -136,43 +136,56 @@ def extract_all_todo_from_logdir(tool, logdir):
########################
# cmd_gencodes(): what to do when '-c generate' is used (Generating the codes)
# cmd_gencodes(): what to do when '-c generate
-lev <1|2|>
' is used (Generating the codes)
########################
#### THIS IS OUTDATED
def
cmd_gencodes
():
if
os
.
path
.
exists
(
"
/MBI/scripts/original_MBI_generators/CollArgGenerator.py
"
):
# Docker run
print
(
"
Docker run
"
)
generators
=
glob
.
glob
(
"
/MBI/scripts/original_MBI_generators/*Generator.py
"
)
dir
=
"
/MBI/gencodes
"
elif
os
.
path
.
exists
(
"
../../scripts/original_MBI_generators/CollArgGenerator.py
"
):
# Local run, from logs dir
print
(
"
Local run, from tools
'
logs dir
"
)
generators
=
glob
.
glob
(
f
"
{
os
.
getcwd
()
}
/../../scripts/original_MBI_generators/*Generator.py
"
)
dir
=
"
../../gencodes/
"
elif
os
.
path
.
exists
(
"
scripts/original_MBI_generators/CollArgGenerator.py
"
):
# Local run, from main dir
print
(
"
Local run, from MBI main dir
"
)
generators
=
glob
.
glob
(
f
"
{
os
.
getcwd
()
}
/scripts/original_MBI_generators/*Generator.py
"
)
dir
=
"
gencodes/
"
else
:
raise
Exception
(
"
Cannot find the codes
'
original_MBI_generators. Please report that bug.
"
)
subprocess
.
run
(
f
"
rm -rf
{
dir
}
; mkdir
{
dir
}
"
,
shell
=
True
,
check
=
True
)
def
cmd_gencodes
(
level
):
here
=
os
.
getcwd
()
if
os
.
path
.
exists
(
"
/MBB/scripts/errors/
"
):
#level = 2
print
(
f
"
Generate level
{
level
}
"
)
subprocess
.
run
(
f
'
tar -xf real_world_data.csv.tar.gz
'
,
shell
=
True
,
check
=
True
)
dir
=
"
scripts/
"
os
.
chdir
(
dir
)
print
(
f
"
Generate the codes (in
{
os
.
getcwd
()
}
):
"
,
end
=
''
)
for
generator
in
generators
:
m
=
re
.
match
(
"
^.*?/([^/]*)Generator.py$
"
,
generator
)
if
m
:
print
(
m
.
group
(
1
),
end
=
"
,
"
)
subprocess
.
run
(
f
'
PYTHONPATH=../ python3 main.py --generator_dir errors --level
{
level
}
--real_world_data ../output.csv
'
,
shell
=
True
,
check
=
True
)
else
:
print
(
generator
,
end
=
"
,
"
)
subprocess
.
run
(
f
'
../scripts/ensure_python3
{
generator
}
'
,
shell
=
True
,
check
=
True
)
print
(
"
\n
Test count:
"
,
end
=
''
)
sys
.
stdout
.
flush
()
subprocess
.
run
(
"
ls *.c|wc -l
"
,
shell
=
True
,
check
=
True
)
subprocess
.
run
(
"
for n in *.c ; do cat -n $n > $n.txt ; done
"
,
shell
=
True
,
check
=
True
)
raise
Exception
(
"
Cannot find the generators. Please report that bug.
"
)
os
.
chdir
(
here
)
# if os.path.exists("/MBI/scripts/original_MBI_generators/CollArgGenerator.py"): # Docker run
# print("Docker run")
# generators = glob.glob("/MBI/scripts/original_MBI_generators/*Generator.py")
# dir = "/MBI/gencodes"
# elif os.path.exists("../../scripts/original_MBI_generators/CollArgGenerator.py"): # Local run, from logs dir
# print("Local run, from tools' logs dir")
# generators = glob.glob(f"{os.getcwd()}/../../scripts/original_MBI_generators/*Generator.py")
# dir = "../../gencodes/"
# elif os.path.exists("scripts/original_MBI_generators/CollArgGenerator.py"): # Local run, from main dir
# print("Local run, from MBI main dir")
# generators = glob.glob(f"{os.getcwd()}/scripts/original_MBI_generators/*Generator.py")
# dir = "gencodes/"
# else:
# raise Exception("Cannot find the codes' original_MBI_generators. Please report that bug.")
# subprocess.run(f"rm -rf {dir} ; mkdir {dir}", shell=True, check=True)
# here = os.getcwd()
# os.chdir(dir)
# print(f"Generate the codes (in {os.getcwd()}): ", end='')
# for generator in generators:
# m = re.match("^.*?/([^/]*)Generator.py$", generator)
# if m:
# print(m.group(1), end=", ")
# else:
# print(generator, end=", ")
# subprocess.run(f'../scripts/ensure_python3 {generator}', shell=True, check=True)
# print("\nTest count: ", end='')
# sys.stdout.flush()
# subprocess.run("ls *.c|wc -l", shell=True, check=True)
# subprocess.run("for n in *.c ; do cat -n $n > $n.txt ; done", shell=True, check=True)
# os.chdir(here)
########################
# cmd_build(): what to do when '-c build' is used (building the tool, discarding the cache)
########################
...
...
@@ -1617,6 +1630,9 @@ parser.add_argument('-l', '--logs-dir', metavar='path', default="logs", type=pat
parser
.
add_argument
(
'
-g
'
,
'
--gencodes
'
,
metavar
=
'
path
'
,
default
=
"
gencodes
"
,
type
=
pathlib
.
Path
,
help
=
'
path to directory of source files (default: gencodes)
'
)
parser
.
add_argument
(
'
-lev
'
,
'
--level
'
,
metavar
=
'
int
'
,
default
=
2
,
type
=
int
,
help
=
'
Generation level to generate codes (default: 2)
'
)
parser
.
add_argument
(
'
-b
'
,
metavar
=
'
batch
'
,
default
=
'
1/1
'
,
help
=
"
Limits the test executions to the batch #N out of M batches (Syntax:
'
N/M
'
). To get 3 runners, use 1/3 2/3 3/3
"
)
...
...
@@ -1658,7 +1674,10 @@ if args.c == 'all':
cmd_run
(
rootdir
=
rootdir
,
toolname
=
args
.
x
,
batchinfo
=
args
.
b
)
cmd_html
(
rootdir
,
toolnames
=
arg_tools
)
elif
args
.
c
==
'
generate
'
:
cmd_gencodes
()
if
args
.
level
:
cmd_gencodes
(
level
=
args
.
level
)
else
:
cmd_gencodes
(
level
=
2
)
elif
args
.
c
==
'
build
'
:
for
t
in
arg_tools
:
cmd_build
(
rootdir
=
rootdir
,
toolname
=
t
)
...
...
This diff is collapsed.
Click to expand it.
README.md
+
4
−
0
View file @
520c696b
...
...
@@ -7,6 +7,10 @@ docker run -v `pwd`:/MBB -it mbb:latest bash
## Generate the codes
```
python3 MBB.py -c generate --level 2
```
Or
```
cd /MBB
tar -xf real_world_data.csv.tar.gz
...
...
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