Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
common_bench
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
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EIC
benchmarks
common_bench
Commits
a8443933
Commit
a8443933
authored
Feb 19, 2022
by
Wouter Deconinck
Browse files
Options
Downloads
Patches
Plain Diff
`compile-analyses.py --dir scripts tracking`
parent
97042b00
Branches
Branches containing commit
No related tags found
1 merge request
!35
`compile-analyses.py --dir scripts tracking`
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/compile_analyses.py
+15
-12
15 additions, 12 deletions
bin/compile_analyses.py
with
15 additions
and
12 deletions
bin/compile_analyses.py
+
15
−
12
View file @
a8443933
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
"""
"""
Compile all root analysis scripts under
Compile all root analysis scripts under
benchmarks/<BENCHMARK>/
analysis
/*.cxx
benchmarks/<BENCHMARK>/
<DIR>
/*.cxx
Doing this step here rather than during the main benchmark script has
Doing this step here rather than during the main benchmark script has
multiple advantages:
multiple advantages:
...
@@ -13,11 +13,11 @@ multiple advantages:
...
@@ -13,11 +13,11 @@ multiple advantages:
fail (this is probably an old bug in root...)
fail (this is probably an old bug in root...)
Analysis scripts are expected to have extension
'
cxx
'
and be located in the analysis
Analysis scripts are expected to have extension
'
cxx
'
and be located in the analysis
subdirectory
subdirectory
(or directory specified as an argument)
"""
"""
## Our analysis path and file extension for glob
## Our analysis path and file extension for glob
ANALYSIS_PATH
=
r
'
benchmarks/{}/
analysis
'
ANALYSIS_PATH
=
r
'
benchmarks/{}/
{}
'
ANALYSIS_EXT
=
r
'
cxx
'
ANALYSIS_EXT
=
r
'
cxx
'
import
argparse
import
argparse
...
@@ -67,21 +67,24 @@ parser = argparse.ArgumentParser()
...
@@ -67,21 +67,24 @@ parser = argparse.ArgumentParser()
parser
.
add_argument
(
parser
.
add_argument
(
'
benchmark
'
,
'
benchmark
'
,
help
=
'
A benchmarks for which to compile the analysis scripts.
'
)
help
=
'
A benchmarks for which to compile the analysis scripts.
'
)
parser
.
add_argument
(
'
--dir
'
,
action
=
'
store
'
,
default
=
'
analysis
'
,
help
=
'
A directory in the benchmark to compile scripts in.
'
)
def
compile_analyses
(
benchmark
):
def
compile_analyses
(
benchmark
,
dir
):
'''
Compile all analysis scripts for a benchmark.
'''
'''
Compile all analysis scripts for a benchmark.
'''
print
(
"
Compiling all analyis scripts for
'
{}
'"
.
format
(
benchmark
))
print
(
"
Compiling all analyis scripts for
'
{}
'"
.
format
(
benchmark
,
dir
))
## Ensure our build directory exists
## Ensure our build directory exists
_init_build_dir
(
benchmark
)
_init_build_dir
(
benchmark
,
dir
)
## Get a list of all analysis scripts
## Get a list of all analysis scripts
_compile_all
(
benchmark
)
_compile_all
(
benchmark
,
dir
)
## All done!
## All done!
print
(
'
All analyses for
'
,
benchmark
,
'
compiled successfully
'
)
print
(
'
All analyses for
'
,
benchmark
,
'
compiled successfully
'
)
def
_init_build_dir
(
benchmark
):
def
_init_build_dir
(
benchmark
,
dir
):
'''
Initialize our ROOT build directory (if using one).
'''
'''
Initialize our ROOT build directory (if using one).
'''
print
(
'
--> Initializing ROOT build directory ...
'
)
print
(
'
--> Initializing ROOT build directory ...
'
)
build_prefix
=
os
.
getenv
(
'
ROOT_BUILD_DIR
'
)
build_prefix
=
os
.
getenv
(
'
ROOT_BUILD_DIR
'
)
...
@@ -90,14 +93,14 @@ def _init_build_dir(benchmark):
...
@@ -90,14 +93,14 @@ def _init_build_dir(benchmark):
return
return
## deduce the root build directory
## deduce the root build directory
pwd
=
os
.
getenv
(
'
PWD
'
)
pwd
=
os
.
getenv
(
'
PWD
'
)
build_dir
=
'
{}/{}/{}
'
.
format
(
build_prefix
,
pwd
,
ANALYSIS_PATH
.
format
(
benchmark
))
build_dir
=
'
{}/{}/{}
'
.
format
(
build_prefix
,
pwd
,
ANALYSIS_PATH
.
format
(
benchmark
,
dir
))
print
(
"
--> Ensuring directory
'
{}
'
exists
"
.
format
(
build_dir
))
print
(
"
--> Ensuring directory
'
{}
'
exists
"
.
format
(
build_dir
))
os
.
system
(
'
mkdir -p {}
'
.
format
(
build_dir
))
os
.
system
(
'
mkdir -p {}
'
.
format
(
build_dir
))
def
_compile_all
(
benchmark
):
def
_compile_all
(
benchmark
,
dir
):
'''
Compile all analysis for this benchmark.
'''
'''
Compile all analysis for this benchmark.
'''
print
(
'
--> Compiling analysis scripts
'
)
print
(
'
--> Compiling analysis scripts
'
)
anadir
=
Path
(
ANALYSIS_PATH
.
format
(
benchmark
))
anadir
=
Path
(
ANALYSIS_PATH
.
format
(
benchmark
,
dir
))
if
not
anadir
.
exists
():
if
not
anadir
.
exists
():
raise
PathNotFoundError
(
anadir
)
raise
PathNotFoundError
(
anadir
)
ana_list
=
[]
ana_list
=
[]
...
@@ -116,4 +119,4 @@ def _compile_cmd(file):
...
@@ -116,4 +119,4 @@ def _compile_cmd(file):
if
__name__
==
"
__main__
"
:
if
__name__
==
"
__main__
"
:
args
=
parser
.
parse_args
()
args
=
parser
.
parse_args
()
compile_analyses
(
args
.
benchmark
)
compile_analyses
(
args
.
benchmark
,
args
.
dir
)
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