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
43947796
authored
Sep 25, 2020
by
Michael Schmid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small changes, mostly renaming
parent
39635336
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
94 additions
and
102 deletions
+94
-102
.project
+11
-0
src/main/java/mvd/jester/App.java
+12
-11
src/main/java/mvd/jester/TestEnvironment.java
+2
-1
src/main/java/mvd/jester/model/DagTask.java
+2
-2
src/main/java/mvd/jester/model/Segment.java
+9
-9
src/main/java/mvd/jester/model/SynchronousTask.java
+4
-4
src/main/java/mvd/jester/model/SystemManager.java
+6
-11
src/main/java/mvd/jester/simulator/internals/dynamicforkjoin/JobContext.java
+1
-1
src/main/java/mvd/jester/simulator/internals/dynamicforkjoin/SegmentContext.java
+2
-2
src/main/java/mvd/jester/simulator/internals/parallelsynchronous/JobContext.java
+1
-1
src/main/java/mvd/jester/simulator/internals/parallelsynchronous/SegmentContext.java
+2
-2
src/main/java/mvd/jester/simulator/internals/parallelsynchronous/TaskContext.java
+1
-1
src/main/java/mvd/jester/tests/ChwaLee.java
+10
-10
src/main/java/mvd/jester/tests/FonsecaNelis.java
+6
-6
src/main/java/mvd/jester/tests/MaiaBertogna.java
+5
-5
src/main/java/mvd/jester/tests/SchmidMottok.java
+3
-15
src/main/java/mvd/jester/tests/TypeFunction.java
+5
-9
src/test/java/mvd/jester/model/TestSegment.java
+4
-4
src/test/java/mvd/jester/model/TestSystemSetup.java
+4
-4
src/test/java/mvd/jester/simulator/dynamicforkjoin/TestJobContext.java
+3
-3
src/test/java/mvd/jester/simulator/parallelsynchronous/TestJobContext.java
+1
-1
No files found.
.project
View file @
43947796
...
@@ -20,4 +20,15 @@
...
@@ -20,4 +20,15 @@
<nature>
org.eclipse.jdt.core.javanature
</nature>
<nature>
org.eclipse.jdt.core.javanature
</nature>
<nature>
org.eclipse.m2e.core.maven2Nature
</nature>
<nature>
org.eclipse.m2e.core.maven2Nature
</nature>
</natures>
</natures>
<filteredResources>
<filter>
<id>
1600851289823
</id>
<name></name>
<type>
30
</type>
<matcher>
<id>
org.eclipse.core.resources.regexFilterMatcher
</id>
<arguments>
node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__
</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
</projectDescription>
src/main/java/mvd/jester/App.java
View file @
43947796
...
@@ -30,7 +30,7 @@ public class App {
...
@@ -30,7 +30,7 @@ public class App {
// SchmidMottok sm = new SchmidMottok(new KnownStructure(), manager);
// SchmidMottok sm = new SchmidMottok(new KnownStructure(), manager);
// JiangYi jy = new JiangYi(manager);
// JiangYi jy = new JiangYi(manager);
// Set<DagTask> set =
builder
.generateRenyiTaskSet(7.0);
// Set<DagTask> set =
manager.getBuilder()
.generateRenyiTaskSet(7.0);
// final SortedTaskSet<DagTask> rmTasks = new SortedTaskSet<>(sm.getPriorityManager());
// final SortedTaskSet<DagTask> rmTasks = new SortedTaskSet<>(sm.getPriorityManager());
// rmTasks.addAll(set);
// rmTasks.addAll(set);
...
@@ -45,10 +45,10 @@ public class App {
...
@@ -45,10 +45,10 @@ public class App {
new
SchmidMottok
(
new
KnownStructureWithMaxThreads
(
manager
),
manager
),
new
SchmidMottok
(
new
KnownStructureWithMaxThreads
(
manager
),
manager
),
new
SchmidMottok
(
new
KnownStructure
(),
manager
),
new
SchmidMottok
(
new
KnownStructure
(),
manager
),
// new MelaniButtazzo(manager),
// new MelaniButtazzo(manager),
// new FonsecaNelis(manager),
new
FonsecaNelis
(
manager
)
new
JiangYi
(
manager
)
));
/* new JiangYi(manager) */
));
te
.
varyRenyiUtilization
(
manager
,
tests
,
5
00
);
te
.
varyRenyiUtilization
(
manager
,
tests
,
1
00
);
}
}
// {
// {
// SystemManager manager = new SystemManager(8);
// SystemManager manager = new SystemManager(8);
...
@@ -65,16 +65,17 @@ public class App {
...
@@ -65,16 +65,17 @@ public class App {
// te.varyUtilization(builder, tests, 8, 500);
// te.varyUtilization(builder, tests, 8, 500);
// }
// }
// {
// {
// SystemManager manager = new SystemManager(8);
// SystemManager<DagTaskBuilder> manager = new SystemManager<>(DagTaskBuilder.class);
// DagTaskBuilder builder = new DagTaskBuilder();
// TestEnvironment te = new TestEnvironment();
// TestEnvironment te = new TestEnvironment();
// List<AbstractTest<DagTask>> tests =
// List<AbstractTest<DagTask>> tests = te.registerTests(Arrays.asList(
// te.registerTests(Arrays.asList(new SchmidMottok(new UnkownStructure(), manager),
// new SchmidMottok(new KnownStructureWithMaxThreads(manager), manager),
// new SchmidMottok(new KownStructure(), manager),
// new SchmidMottok(new KnownStructure(), manager),
// new MelaniButtazzo(manager), new FonsecaNelis(manager)));
// // new MelaniButtazzo(manager),
// // new FonsecaNelis(manager),
// new JiangYi(manager)));
// te.varyNumberOfProcessors(
builder, tests, manager
, 500);
// te.varyNumberOfProcessors(
manager, tests
, 500);
// }
// }
// {
// {
// SystemManager manager = new SystemManager(8);
// SystemManager manager = new SystemManager(8);
...
...
src/main/java/mvd/jester/TestEnvironment.java
View file @
43947796
...
@@ -238,7 +238,8 @@ public class TestEnvironment {
...
@@ -238,7 +238,8 @@ public class TestEnvironment {
long
checkedTasksets
=
0
;
long
checkedTasksets
=
0
;
final
long
numberOfTaskSets
=
((
numberOfProcessors
*
4
)
-
3
)
*
numberOfTaskSetsPerUtil
;
final
long
numberOfTaskSets
=
((
numberOfProcessors
*
4
)
-
3
)
*
numberOfTaskSetsPerUtil
;
final
ResultLogger
resultLogger
=
new
ResultLogger
(
"utilization_"
+
numberOfProcessors
);
final
ResultLogger
resultLogger
=
new
ResultLogger
(
"renyi_utilization_"
+
numberOfProcessors
);
final
Map
<
AbstractTest
<
DagTask
>,
Long
>
resultMap
=
new
LinkedHashMap
<>();
final
Map
<
AbstractTest
<
DagTask
>,
Long
>
resultMap
=
new
LinkedHashMap
<>();
abstractTestInstances
.
forEach
(
t
->
resultMap
.
put
(
t
,
(
long
)
0
));
abstractTestInstances
.
forEach
(
t
->
resultMap
.
put
(
t
,
(
long
)
0
));
resultLogger
.
logHeader
(
resultMap
,
"Utilization"
);
resultLogger
.
logHeader
(
resultMap
,
"Utilization"
);
...
...
src/main/java/mvd/jester/model/DagTask.java
View file @
43947796
...
@@ -54,8 +54,8 @@ public class DagTask extends Task {
...
@@ -54,8 +54,8 @@ public class DagTask extends Task {
public
long
getMaximumParallelism
()
{
public
long
getMaximumParallelism
()
{
long
max
=
0
;
long
max
=
0
;
for
(
final
Segment
s
:
workloadDistribution
)
{
for
(
final
Segment
s
:
workloadDistribution
)
{
if
(
max
<
s
.
get
NumberOfJobs
())
{
if
(
max
<
s
.
get
Height
())
{
max
=
s
.
get
NumberOfJobs
();
max
=
s
.
get
Height
();
}
}
}
}
return
max
;
return
max
;
...
...
src/main/java/mvd/jester/model/Segment.java
View file @
43947796
...
@@ -3,26 +3,26 @@ package mvd.jester.model;
...
@@ -3,26 +3,26 @@ package mvd.jester.model;
public
class
Segment
{
public
class
Segment
{
private
final
long
jobWcet
;
private
final
long
width
;
private
final
long
numberOfJobs
;
private
final
long
height
;
public
Segment
(
long
jobWcet
,
long
numberOfJobs
)
{
public
Segment
(
long
width
,
long
height
)
{
this
.
jobWcet
=
jobWcet
;
this
.
width
=
width
;
this
.
numberOfJobs
=
numberOfJobs
;
this
.
height
=
height
;
}
}
/**
/**
* @return the numberOfJobs
* @return the numberOfJobs
*/
*/
public
long
get
NumberOfJobs
()
{
public
long
get
Height
()
{
return
numberOfJobs
;
return
height
;
}
}
/**
/**
* @return the jobWcet
* @return the jobWcet
*/
*/
public
long
get
JobWcet
()
{
public
long
get
Width
()
{
return
jobWcet
;
return
width
;
}
}
}
}
src/main/java/mvd/jester/model/SynchronousTask.java
View file @
43947796
...
@@ -64,8 +64,8 @@ public class SynchronousTask extends Task {
...
@@ -64,8 +64,8 @@ public class SynchronousTask extends Task {
public
long
getMaximumParallelism
()
{
public
long
getMaximumParallelism
()
{
long
max
=
0
;
long
max
=
0
;
for
(
final
Segment
s
:
segments
)
{
for
(
final
Segment
s
:
segments
)
{
if
(
max
<
s
.
get
NumberOfJobs
())
{
if
(
max
<
s
.
get
Height
())
{
max
=
s
.
get
NumberOfJobs
();
max
=
s
.
get
Height
();
}
}
}
}
return
max
;
return
max
;
...
@@ -80,7 +80,7 @@ public class SynchronousTask extends Task {
...
@@ -80,7 +80,7 @@ public class SynchronousTask extends Task {
public
static
long
calculateWorkload
(
final
Set
<
Segment
>
segments
)
{
public
static
long
calculateWorkload
(
final
Set
<
Segment
>
segments
)
{
long
workload
=
0
;
long
workload
=
0
;
for
(
final
Segment
s
:
segments
)
{
for
(
final
Segment
s
:
segments
)
{
workload
+=
s
.
get
JobWcet
()
*
s
.
getNumberOfJobs
();
workload
+=
s
.
get
Width
()
*
s
.
getHeight
();
}
}
return
workload
;
return
workload
;
}
}
...
@@ -89,7 +89,7 @@ public class SynchronousTask extends Task {
...
@@ -89,7 +89,7 @@ public class SynchronousTask extends Task {
public
static
long
calculateCriticalPath
(
final
Set
<
Segment
>
segments
)
{
public
static
long
calculateCriticalPath
(
final
Set
<
Segment
>
segments
)
{
long
criticalPath
=
0
;
long
criticalPath
=
0
;
for
(
final
Segment
s
:
segments
)
{
for
(
final
Segment
s
:
segments
)
{
criticalPath
+=
s
.
get
JobWcet
();
criticalPath
+=
s
.
get
Width
();
}
}
return
criticalPath
;
return
criticalPath
;
...
...
src/main/java/mvd/jester/model/SystemManager.java
View file @
43947796
...
@@ -194,8 +194,8 @@ public class SystemManager<T extends Builder> implements SystemManagerInterface
...
@@ -194,8 +194,8 @@ public class SystemManager<T extends Builder> implements SystemManagerInterface
public
Set
<
DagTask
>
generateRenyiTaskSet
(
final
double
totalUtilization
)
{
public
Set
<
DagTask
>
generateRenyiTaskSet
(
final
double
totalUtilization
)
{
final
LinkedHashSet
<
DagTask
>
taskSet
=
new
LinkedHashSet
<>();
final
LinkedHashSet
<
DagTask
>
taskSet
=
new
LinkedHashSet
<>();
double
currentUtilization
=
0
;
double
currentUtilization
=
0
;
while
(
currentUtilization
<=
totalUtilization
)
{
while
(
currentUtilization
<=
totalUtilization
)
{
final
DagTask
dagTask
=
generateRenyiTask
(
totalUtilization
);
final
DagTask
dagTask
=
generateRenyiTask
(
totalUtilization
);
...
@@ -207,8 +207,8 @@ public class SystemManager<T extends Builder> implements SystemManagerInterface
...
@@ -207,8 +207,8 @@ public class SystemManager<T extends Builder> implements SystemManagerInterface
final
long
period
=
final
long
period
=
(
long
)
Math
.
ceil
(
dagTask
.
getWorkload
()
/
remainingUtilization
);
(
long
)
Math
.
ceil
(
dagTask
.
getWorkload
()
/
remainingUtilization
);
if
(
period
>=
dagTask
.
getCriticalPath
())
{
if
(
period
>=
dagTask
.
getCriticalPath
())
{
final
DagTask
modifiedTask
=
final
DagTask
modifiedTask
=
new
DagTask
(
dagTask
.
getJobDag
(),
period
,
new
DagTask
(
dagTask
.
getJobDag
(),
period
,
numberOfProcessors
);
dagTask
.
getNumberOfThreads
()
);
taskSet
.
add
(
modifiedTask
);
taskSet
.
add
(
modifiedTask
);
break
;
break
;
}
}
...
@@ -280,19 +280,14 @@ public class SystemManager<T extends Builder> implements SystemManagerInterface
...
@@ -280,19 +280,14 @@ public class SystemManager<T extends Builder> implements SystemManagerInterface
final
long
criticalPath
=
DagUtils
.
calculateCriticalPath
(
jobDag
);
final
long
criticalPath
=
DagUtils
.
calculateCriticalPath
(
jobDag
);
final
long
period
=
randomRenyiPeriod
(
workload
,
criticalPath
,
totalUtilization
);
final
long
period
=
randomRenyiPeriod
(
workload
,
criticalPath
,
totalUtilization
);
final
long
minNumberOfThreads
=
LongMath
.
divide
(
workload
-
criticalPath
,
final
long
numberOfThreads
=
randomNumberOfThreads
(
numberOfProcessors
/
2
);
period
-
criticalPath
,
RoundingMode
.
FLOOR
);
// TODO: change back to following:
// final long numberOfThreads = randomNumberOfThreads(minNumberOfThreads);
return
new
DagTask
(
jobDag
,
period
,
minN
umberOfThreads
);
return
new
DagTask
(
jobDag
,
period
,
n
umberOfThreads
);
}
}
private
long
randomRenyiPeriod
(
final
long
workload
,
final
long
criticalPath
,
private
long
randomRenyiPeriod
(
final
long
workload
,
final
long
criticalPath
,
final
double
totalUtilization
)
{
final
double
totalUtilization
)
{
final
double
firstPart
=
final
double
firstPart
=
(
criticalPath
+
(
double
)
(
workload
)
/
(
0.4
*
totalUtilization
));
(
criticalPath
+
(
double
)
(
workload
)
/
(
0.4
*
totalUtilization
));
final
double
gamma
=
new
GammaDistribution
(
2
,
1
).
sample
();
final
double
gamma
=
new
GammaDistribution
(
2
,
1
).
sample
();
final
double
secondPart
=
1
+
0.25
*
gamma
;
final
double
secondPart
=
1
+
0.25
*
gamma
;
...
...
src/main/java/mvd/jester/simulator/internals/dynamicforkjoin/JobContext.java
View file @
43947796
...
@@ -25,7 +25,7 @@ public class JobContext implements JobContextInterface {
...
@@ -25,7 +25,7 @@ public class JobContext implements JobContextInterface {
this
.
currentTasklet
=
Optional
.
empty
();
this
.
currentTasklet
=
Optional
.
empty
();
this
.
taskContext
=
taskContext
;
this
.
taskContext
=
taskContext
;
this
.
segmentContext
=
segmentContext
;
this
.
segmentContext
=
segmentContext
;
this
.
wcet
=
segmentContext
.
getSegment
().
get
JobWcet
();
this
.
wcet
=
segmentContext
.
getSegment
().
get
Width
();
}
}
public
Optional
<
TaskContextInterface
>
updateExecution
(
long
time
)
{
public
Optional
<
TaskContextInterface
>
updateExecution
(
long
time
)
{
...
...
src/main/java/mvd/jester/simulator/internals/dynamicforkjoin/SegmentContext.java
View file @
43947796
...
@@ -19,8 +19,8 @@ public class SegmentContext {
...
@@ -19,8 +19,8 @@ public class SegmentContext {
jobs
=
new
HashSet
<>();
jobs
=
new
HashSet
<>();
tasklets
=
new
HashSet
<>();
tasklets
=
new
HashSet
<>();
long
numberOfJobs
=
segment
.
getNumberOfJobs
()
>
numberOfProcessors
?
numberOfProcessors
long
numberOfJobs
=
:
segment
.
getNumberOfJobs
();
segment
.
getHeight
()
>
numberOfProcessors
?
numberOfProcessors
:
segment
.
getHeight
();
for
(
int
j
=
0
;
j
<
numberOfJobs
;
++
j
)
{
for
(
int
j
=
0
;
j
<
numberOfJobs
;
++
j
)
{
jobs
.
add
(
new
JobContext
(
taskContext
,
this
));
jobs
.
add
(
new
JobContext
(
taskContext
,
this
));
...
...
src/main/java/mvd/jester/simulator/internals/parallelsynchronous/JobContext.java
View file @
43947796
...
@@ -24,7 +24,7 @@ public class JobContext implements JobContextInterface {
...
@@ -24,7 +24,7 @@ public class JobContext implements JobContextInterface {
this
.
currentProcessor
=
Optional
.
empty
();
this
.
currentProcessor
=
Optional
.
empty
();
this
.
taskContext
=
taskContext
;
this
.
taskContext
=
taskContext
;
this
.
segmentContext
=
segmentContext
;
this
.
segmentContext
=
segmentContext
;
this
.
wcet
=
segmentContext
.
getSegment
().
get
JobWcet
();
this
.
wcet
=
segmentContext
.
getSegment
().
get
Width
();
this
.
executionTime
=
wcet
;
this
.
executionTime
=
wcet
;
}
}
...
...
src/main/java/mvd/jester/simulator/internals/parallelsynchronous/SegmentContext.java
View file @
43947796
...
@@ -17,7 +17,7 @@ public class SegmentContext {
...
@@ -17,7 +17,7 @@ public class SegmentContext {
this
.
segment
=
segment
;
this
.
segment
=
segment
;
jobs
=
new
HashSet
<>();
jobs
=
new
HashSet
<>();
for
(
int
j
=
0
;
j
<
segment
.
get
NumberOfJobs
();
++
j
)
{
for
(
int
j
=
0
;
j
<
segment
.
get
Height
();
++
j
)
{
jobs
.
add
(
new
JobContext
(
taskContext
,
this
));
jobs
.
add
(
new
JobContext
(
taskContext
,
this
));
}
}
}
}
...
@@ -38,6 +38,6 @@ public class SegmentContext {
...
@@ -38,6 +38,6 @@ public class SegmentContext {
@Override
@Override
public
String
toString
()
{
public
String
toString
()
{
return
"(nJobs="
+
segment
.
get
NumberOfJobs
()
+
", jobWcet="
+
segment
.
getJobWcet
()
+
")"
;
return
"(nJobs="
+
segment
.
get
Height
()
+
", jobWcet="
+
segment
.
getWidth
()
+
")"
;
}
}
}
}
src/main/java/mvd/jester/simulator/internals/parallelsynchronous/TaskContext.java
View file @
43947796
...
@@ -56,7 +56,7 @@ public class TaskContext implements TaskContextInterface {
...
@@ -56,7 +56,7 @@ public class TaskContext implements TaskContextInterface {
public
Optional
<
TaskContextInterface
>
acceptNotification
(
long
time
)
{
public
Optional
<
TaskContextInterface
>
acceptNotification
(
long
time
)
{
segmentCounter
++;
segmentCounter
++;
if
(
segmentCounter
>=
segments
.
get
(
currentSegment
).
getSegment
().
get
NumberOfJobs
())
{
if
(
segmentCounter
>=
segments
.
get
(
currentSegment
).
getSegment
().
get
Height
())
{
currentSegment
++;
currentSegment
++;
segmentCounter
=
0
;
segmentCounter
=
0
;
if
(
currentSegment
>=
segments
.
size
())
{
if
(
currentSegment
>=
segments
.
size
())
{
...
...
src/main/java/mvd/jester/tests/ChwaLee.java
View file @
43947796
...
@@ -84,8 +84,8 @@ public class ChwaLee extends AbstractTest<SynchronousTask> {
...
@@ -84,8 +84,8 @@ public class ChwaLee extends AbstractTest<SynchronousTask> {
long
selfInterference
=
0
;
long
selfInterference
=
0
;
for
(
final
Segment
s
:
task
.
getWorkloadDistribution
())
{
for
(
final
Segment
s
:
task
.
getWorkloadDistribution
())
{
if
(
s
.
get
NumberOfJobs
()
>=
p
+
1
)
{
if
(
s
.
get
Height
()
>=
p
+
1
)
{
selfInterference
+=
s
.
get
JobWcet
();
selfInterference
+=
s
.
get
Width
();
}
}
}
}
return
selfInterference
;
return
selfInterference
;
...
@@ -97,8 +97,8 @@ public class ChwaLee extends AbstractTest<SynchronousTask> {
...
@@ -97,8 +97,8 @@ public class ChwaLee extends AbstractTest<SynchronousTask> {
long
workloadOfBodyJobs
=
0
;
long
workloadOfBodyJobs
=
0
;
for
(
final
Segment
s
:
t
.
getWorkloadDistribution
())
{
for
(
final
Segment
s
:
t
.
getWorkloadDistribution
())
{
if
(
s
.
get
NumberOfJobs
()
>=
p
)
{
if
(
s
.
get
Height
()
>=
p
)
{
workloadOfBodyJobs
+=
s
.
get
JobWcet
();
workloadOfBodyJobs
+=
s
.
get
Width
();
}
}
}
}
...
@@ -109,11 +109,11 @@ public class ChwaLee extends AbstractTest<SynchronousTask> {
...
@@ -109,11 +109,11 @@ public class ChwaLee extends AbstractTest<SynchronousTask> {
final
List
<
Segment
>
segmentList
=
new
ArrayList
<>(
t
.
getWorkloadDistribution
());
final
List
<
Segment
>
segmentList
=
new
ArrayList
<>(
t
.
getWorkloadDistribution
());
Collections
.
reverse
(
segmentList
);
Collections
.
reverse
(
segmentList
);
for
(
final
Segment
s
:
segmentList
)
{
for
(
final
Segment
s
:
segmentList
)
{
carryInLength
+=
s
.
get
JobWcet
();
carryInLength
+=
s
.
get
Width
();
if
(
s
.
get
NumberOfJobs
()
>=
p
&&
remainingLength
>
carryInLength
)
{
if
(
s
.
get
Height
()
>=
p
&&
remainingLength
>
carryInLength
)
{
boundedCarryInWorkload
+=
s
.
get
JobWcet
();
boundedCarryInWorkload
+=
s
.
get
Width
();
}
else
if
(
s
.
get
NumberOfJobs
()
>=
p
&&
remainingLength
<=
carryInLength
)
{
}
else
if
(
s
.
get
Height
()
>=
p
&&
remainingLength
<=
carryInLength
)
{
boundedCarryInWorkload
+=
s
.
get
JobWcet
()
-
(
carryInLength
-
remainingLength
);
boundedCarryInWorkload
+=
s
.
get
Width
()
-
(
carryInLength
-
remainingLength
);
}
}
if
(
carryInLength
>=
remainingLength
)
{
if
(
carryInLength
>=
remainingLength
)
{
break
;
break
;
...
@@ -126,7 +126,7 @@ public class ChwaLee extends AbstractTest<SynchronousTask> {
...
@@ -126,7 +126,7 @@ public class ChwaLee extends AbstractTest<SynchronousTask> {
private
long
getMinimumWcet
(
final
SynchronousTask
task
)
{
private
long
getMinimumWcet
(
final
SynchronousTask
task
)
{
long
minWcet
=
0
;
long
minWcet
=
0
;
for
(
final
Segment
s
:
task
.
getWorkloadDistribution
())
{
for
(
final
Segment
s
:
task
.
getWorkloadDistribution
())
{
minWcet
+=
s
.
get
JobWcet
();
minWcet
+=
s
.
get
Width
();
}
}
return
minWcet
;
return
minWcet
;
...
...
src/main/java/mvd/jester/tests/FonsecaNelis.java
View file @
43947796
...
@@ -198,7 +198,7 @@ public class FonsecaNelis extends AbstractTest<DagTask> {
...
@@ -198,7 +198,7 @@ public class FonsecaNelis extends AbstractTest<DagTask> {
Collections
.
reverse
(
reverseCarryInList
);
Collections
.
reverse
(
reverseCarryInList
);
for
(
final
Segment
s
:
reverseCarryInList
)
{
for
(
final
Segment
s
:
reverseCarryInList
)
{
carryInPeriod
+=
s
.
get
JobWcet
();
carryInPeriod
+=
s
.
get
Width
();
carryOutPeriod
=
carryInAndOutPeriod
-
carryInPeriod
;
carryOutPeriod
=
carryInAndOutPeriod
-
carryInPeriod
;
final
long
carryInWorkload
=
final
long
carryInWorkload
=
getCarryInWorkload
(
task
,
carryInDistribution
,
carryInPeriod
);
getCarryInWorkload
(
task
,
carryInDistribution
,
carryInPeriod
);
...
@@ -212,7 +212,7 @@ public class FonsecaNelis extends AbstractTest<DagTask> {
...
@@ -212,7 +212,7 @@ public class FonsecaNelis extends AbstractTest<DagTask> {
carryOutPeriod
=
0
;
carryOutPeriod
=
0
;
for
(
final
Segment
s
:
carryOutDistribution
)
{
for
(
final
Segment
s
:
carryOutDistribution
)
{
carryOutPeriod
+=
s
.
get
JobWcet
();
carryOutPeriod
+=
s
.
get
Width
();
carryInPeriod
=
carryInAndOutPeriod
-
carryOutPeriod
;
carryInPeriod
=
carryInAndOutPeriod
-
carryOutPeriod
;
final
long
carryInWorkload
=
final
long
carryInWorkload
=
getCarryInWorkload
(
task
,
carryInDistribution
,
carryInPeriod
);
getCarryInWorkload
(
task
,
carryInDistribution
,
carryInPeriod
);
...
@@ -235,11 +235,11 @@ public class FonsecaNelis extends AbstractTest<DagTask> {
...
@@ -235,11 +235,11 @@ public class FonsecaNelis extends AbstractTest<DagTask> {
final
Segment
s
=
distributionList
.
get
(
i
);
final
Segment
s
=
distributionList
.
get
(
i
);
long
weightOfPreviousSegments
=
0
;
long
weightOfPreviousSegments
=
0
;
for
(
int
j
=
0
;
j
<
i
;
++
j
)
{
for
(
int
j
=
0
;
j
<
i
;
++
j
)
{
weightOfPreviousSegments
+=
distributionList
.
get
(
j
).
get
JobWcet
();
weightOfPreviousSegments
+=
distributionList
.
get
(
j
).
get
Width
();
}
}
final
long
width
=
carryOutPeriod
-
weightOfPreviousSegments
;
final
long
width
=
carryOutPeriod
-
weightOfPreviousSegments
;
workload
+=
Math
.
max
(
Math
.
min
(
width
,
s
.
get
JobWcet
()),
0
)
*
s
.
getNumberOfJobs
();
workload
+=
Math
.
max
(
Math
.
min
(
width
,
s
.
get
Width
()),
0
)
*
s
.
getHeight
();
}
}
final
long
improvedWorkloadFromTask
=
final
long
improvedWorkloadFromTask
=
...
@@ -262,11 +262,11 @@ public class FonsecaNelis extends AbstractTest<DagTask> {
...
@@ -262,11 +262,11 @@ public class FonsecaNelis extends AbstractTest<DagTask> {
final
Segment
s
=
distributionList
.
get
(
b
);
final
Segment
s
=
distributionList
.
get
(
b
);
long
weightOfRemainingSegments
=
0
;
long
weightOfRemainingSegments
=
0
;
for
(
int
p
=
b
+
1
;
p
<
carryInDistribution
.
size
();
++
p
)
{
for
(
int
p
=
b
+
1
;
p
<
carryInDistribution
.
size
();
++
p
)
{
weightOfRemainingSegments
+=
distributionList
.
get
(
p
).
get
JobWcet
();
weightOfRemainingSegments
+=
distributionList
.
get
(
p
).
get
Width
();
}
}
final
long
width
=
carryInPeriod
-
period
+
responseTime
-
weightOfRemainingSegments
;
final
long
width
=
carryInPeriod
-
period
+
responseTime
-
weightOfRemainingSegments
;
workload
+=
Math
.
max
(
Math
.
min
(
width
,
s
.
get
JobWcet
()),
0
)
*
s
.
getNumberOfJobs
();
workload
+=
Math
.
max
(
Math
.
min
(
width
,
s
.
get
Width
()),
0
)
*
s
.
getHeight
();
}
}
final
long
improvedWorkload
=
Math
.
max
(
carryInPeriod
-
(
period
-
responseTime
),
0
)
final
long
improvedWorkload
=
Math
.
max
(
carryInPeriod
-
(
period
-
responseTime
),
0
)
...
...
src/main/java/mvd/jester/tests/MaiaBertogna.java
View file @
43947796
...
@@ -91,8 +91,8 @@ public class MaiaBertogna extends AbstractTest<SynchronousTask> {
...
@@ -91,8 +91,8 @@ public class MaiaBertogna extends AbstractTest<SynchronousTask> {
long
interference
=
0
;
long
interference
=
0
;
for
(
final
Segment
s
:
task
.
getWorkloadDistribution
())
{
for
(
final
Segment
s
:
task
.
getWorkloadDistribution
())
{
if
(
s
.
get
NumberOfJobs
()
>=
parallelism
+
1
)
{
if
(
s
.
get
Height
()
>=
parallelism
+
1
)
{
interference
+=
s
.
get
JobWcet
();
interference
+=
s
.
get
Width
();
}
}
}
}
...
@@ -112,8 +112,8 @@ public class MaiaBertogna extends AbstractTest<SynchronousTask> {
...
@@ -112,8 +112,8 @@ public class MaiaBertogna extends AbstractTest<SynchronousTask> {
long
workload
=
0
;
long
workload
=
0
;
for
(
final
Segment
s
:
task
.
getWorkloadDistribution
())
{
for
(
final
Segment
s
:
task
.
getWorkloadDistribution
())
{
if
(
s
.
get
NumberOfJobs
()
>=
parallelism
)
{
if
(
s
.
get
Height
()
>=
parallelism
)
{
workload
+=
s
.
get
JobWcet
();
workload
+=
s
.
get
Width
();
}
}
}
}
...
@@ -128,7 +128,7 @@ public class MaiaBertogna extends AbstractTest<SynchronousTask> {
...
@@ -128,7 +128,7 @@ public class MaiaBertogna extends AbstractTest<SynchronousTask> {
private
long
getMinimumWcet
(
final
SynchronousTask
task
)
{
private
long
getMinimumWcet
(
final
SynchronousTask
task
)
{
long
minWcet
=
0
;
long
minWcet
=
0
;
for
(
final
Segment
s
:
task
.
getWorkloadDistribution
())
{
for
(
final
Segment
s
:
task
.
getWorkloadDistribution
())
{
minWcet
+=
s
.
get
JobWcet
();
minWcet
+=
s
.
get
Width
();
}
}
return
minWcet
;
return
minWcet
;
...
...
src/main/java/mvd/jester/tests/SchmidMottok.java
View file @
43947796
...
@@ -11,6 +11,7 @@ import mvd.jester.model.SystemManagerInterface;
...
@@ -11,6 +11,7 @@ import mvd.jester.model.SystemManagerInterface;
import
mvd.jester.model.Task
;
import
mvd.jester.model.Task
;
import
mvd.jester.priority.PriorityManager
;
import
mvd.jester.priority.PriorityManager
;
import
mvd.jester.priority.RateMonotonic
;
import
mvd.jester.priority.RateMonotonic
;
import
mvd.jester.tests.TypeFunction.KnownStructureWithMaxThreads
;
/**
/**
* SchmidMottok
* SchmidMottok
...
@@ -54,14 +55,6 @@ public class SchmidMottok extends AbstractTest<DagTask> {
...
@@ -54,14 +55,6 @@ public class SchmidMottok extends AbstractTest<DagTask> {
long
responseTime
=
minimumWcet
;
long
responseTime
=
minimumWcet
;
long
previousResponseTime
=
0
;
long
previousResponseTime
=
0
;
long
occupiedProcessors
=
0
;
// manager.getNumberOfProcessors() + 1;
for
(
final
DagTask
t
:
tasks
)
{
if
(
t
.
getPeriod
()
<
task
.
getPeriod
())
{
final
long
numberOfProcessors
=
structure
.
getNumberOfThreads
(
t
);
occupiedProcessors
+=
numberOfProcessors
;
}
}
do
{
do
{
previousResponseTime
=
responseTime
;
previousResponseTime
=
responseTime
;
double
taskInterference
=
0
;
double
taskInterference
=
0
;
...
@@ -69,13 +62,8 @@ public class SchmidMottok extends AbstractTest<DagTask> {
...
@@ -69,13 +62,8 @@ public class SchmidMottok extends AbstractTest<DagTask> {
if
(
t
.
getPeriod
()
<
task
.
getPeriod
())
{
if
(
t
.
getPeriod
()
<
task
.
getPeriod
())
{
final
long
numberOfThreads
=
structure
.
getNumberOfThreads
(
t
);
final
long
numberOfThreads
=
structure
.
getNumberOfThreads
(
t
);
for
(
int
p
=
0
;
p
<
numberOfThreads
;
++
p
)
{
for
(
int
p
=
0
;
p
<
numberOfThreads
;
++
p
)
{
if
(
occupiedProcessors
>
manager
.
getNumberOfProcessors
())
{
taskInterference
+=
Math
.
min
(
structure
.
getTaskInterference
(
t
,
responseTimes
,
taskInterference
+=
responseTime
,
p
+
1
),
responseTime
-
minimumWcet
+
1
);
Math
.
min
(
structure
.
getTaskInterference
(
t
,
responseTimes
,
responseTime
,
p
+
1
),
responseTime
-
minimumWcet
+
1
);
}
}
}
}
}
}
}
...
...
src/main/java/mvd/jester/tests/TypeFunction.java
View file @
43947796
...
@@ -44,10 +44,9 @@ public interface TypeFunction {
...
@@ -44,10 +44,9 @@ public interface TypeFunction {
for
(
final
Segment
s
:
task
.
getWorkloadDistribution
())
{
for
(
final
Segment
s
:
task
.
getWorkloadDistribution
())
{
final
long
numberOfThreads
=
final
long
numberOfThreads
=
s
.
get
NumberOfJobs
()
>
1
?
manager
.
getNumberOfProcessors
()
:
1
;
s
.
get
Height
()
>
1
?
manager
.
getNumberOfProcessors
()
:
1
;
if
(
numberOfThreads
>=
parallelism
)
{
if
(
numberOfThreads
>=
parallelism
)
{
workload
+=
workload
+=
(
double
)
(
s
.
getHeight
()
*
s
.
getWidth
())
/
numberOfThreads
;
(
double
)
(
s
.
getNumberOfJobs
()
*
s
.
getJobWcet
())
/
numberOfThreads
;
}
}
}
}
...
@@ -98,8 +97,7 @@ public interface TypeFunction {
...
@@ -98,8 +97,7 @@ public interface TypeFunction {
for
(
final
Segment
s
:
task
.
getWorkloadDistribution
())
{
for
(
final
Segment
s
:
task
.
getWorkloadDistribution
())
{
final
long
numberOfThreads
=
task
.
getNumberOfThreads
();
final
long
numberOfThreads
=
task
.
getNumberOfThreads
();
if
(
numberOfThreads
>=
parallelism
)
{
if
(
numberOfThreads
>=
parallelism
)
{
workload
+=
workload
+=
(
double
)
(
s
.
getHeight
()
*
s
.
getWidth
())
/
numberOfThreads
;
(
double
)
(
s
.
getNumberOfJobs
()
*
s
.
getJobWcet
())
/
numberOfThreads
;
}
}
}
}
...
@@ -148,11 +146,9 @@ public interface TypeFunction {
...
@@ -148,11 +146,9 @@ public interface TypeFunction {
double
workload
=
0
;
double
workload
=
0
;
for
(
final
Segment
s
:
task
.
getWorkloadDistribution
())
{
for
(
final
Segment
s
:
task
.
getWorkloadDistribution
())
{
final
long
numberOfThreads
=
final
long
numberOfThreads
=
s
.
getHeight
()
>
1
?
task
.
getNumberOfThreads
()
:
1
;
s
.
getNumberOfJobs
()
>
1
?
task
.
getNumberOfThreads
()
:
1
;
if
(
numberOfThreads
>=
parallelism
)
{
if
(
numberOfThreads
>=
parallelism
)
{
workload
+=
workload
+=
(
double
)
(
s
.
getHeight
()
*
s
.
getWidth
())
/
numberOfThreads
;
(
double
)
(
s
.
getNumberOfJobs
()
*
s
.
getJobWcet
())
/
numberOfThreads
;
}
}
}
}
...
...
src/test/java/mvd/jester/model/TestSegment.java
View file @
43947796
...
@@ -15,10 +15,10 @@ public class TestSegment {
...
@@ -15,10 +15,10 @@ public class TestSegment {
Segment
s1
=
new
Segment
(
100
,
10
);
Segment
s1
=
new
Segment
(
100
,
10
);
Segment
s2
=
new
Segment
(
9
,
10
);
Segment
s2
=
new
Segment
(
9
,
10
);
assertTrue
(
s1
.
get
JobWcet
()
==
100
);
assertTrue
(
s1
.
get
Width
()
==
100
);
assertTrue
(
s1
.
get
NumberOfJobs
()
==
10
);
assertTrue
(
s1
.
get
Height
()
==
10
);
assertTrue
(
s2
.
get
JobWcet
()
==
9
);
assertTrue
(
s2
.
get
Width
()
==
9
);
assertTrue
(
s2
.
get
NumberOfJobs
()
==
10
);
assertTrue
(
s2
.
get
Height
()
==
10
);
}
}
}
}
src/test/java/mvd/jester/model/TestSystemSetup.java
View file @
43947796
...
@@ -39,10 +39,10 @@ public class TestSystemSetup {
...
@@ -39,10 +39,10 @@ public class TestSystemSetup {
long
maxJobWcet
=
t
.
getPeriod
()
/
t
.
getWorkloadDistribution
().
size
();
long
maxJobWcet
=
t
.
getPeriod
()
/
t
.
getWorkloadDistribution
().
size
();
for
(
Segment
s
:
t
.
getWorkloadDistribution
())
{
for
(
Segment
s
:
t
.
getWorkloadDistribution
())
{
assertTrue
(
s
.
get
JobWcet
()
>=
1
);
assertTrue
(
s
.
get
Width
()
>=
1
);
assertTrue
(
s
.
get
JobWcet
()
<=
maxJobWcet
);
assertTrue
(
s
.
get
Width
()
<=
maxJobWcet
);
assertTrue
(
s
.
get
NumberOfJobs
()
>=
1
);
assertTrue
(
s
.
get
Height
()
>=
1
);
assertTrue
(
s
.
get
NumberOfJobs
()
<=
10
);
assertTrue
(
s
.
get
Height
()
<=
10
);
}
}
assertTrue
(
t
.
getWorkloadDistribution
().
size
()
>=
1
);
assertTrue
(
t
.
getWorkloadDistribution
().
size
()
>=
1
);
...
...
src/test/java/mvd/jester/simulator/dynamicforkjoin/TestJobContext.java
View file @
43947796
...
@@ -32,7 +32,7 @@ public class TestJobContext {
...
@@ -32,7 +32,7 @@ public class TestJobContext {
SegmentContext
sc
=
mock
(
SegmentContext
.
class
);
SegmentContext
sc
=
mock
(
SegmentContext
.
class
);
Segment
s
=
mock
(
Segment
.
class
);
Segment
s
=
mock
(
Segment
.
class
);
when
(
sc
.
getSegment
()).
thenReturn
(
s
);
when
(
sc
.
getSegment
()).
thenReturn
(
s
);
when
(
s
.
get
JobWcet
()).
thenReturn
((
long
)
20
);
when
(
s
.
get
Width
()).
thenReturn
((
long
)
20
);
when
(
sc
.
getNextTasklet
()).
thenReturn
(
Optional
.
of
(
tlc
))
when
(
sc
.
getNextTasklet
()).
thenReturn
(
Optional
.
of
(
tlc
))
.
thenReturn
(
Optional
.
ofNullable
(
null
));
.
thenReturn
(
Optional
.
ofNullable
(
null
));
...
@@ -53,7 +53,7 @@ public class TestJobContext {
...
@@ -53,7 +53,7 @@ public class TestJobContext {
SegmentContext
sc
=
mock
(
SegmentContext
.
class
);
SegmentContext
sc
=
mock
(
SegmentContext
.
class
);
Segment
s
=
mock
(
Segment
.
class
);
Segment
s
=
mock
(
Segment
.
class
);
when
(
sc
.
getSegment
()).
thenReturn
(
s
);
when
(
sc
.
getSegment
()).
thenReturn
(
s
);
when
(
s
.
get
JobWcet
()).
thenReturn
((
long
)
20
);
when
(
s
.
get
Width
()).
thenReturn
((
long
)
20
);
when
(
tlc
.
checkExecutionTime
()).
thenReturn
(
true
,
false
);
when
(
tlc
.
checkExecutionTime
()).
thenReturn
(
true
,
false
);
JobContext
jc
=
new
JobContext
(
tc
,
sc
);
JobContext
jc
=
new
JobContext
(
tc
,
sc
);
...
@@ -75,7 +75,7 @@ public class TestJobContext {
...
@@ -75,7 +75,7 @@ public class TestJobContext {
when
(
sc
.
getSegment
()).
thenReturn
(
s
);
when
(
sc
.
getSegment
()).
thenReturn
(
s
);
when
(
sc
.
getNextTasklet
()).
thenReturn
(
Optional
.
ofNullable
(
tlc
))
when
(
sc
.
getNextTasklet
()).
thenReturn
(
Optional
.
ofNullable
(
tlc
))
.
thenReturn
(
Optional
.
ofNullable
(
null
));
.
thenReturn
(
Optional
.
ofNullable
(
null
));
when
(
s
.
get
JobWcet
()).
thenReturn
((
long
)
20
);
when
(
s
.
get
Width
()).
thenReturn
((
long
)
20
);
when
(
tlc
.
checkExecutionTime
()).
thenReturn
(
true
,
false
);
when
(
tlc
.
checkExecutionTime
()).
thenReturn
(
true
,
false
);
when
(
tlc
.
updateExecution
(
not
(
eq
(
0
)))).
thenReturn
(
true
);
when
(
tlc
.
updateExecution
(
not
(
eq
(
0
)))).
thenReturn
(
true
);
when
(
tlc
.
updateExecution
(
0
)).
thenReturn
(
false
);
when
(
tlc
.
updateExecution
(
0
)).
thenReturn
(
false
);
...
...
src/test/java/mvd/jester/simulator/parallelsynchronous/TestJobContext.java
View file @
43947796
...
@@ -31,7 +31,7 @@ public class TestJobContext {
...
@@ -31,7 +31,7 @@ public class TestJobContext {
long
jobWcet
=
ThreadLocalRandom
.
current
().
nextLong
(
20
,
50
);
long
jobWcet
=
ThreadLocalRandom
.
current
().
nextLong
(
20
,
50
);
Segment
s
=
mock
(
Segment
.
class
);
Segment
s
=
mock
(
Segment
.
class
);
when
(
s
.
get
JobWcet
()).
thenReturn
(
jobWcet
);
when
(
s
.
get
Width
()).
thenReturn
(
jobWcet
);
SegmentContext
sc
=
mock
(
SegmentContext
.
class
);
SegmentContext
sc
=
mock
(
SegmentContext
.
class
);
when
(
sc
.
getSegment
()).
thenReturn
(
s
);
when
(
sc
.
getSegment
()).
thenReturn
(
s
);
TaskContext
tc
=
mock
(
TaskContext
.
class
);
TaskContext
tc
=
mock
(
TaskContext
.
class
);
...
...
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