Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DetectorWriteSim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EWMSCP
DetectorWriteSim
Commits
b5c286d3
Commit
b5c286d3
authored
1 year ago
by
Michael Reuscher
Browse files
Options
Downloads
Patches
Plain Diff
Simrunner 1.01 now different sets of tests parameter available
parent
0a651807
Branches
Branches containing commit
No related tags found
2 merge requests
!4
Python driver and data analysis part
,
!2
Threading fix
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
simrunner/simrunner.py
+28
-8
28 additions, 8 deletions
simrunner/simrunner.py
with
28 additions
and
8 deletions
simrunner/simrunner.py
+
28
−
8
View file @
b5c286d3
...
...
@@ -4,19 +4,39 @@ import subprocess
def
start_cpp_program
(
program_path
,
arguments
):
command
=
[
program_path
]
+
arguments
process
=
subprocess
.
Pope
n
(
command
,
stdin
=
subprocess
.
PIPE
,
stdout
=
subprocess
.
PIPE
)
process
=
subprocess
.
ru
n
(
command
,
stdin
=
subprocess
.
PIPE
,
stdout
=
subprocess
.
PIPE
)
return
process
def
send_input
(
program_path
,
arg
uments
):
command
=
[
program_path
]
+
arg
uments
def
send_input
(
program_path
,
arg
):
command
=
[
program_path
]
+
arg
process
=
subprocess
.
Popen
(
command
,
stdin
=
subprocess
.
PIPE
,
stdout
=
subprocess
.
PIPE
)
output
=
process
.
stdout
.
readline
().
decode
()
return
output
stdout
,
stderr
=
process
.
communicate
()
return
stdout
.
decode
()
data_config
=
{
"
s
"
:
[
"
1M
"
,
"
2M
"
,
"
3M
"
],
#Size
"
n
"
:
[
"
30
"
,
"
10
"
,
"
20
"
],
#nEvents
"
i
"
:
[
"
0.1
"
,
"
0.2
"
,
"
0.3
"
],
#interval
"
N
"
:
[
"
4
"
,
"
4
"
,
"
4
"
]
#UsedThreads
# Beispielverwendung
}
data_size
=
[
"
1M
"
,
"
2M
"
]
skript_path
=
os
.
path
.
abspath
(
__file__
)
main_folder
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
skript_path
))
data_path
=
os
.
path
.
join
(
main_folder
,
"
protokoll
"
)
cpp_program_path
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"
../build/src/detsim
"
)
arguments
=
[
"
-o
"
,
"
output
"
,
"
--posixDataDir
"
,
"
protokoll
"
,
"
-n
"
,
"
100
"
,
"
-s
"
,
"
2M
"
,
"
-i
"
,
"
0.1s
"
,
"
-N
"
,
"
4
"
]
os
.
makedirs
(
data_path
,
mode
=
0o777
,
exist_ok
=
True
)
send_input
(
cpp_program_path
,
arguments
)
for
data_set
in
range
(
len
(
data_config
[
"
s
"
])):
size
=
data_config
[
"
s
"
][
data_set
]
nEvents
=
data_config
[
"
n
"
][
data_set
]
interval
=
data_config
[
"
i
"
][
data_set
]
threads
=
data_config
[
"
N
"
][
data_set
]
folder_name
=
data_config
[
"
s
"
][
data_set
]
relativ_path
=
os
.
path
.
join
(
main_folder
,
"
output1
"
,
folder_name
)
os
.
makedirs
(
relativ_path
,
mode
=
0o777
,
exist_ok
=
True
)
arguments
=
[
"
-o
"
,
relativ_path
,
"
--posixDataDir
"
,
"
protokoll
"
,
"
-n
"
,
nEvents
,
"
-s
"
,
size
,
"
-i
"
,
interval
,
"
-N
"
,
threads
]
output
=
start_cpp_program
(
cpp_program_path
,
arguments
)
print
(
output
)
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