Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
las3_pub
/
jester
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
578e6395
authored
Jun 28, 2020
by
Michael Schmid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changes in Testenvironment
parent
31cab85d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
32 deletions
+39
-32
src/main/java/mvd/jester/App.java
+30
-19
src/main/java/mvd/jester/TestEnvironment.java
+9
-13
No files found.
src/main/java/mvd/jester/App.java
View file @
578e6395
...
...
@@ -17,28 +17,39 @@ import mvd.jester.tests.SchmidMottok;
*/
public
class
App
{
public
static
void
main
(
String
[]
args
)
{
{
SystemManager
manager
=
new
SystemManager
(
8
);
DagTaskBuilder
builder
=
new
DagTaskBuilder
();
TestEnvironment
te
=
new
TestEnvironment
();
//
{
//
SystemManager manager = new SystemManager(8);
//
DagTaskBuilder builder = new DagTaskBuilder();
//
TestEnvironment te = new TestEnvironment();
List
<
AbstractTest
<
DagTask
>>
tests
=
te
.
registerTests
(
Arrays
.
asList
(
new
SchmidMottok
(
manager
),
new
MelaniButtazzo
(
manager
),
new
FonsecaNelis
(
manager
)));
//
List<AbstractTest<DagTask>> tests =
//
te.registerTests(Arrays.asList(new SchmidMottok(manager),
//
new MelaniButtazzo(manager), new FonsecaNelis(manager)));
te
.
varyUtilization
(
builder
,
tests
,
8
,
500
);
}
{
SystemManager
manager
=
new
SystemManager
(
8
);
DagTaskBuilder
builder
=
new
DagTaskBuilder
();
TestEnvironment
te
=
new
TestEnvironment
();
//
te.varyUtilization(builder, tests, 8, 500);
//
}
//
{
//
SystemManager manager = new SystemManager(8);
//
DagTaskBuilder builder = new DagTaskBuilder();
//
TestEnvironment te = new TestEnvironment();
List
<
AbstractTest
<
DagTask
>>
tests
=
te
.
registerTests
(
Arrays
.
asList
(
new
SchmidMottok
(
manager
),
new
MelaniButtazzo
(
manager
),
new
FonsecaNelis
(
manager
)));
//
List<AbstractTest<DagTask>> tests =
//
te.registerTests(Arrays.asList(new SchmidMottok(manager),
//
new MelaniButtazzo(manager), new FonsecaNelis(manager)));
te
.
varyNumberOfProcessors
(
builder
,
tests
,
manager
,
500
);
}
// te.varyNumberOfProcessors(builder, tests, manager, 500);
// }
// {
// SystemManager manager = new SystemManager(8);
// DagTaskBuilder builder = new DagTaskBuilder();
// TestEnvironment te = new TestEnvironment();
// List<AbstractTest<DagTask>> tests =
// te.registerTests(Arrays.asList(new SchmidMottok(manager),
// new MelaniButtazzo(manager), new FonsecaNelis(manager)));
// te.varyNumberOfTasks(builder, tests, 8, 500);
// }
{
SystemManager
manager
=
new
SystemManager
(
8
);
DagTaskBuilder
builder
=
new
DagTaskBuilder
();
...
...
@@ -48,7 +59,7 @@ public class App {
te
.
registerTests
(
Arrays
.
asList
(
new
SchmidMottok
(
manager
),
new
MelaniButtazzo
(
manager
),
new
FonsecaNelis
(
manager
)));
te
.
varyNumberOfTasks
(
builder
,
tests
,
8
,
500
);
te
.
measureExecutionTimes
(
builder
,
tests
,
manager
,
500
);
}
}
}
src/main/java/mvd/jester/TestEnvironment.java
View file @
578e6395
package
mvd
.
jester
;
import
java.lang.management.ManagementFactory
;
import
java.util.ArrayList
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
...
...
@@ -7,8 +8,6 @@ import java.util.Map;
import
java.util.Set
;
import
java.util.Map.Entry
;
import
java.util.concurrent.ThreadLocalRandom
;
import
java.util.concurrent.TimeUnit
;
import
com.google.common.base.Stopwatch
;
import
mvd.jester.info.SchedulingInfo
;
import
mvd.jester.info.SchedulingInfo.Feasiblity
;
import
mvd.jester.model.DagTask
;
...
...
@@ -81,21 +80,21 @@ public class TestEnvironment {
public
void
measureExecutionTimes
(
final
DagTaskBuilder
builder
,
final
List
<
AbstractTest
<
DagTask
>>
abstractTestInstances
,
final
long
numberOfMeasurements
)
{
SystemManager
manager
,
final
long
numberOfMeasurements
)
{
Map
<
AbstractTest
<
DagTask
>,
List
<
Long
>>
results
=
new
LinkedHashMap
<>();
abstractTestInstances
.
forEach
(
t
->
results
.
put
(
t
,
new
ArrayList
<>()));
for
(
int
i
=
0
;
i
<
numberOfMeasurements
;
++
i
)
{
double
utilization
=
ThreadLocalRandom
.
current
().
nextDouble
(
1
,
7
);
double
utilization
=
ThreadLocalRandom
.
current
().
nextDouble
(
1
,
manager
.
getNumberOfProcessors
()
);
Set
<
DagTask
>
taskSet
=
builder
.
generateTaskSet
(
utilization
);
for
(
AbstractTest
<
DagTask
>
testInstance
:
abstractTestInstances
)
{
final
PriorityManager
priorityManager
=
testInstance
.
getPriorityManager
();
final
SortedTaskSet
<
DagTask
>
sortedTaskSet
=
new
SortedTaskSet
<>(
priorityManager
);
sortedTaskSet
.
addAll
(
taskSet
);
Stopwatch
w
=
Stopwatch
.
createStarted
();
long
timeBefore
=
ManagementFactory
.
getThreadMXBean
().
getCurrentThreadCpuTime
();
testInstance
.
runSchedulabilityCheck
(
sortedTaskSet
);
w
.
stop
();
long
micros
=
w
.
elapsed
(
TimeUnit
.
MICROSECONDS
)
;
long
timeAfter
=
ManagementFactory
.
getThreadMXBean
().
getCurrentThreadCpuTime
();
long
micros
=
(
timeAfter
-
timeBefore
)/
1000
;
results
.
get
(
testInstance
).
add
(
micros
);
}
}
...
...
@@ -126,8 +125,7 @@ public class TestEnvironment {
final
Set
<
DagTask
>
taskSet
=
builder
.
generateUUnifastTaskSet
(
(
long
)
(
1.5
*
numberOfProcessors
),
(
double
)
numberOfProcessors
*
0.5
);
System
.
out
.
print
(
Math
.
round
((
double
)
checkedTasksets
/
numberOfTaskSets
*
100
)
+
"% of "
+
numberOfTaskSets
+
" tasksets tested!\r"
);
System
.
out
.
print
(
checkedTasksets
+
"/"
+
numberOfTaskSets
+
" tasksets tested!\r"
);
for
(
final
AbstractTest
<
DagTask
>
testInstance
:
abstractTestInstances
)
{
final
PriorityManager
priorityManager
=
testInstance
.
getPriorityManager
();
...
...
@@ -168,8 +166,7 @@ public class TestEnvironment {
final
Set
<
DagTask
>
taskSet
=
builder
.
generateUUnifastTaskSet
(
numberOfTasks
,
(
double
)
numberOfProcessors
*
0.5
);
System
.
out
.
print
(
Math
.
round
((
double
)
checkedTasksets
/
numberOfTaskSets
*
100
)
+
"% of "
+
numberOfTaskSets
+
" tasksets tested!\r"
);
System
.
out
.
print
(
checkedTasksets
+
"/"
+
numberOfTaskSets
+
" tasksets tested!\r"
);
for
(
final
AbstractTest
<
DagTask
>
testInstance
:
abstractTestInstances
)
{
final
PriorityManager
priorityManager
=
testInstance
.
getPriorityManager
();
...
...
@@ -209,8 +206,7 @@ public class TestEnvironment {
for
(
int
i
=
0
;
i
<
numberOfTaskSetsPerUtil
;
++
i
)
{
final
Set
<
DagTask
>
taskSet
=
builder
.
generateTaskSet
(
util
);
System
.
out
.
print
(
Math
.
round
((
double
)
checkedTasksets
/
numberOfTaskSets
*
100
)
+
"% of "
+
numberOfTaskSets
+
" tasksets tested!\r"
);
System
.
out
.
print
(
checkedTasksets
+
"/"
+
numberOfTaskSets
+
" tasksets tested!\r"
);
for
(
final
AbstractTest
<
DagTask
>
testInstance
:
abstractTestInstances
)
{
final
PriorityManager
priorityManager
=
testInstance
.
getPriorityManager
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment