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
ad6f7a59
authored
Jun 29, 2020
by
Michael Schmid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SchmidMottok accepts interface
parent
578e6395
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
150 additions
and
44 deletions
+150
-44
src/main/java/mvd/jester/App.java
+19
-14
src/main/java/mvd/jester/tests/SchmidMottok.java
+32
-30
src/main/java/mvd/jester/tests/TypeFunction.java
+99
-0
No files found.
src/main/java/mvd/jester/App.java
View file @
ad6f7a59
...
...
@@ -9,6 +9,8 @@ import mvd.jester.tests.AbstractTest;
import
mvd.jester.tests.FonsecaNelis
;
import
mvd.jester.tests.MelaniButtazzo
;
import
mvd.jester.tests.SchmidMottok
;
import
mvd.jester.tests.TypeFunction.KownStructure
;
import
mvd.jester.tests.TypeFunction.UnkownStructure
;
/**
...
...
@@ -23,7 +25,8 @@ public class App {
// TestEnvironment te = new TestEnvironment();
// List<AbstractTest<DagTask>> tests =
// te.registerTests(Arrays.asList(new SchmidMottok(manager),
// te.registerTests(Arrays.asList(new SchmidMottok(new UnkownStructure(), manager),
// new SchmidMottok(new KownStructure(), manager),
// new MelaniButtazzo(manager), new FonsecaNelis(manager)));
// te.varyUtilization(builder, tests, 8, 500);
...
...
@@ -34,11 +37,24 @@ public class App {
// TestEnvironment te = new TestEnvironment();
// List<AbstractTest<DagTask>> tests =
// te.registerTests(Arrays.asList(new SchmidMottok(manager),
// te.registerTests(Arrays.asList(new SchmidMottok(new UnkownStructure(), manager),
// new SchmidMottok(new KownStructure(), manager),
// new MelaniButtazzo(manager), new FonsecaNelis(manager)));
// 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
(
new
UnkownStructure
(),
manager
),
new
SchmidMottok
(
new
KownStructure
(),
manager
),
new
MelaniButtazzo
(
manager
),
new
FonsecaNelis
(
manager
)));
te
.
varyNumberOfTasks
(
builder
,
tests
,
8
,
500
);
}
// {
// SystemManager manager = new SystemManager(8);
// DagTaskBuilder builder = new DagTaskBuilder();
...
...
@@ -48,18 +64,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);
// }
{
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
.
measureExecutionTimes
(
builder
,
tests
,
manager
,
500
);
}
}
}
src/main/java/mvd/jester/tests/SchmidMottok.java
View file @
ad6f7a59
...
...
@@ -22,11 +22,13 @@ public class SchmidMottok extends AbstractTest<DagTask> {
private
final
Map
<
Task
,
TerminationInfo
>
responseTimes
;
private
final
PriorityManager
priorityManager
;
private
final
TypeFunction
structure
;
public
SchmidMottok
(
final
SystemManager
manager
)
{
public
SchmidMottok
(
TypeFunction
structure
,
final
SystemManager
manager
)
{
super
(
manager
);
this
.
responseTimes
=
new
HashMap
<>();
this
.
priorityManager
=
new
RateMonotonic
();
this
.
structure
=
structure
;
}
@Override
...
...
@@ -47,7 +49,7 @@ public class SchmidMottok extends AbstractTest<DagTask> {
@Override
public
String
getName
()
{
return
"SchmidMottok"
;
return
"SchmidMottok"
+
"_"
+
structure
.
getType
()
;
}
private
long
calculateResponseTime
(
final
Set
<
DagTask
>
tasks
,
final
DagTask
task
)
{
...
...
@@ -63,7 +65,7 @@ public class SchmidMottok extends AbstractTest<DagTask> {
if
(
t
.
getPeriod
()
<
task
.
getPeriod
())
{
final
long
numberOfThreads
=
t
.
getNumberOfThreads
();
for
(
int
p
=
0
;
p
<
numberOfThreads
;
++
p
)
{
taskInterference
+=
Math
.
min
(
getTaskInterference
(
t
,
responseTime
,
p
+
1
),
taskInterference
+=
Math
.
min
(
structure
.
getTaskInterference
(
t
,
responseTimes
,
responseTime
,
p
+
1
),
responseTime
-
minimumWcet
+
1
);
}
}
...
...
@@ -93,32 +95,32 @@ public class SchmidMottok extends AbstractTest<DagTask> {
}
private
double
getTaskInterference
(
final
DagTask
task
,
final
long
interval
,
final
long
parallelism
)
{
if
(
responseTimes
.
containsKey
(
task
))
{
final
long
responseTime
=
responseTimes
.
get
(
task
).
getResponseTime
();
final
long
minWcet
=
task
.
getCriticalPath
();
final
long
period
=
task
.
getPeriod
();
final
long
amountOfJobs
=
(
LongMath
.
divide
(
interval
+
responseTime
-
minWcet
,
period
,
RoundingMode
.
FLOOR
)
+
1
);
double
workload
=
0
;
for
(
final
Segment
s
:
task
.
getWorkloadDistribution
())
{
final
long
numberOfThreads
=
s
.
getNumberOfJobs
()
>
1
?
task
.
getNumberOfThreads
()
:
1
;
if
(
numberOfThreads
>=
parallelism
)
{
workload
+=
s
.
getNumberOfJobs
()
*
s
.
getJobWcet
(
)
/
numberOfThreads
;
}
}
final
double
interference
=
amountOfJobs
*
workload
;
return
interference
;
}
else
{
throw
new
RuntimeException
(
"Task was not found in task set!"
);
}
}
//
private double getTaskInterference(final DagTask task, final long interval,
//
final long parallelism) {
//
if (responseTimes.containsKey(task)) {
//
final long responseTime = responseTimes.get(task).getResponseTime();
//
final long minWcet = task.getCriticalPath();
//
final long period = task.getPeriod();
//
final long amountOfJobs =
//
(LongMath.divide(interval + responseTime - minWcet, period, RoundingMode.FLOOR)
//
+ 1);
//
double workload = 0;
//
for (final Segment s : task.getWorkloadDistribution()) {
//
final long numberOfThreads =
//
s.getNumberOfJobs() > 1 ? task.getNumberOfThreads() : 1;
//
if (numberOfThreads >= parallelism) {
// workload += (double)(s.getNumberOfJobs() * s.getJobWcet()
) / numberOfThreads;
//
}
//
}
//
final double interference = amountOfJobs * workload;
//
return interference;
//
} else {
//
throw new RuntimeException("Task was not found in task set!");
//
}
//
}
}
src/main/java/mvd/jester/tests/TypeFunction.java
0 → 100644
View file @
ad6f7a59
package
mvd
.
jester
.
tests
;
import
java.math.RoundingMode
;
import
java.util.Map
;
import
com.google.common.math.LongMath
;
import
mvd.jester.info.TerminationInfo
;
import
mvd.jester.model.DagTask
;
import
mvd.jester.model.Segment
;
import
mvd.jester.model.Task
;
public
interface
TypeFunction
{
public
double
getTaskInterference
(
final
DagTask
task
,
final
Map
<
Task
,
TerminationInfo
>
responseTimes
,
final
long
interval
,
final
long
parallelism
);
public
String
getType
();
public
class
UnkownStructure
implements
TypeFunction
{
@Override
public
double
getTaskInterference
(
final
DagTask
task
,
final
Map
<
Task
,
TerminationInfo
>
responseTimes
,
final
long
interval
,
final
long
parallelism
)
{
if
(
responseTimes
.
containsKey
(
task
))
{
final
long
responseTime
=
responseTimes
.
get
(
task
).
getResponseTime
();
final
long
minWcet
=
task
.
getCriticalPath
();
final
long
period
=
task
.
getPeriod
();
final
long
amountOfJobs
=
(
LongMath
.
divide
(
interval
+
responseTime
-
minWcet
,
period
,
RoundingMode
.
FLOOR
)
+
1
);
double
workload
=
0
;
for
(
final
Segment
s
:
task
.
getWorkloadDistribution
())
{
final
long
numberOfThreads
=
task
.
getNumberOfThreads
();
if
(
numberOfThreads
>=
parallelism
)
{
workload
+=
(
double
)(
s
.
getNumberOfJobs
()
*
s
.
getJobWcet
())
/
numberOfThreads
;
}
}
final
double
interference
=
amountOfJobs
*
workload
;
return
interference
;
}
else
{
throw
new
RuntimeException
(
"Task was not found in task set!"
);
}
}
@Override
public
String
getType
()
{
return
"SU"
;
}
}
public
class
KownStructure
implements
TypeFunction
{
@Override
public
double
getTaskInterference
(
final
DagTask
task
,
final
Map
<
Task
,
TerminationInfo
>
responseTimes
,
final
long
interval
,
final
long
parallelism
)
{
if
(
responseTimes
.
containsKey
(
task
))
{
final
long
responseTime
=
responseTimes
.
get
(
task
).
getResponseTime
();
final
long
minWcet
=
task
.
getCriticalPath
();
final
long
period
=
task
.
getPeriod
();
final
long
amountOfJobs
=
(
LongMath
.
divide
(
interval
+
responseTime
-
minWcet
,
period
,
RoundingMode
.
FLOOR
)
+
1
);
double
workload
=
0
;
for
(
final
Segment
s
:
task
.
getWorkloadDistribution
())
{
final
long
numberOfThreads
=
s
.
getNumberOfJobs
()
>
1
?
task
.
getNumberOfThreads
()
:
1
;
if
(
numberOfThreads
>=
parallelism
)
{
workload
+=
(
double
)(
s
.
getNumberOfJobs
()
*
s
.
getJobWcet
())
/
numberOfThreads
;
}
}
final
double
interference
=
amountOfJobs
*
workload
;
return
interference
;
}
else
{
throw
new
RuntimeException
(
"Task was not found in task set!"
);
}
}
@Override
public
String
getType
()
{
return
"SK"
;
}
}
}
\ No newline at end of file
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