Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Lucas Cavalcante
cloudsimplus
Commits
7b304c2e
Commit
7b304c2e
authored
Jun 28, 2018
by
Eduardo Falcão
Browse files
fixing cloudlet scheduler bug (the one we thought was a bug in sharedProvisioner)
parent
acb5d106
Changes
4
Hide whitespace changes
Inline
Side-by-side
cloudsim-plus/src/main/java/org/cloudbus/cloudsim/provisioners/ResourceProvisionerShared.java
View file @
7b304c2e
...
...
@@ -81,14 +81,14 @@ public class ResourceProvisionerShared extends ResourceProvisionerAbstract {
This way, if the resource is not found inside the VM
and it is a Pe, it's OK (as it is expected)
*/
//
if(!getResource().isObjectSubClassOf(Pe.class) && !vm.getResource(getResourceClass()).setCapacity(newTotalVmResourceCapacity)){
//
return false;
//
}
if
(!
getResource
().
isObjectSubClassOf
(
Pe
.
class
)
&&
!
vm
.
getResource
(
getResourceClass
()).
setCapacity
(
newTotalVmResourceCapacity
)){
return
false
;
}
//Allocates the requested resource from the physical resource
getResource
().
allocateResource
(
newTotalVmResourceCapacity
);
getResourceAllocationMap
().
put
(
vm
,
newTotalVmResourceCapacity
);
vm
.
getResource
(
getResourceClass
()).
setAllocatedResource
(
newTotal
VmResource
Capacity
);
vm
.
getResource
(
getResourceClass
()).
setAllocatedResource
(
prev
VmResource
Allocation
);
return
true
;
}
}
...
...
cloudsim-plus/src/main/java/org/cloudbus/cloudsim/provisioners/ResourceProvisionerSimple.java
View file @
7b304c2e
...
...
@@ -66,9 +66,9 @@ public class ResourceProvisionerSimple extends ResourceProvisionerAbstract {
This way, if the resource is not found inside the VM
and it is a Pe, it's OK (as it is expected)
*/
//
if(!getResource().isObjectSubClassOf(Pe.class) && !vm.getResource(getResourceClass()).setCapacity(newTotalVmResourceCapacity)){
//
return false;
//
}
if
(!
getResource
().
isObjectSubClassOf
(
Pe
.
class
)
&&
!
vm
.
getResource
(
getResourceClass
()).
setCapacity
(
newTotalVmResourceCapacity
)){
return
false
;
}
//Allocates the requested resource from the physical resource
getResource
().
allocateResource
(
newTotalVmResourceCapacity
);
...
...
cloudsim-plus/src/main/java/org/cloudbus/cloudsim/schedulers/cloudlet/CloudletSchedulerAbstract.java
View file @
7b304c2e
...
...
@@ -597,8 +597,6 @@ public abstract class CloudletSchedulerAbstract implements CloudletScheduler {
protected
void
updateCloudletProcessing
(
final
CloudletExecution
ce
,
final
double
currentTime
)
{
final
long
executedInstructions
=
cloudletExecutedInstructionsForElapsedTime
(
ce
,
currentTime
);
final
long
executedIops
=
cloudletExecutedIopsForElapsedTime
(
ce
,
currentTime
);
Log
.
printLine
(
executedInstructions
);
Log
.
printLine
(
executedIops
);
ce
.
updateProcessing
(
executedInstructions
,
executedIops
);
}
...
...
cloudsim-plus/src/main/java/org/cloudbus/cloudsim/schedulers/vm/VmSchedulerAbstract.java
View file @
7b304c2e
...
...
@@ -209,8 +209,8 @@ public abstract class VmSchedulerAbstract implements VmScheduler {
@Override
public
double
getAllocatedIops
(
final
Vm
vm
)
{
final
double
iops
=
vm
.
getIops
().
getCapacity
();
//
final double iops = vm.getIops().getCapacity();
final
double
iops
=
vm
.
getIops
().
getAllocatedResource
();
return
iops
;
}
...
...
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