Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
schedgen
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Pour rappel, le service sera inaccessible ce lundi 05/05/25 midi pour raison de mise à jour.
Show more breadcrumbs
veriT
schedgen
Commits
8b927d2f
Commit
8b927d2f
authored
3 years ago
by
Hans-Jörg
Browse files
Options
Downloads
Patches
Plain Diff
Finish simulator
parent
db77966a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
schedgen/schedgen-simulate.py
+38
-19
38 additions, 19 deletions
schedgen/schedgen-simulate.py
with
38 additions
and
19 deletions
schedgen/schedgen-simulate.py
+
38
−
19
View file @
8b927d2f
...
...
@@ -87,11 +87,13 @@ args_parser.add_argument(
)
def
writeResult
(
outFile
,
args
,
result
,
csv
=
False
):
message
(
f
"
Writing result to
{
outFile
}
.
"
,
logics
)
#with open(outFile, "w") as af:
af
=
stdout
if
True
:
def
clip_inf
(
max
):
return
lambda
x
:
max
if
x
==
float
(
"
inf
"
)
else
x
def
writeResult
(
args
,
result
,
csv
=
False
):
message
(
f
"
Writing result to
{
args
.
output
}
.
"
,
logics
)
with
open
(
args
.
output
,
"
w
"
)
as
af
:
af
.
write
(
"
-gridTPT report---------------
\n
"
)
af
.
write
(
f
"
Date :
{
datetime
.
now
()
:
%
Y
%
m
%
d
%
H
%
M
%
S
}
\n
"
)
af
.
write
(
"
Type : perf
\n
"
)
...
...
@@ -100,22 +102,37 @@ def writeResult(outFile, args, result, csv=False):
af
.
write
(
"
Hardware :
\n
"
)
af
.
write
(
f
"
Executable :
{
args
.
schedule
}
\n
"
)
af
.
write
(
"
Options :
\n
"
)
af
.
write
(
"
Benchmarks type : {args.logics}
\n
"
)
af
.
write
(
f
"
Benchmarks type :
{
args
.
logics
}
\n
"
)
if
args
.
time
:
af
.
write
(
f
"
CPU limit :
{
args
.
time
:
.
0
f
}
s
\n
"
)
else
:
af
.
write
(
"
CPU limit : 99999999s
\n
"
)
af
.
write
(
"
-statistics-------------------
"
)
af
.
write
(
f
"
Cumulative time : 23817m (396h)
"
)
af
.
write
(
"
Total time : 0m
"
)
af
.
write
(
"
Nb of clients : 1
"
)
af
.
write
(
"
Opt. Sched. time : 0m
"
)
af
.
write
(
"
-summary----------------------
"
)
af
.
write
(
f
"
Total number of benchmarks : 41217
"
)
af
.
write
(
f
"
Number of success : 31735
"
)
af
.
write
(
"
Number of unknown : 0
"
)
af
.
write
(
f
"
Number of time out : 7336
"
)
af
.
write
(
"
Number of errors : 0
"
)
af
.
write
(
"
-statistics-------------------
\n
"
)
time
=
result
.
map
(
clip_inf
(
args
.
time
)).
sum
()
af
.
write
(
f
"
Cumulative time :
{
time
/
60
:
.
0
f
}
m (
{
time
/
(
60
*
60
)
:
.
0
f
}
h)
\n
"
)
af
.
write
(
"
Total time : 0m
\n
"
)
af
.
write
(
"
Nb of clients : 1
\n
"
)
af
.
write
(
"
Opt. Sched. time : 0m
\n
"
)
af
.
write
(
"
-summary----------------------
\n
"
)
benchmarks
=
len
(
result
)
successes
=
len
(
result
.
loc
[
result
<
float
(
"
inf
"
)])
af
.
write
(
f
"
Total number of benchmarks :
{
benchmarks
}
\n
"
)
af
.
write
(
f
"
Number of success :
{
successes
}
\n
"
)
af
.
write
(
"
Number of unknown : 0
\n
"
)
af
.
write
(
f
"
Number of time out :
{
benchmarks
-
successes
}
\n
"
)
af
.
write
(
"
Number of errors : 0
\n
"
)
af
.
write
(
"
-data-------------------------
\n
"
)
padding
=
max
(
result
.
index
.
map
(
len
).
max
(),
len
(
"
Name
"
))
af
.
write
(
f
"
{
'
Name
'
:
<
{
padding
}}
total_time result
\n
"
)
for
key
in
result
.
index
:
if
result
[
key
]
==
float
(
"
inf
"
):
rtime
=
"
--
"
rout
=
"
NA
"
else
:
rtime
=
f
"
{
result
[
key
]
:
.
2
f
}
"
rout
=
"
0
"
af
.
write
(
f
"
{
key
:
<
{
padding
}}
{
rtime
:
>
10
}
{
rout
:
>
6
}
\n
"
)
af
.
write
(
"
-eof--------------------------
\n
"
)
if
__name__
==
"
__main__
"
:
...
...
@@ -161,7 +178,9 @@ if __name__ == "__main__":
jitter
=
rng
.
normal
(
args
.
mu
,
args
.
sigma
,
exps
.
shape
[
0
])
solved
=
(
exps
[
strategy
]
+
jitter
).
loc
[(
exps
[
strategy
]
+
jitter
)
<=
strategy_time
]
solved
=
(
exps
[
strategy
]
+
jitter
).
loc
[
(
exps
[
strategy
]
+
jitter
)
<=
strategy_time
]
solving_time
=
solved
.
clip
(
0.0
)
+
time
solving_time
.
name
=
sc
...
...
@@ -174,6 +193,6 @@ if __name__ == "__main__":
exps
[
sc
].
loc
[
exps
[
sc
]
>
timeout
]
=
float
(
"
inf
"
)
message
(
"
Writing output.
"
,
logics
)
writeResult
(
args
.
output
,
exps
[
sc
])
writeResult
(
args
,
exps
[
sc
])
message
(
"
All done.
"
,
logics
)
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