Commit 95f57c7f authored by rodrigo.calheiros's avatar rodrigo.calheiros

Fixed issue #12: Dynamically created space-shared VMs fail to process cloudlets

parent ce9bdc60
...@@ -109,10 +109,6 @@ public class Datacenter extends SimEntity { ...@@ -109,10 +109,6 @@ public class Datacenter extends SimEntity {
/** /**
* Overrides this method when making a new and different type of resource. * Overrides this method when making a new and different type of resource.
* This method is called by {@link #body()} to register other type to
* GIS entity. In doing so, you
* need to create a new child class extending from
* gridsim.CloudInformationService.
* <br> * <br>
* <b>NOTE:</b> You do not need to override {@link #body()} method, if * <b>NOTE:</b> You do not need to override {@link #body()} method, if
* you use this method. * you use this method.
...@@ -913,7 +909,7 @@ public class Datacenter extends SimEntity { ...@@ -913,7 +909,7 @@ public class Datacenter extends SimEntity {
//if some time passed since last processing //if some time passed since last processing
//R: for term is to allow loop at simulation start. Otherwise, one initial //R: for term is to allow loop at simulation start. Otherwise, one initial
// simulation step is skipped and schedulers are not properly initialized // simulation step is skipped and schedulers are not properly initialized
if (CloudSim.clock() < 0.11 || CloudSim.clock() > this.getLastProcessTime()+0.1) { if (CloudSim.clock() < 0.111 || CloudSim.clock() > this.getLastProcessTime()+0.1) {
List<? extends Host> list = getVmAllocationPolicy().getHostList(); List<? extends Host> list = getVmAllocationPolicy().getHostList();
double smallerTime = Double.MAX_VALUE; double smallerTime = Double.MAX_VALUE;
//for each host... //for each host...
...@@ -926,10 +922,9 @@ public class Datacenter extends SimEntity { ...@@ -926,10 +922,9 @@ public class Datacenter extends SimEntity {
} }
} }
//gurantees a minimal interval before scheduling the event //gurantees a minimal interval before scheduling the event
if (smallerTime<CloudSim.clock()+0.1) { if (smallerTime<CloudSim.clock()+0.11) {
smallerTime=CloudSim.clock()+0.1; smallerTime=CloudSim.clock()+0.11;
} }
if (smallerTime != Double.MAX_VALUE) { if (smallerTime != Double.MAX_VALUE) {
schedule(getId(), (smallerTime - CloudSim.clock()), CloudSimTags.VM_DATACENTER_EVENT); schedule(getId(), (smallerTime - CloudSim.clock()), CloudSimTags.VM_DATACENTER_EVENT);
} }
...@@ -967,9 +962,6 @@ public class Datacenter extends SimEntity { ...@@ -967,9 +962,6 @@ public class Datacenter extends SimEntity {
* @param file a DataCloud file * @param file a DataCloud file
* *
* @return a tag number denoting whether this operation is a success or not * @return a tag number denoting whether this operation is a success or not
*
* @see CloudSim.datagrid.DataCloudTags#FILE_ADD_SUCCESSFUL
* @see CloudSim.datagrid.DataCloudTags#FILE_ADD_ERROR_EMPTY
*/ */
public int addFile(File file) { public int addFile(File file) {
if (file == null) { if (file == null) {
...@@ -1047,12 +1039,7 @@ public class Datacenter extends SimEntity { ...@@ -1047,12 +1039,7 @@ public class Datacenter extends SimEntity {
* *
* @param fileName the name of the file to be deleted * @param fileName the name of the file to be deleted
* *
* @return the error message as defined in * @return the error message
* {@link CloudSim.datagrid.DataCloudTags}
*
* @see CloudSim.datagrid.DataCloudTags#FILE_DELETE_SUCCESSFUL
* @see CloudSim.datagrid.DataCloudTags#FILE_DELETE_ERROR_ACCESS_DENIED
* @see CloudSim.datagrid.DataCloudTags#FILE_DELETE_ERROR
*/ */
private int deleteFileFromStorage(String fileName) { private int deleteFileFromStorage(String fileName) {
Storage tempStorage = null; Storage tempStorage = null;
...@@ -1073,7 +1060,7 @@ public class Datacenter extends SimEntity { ...@@ -1073,7 +1060,7 @@ public class Datacenter extends SimEntity {
* Prints the debts. * Prints the debts.
*/ */
public void printDebts() { public void printDebts() {
Log.printLine("*****PowerDatacenter: "+this.getName()+"*****"); Log.printLine("*****Datacenter: "+this.getName()+"*****");
Log.printLine("User id\t\tDebt"); Log.printLine("User id\t\tDebt");
Set<Integer> keys = getDebts().keySet(); Set<Integer> keys = getDebts().keySet();
......
...@@ -134,7 +134,6 @@ public class Vm { ...@@ -134,7 +134,6 @@ public class Vm {
* @post $none * @post $none
*/ */
public double updateVmProcessing(double currentTime, List<Double> mipsShare) { public double updateVmProcessing(double currentTime, List<Double> mipsShare) {
setRecentlyCreated(false);
if (mipsShare != null) { if (mipsShare != null) {
return getCloudletScheduler().updateVmProcessing(currentTime, mipsShare); return getCloudletScheduler().updateVmProcessing(currentTime, mipsShare);
} }
...@@ -150,6 +149,8 @@ public class Vm { ...@@ -150,6 +149,8 @@ public class Vm {
List<Double> currentRequestedMips = getCloudletScheduler().getCurrentRequestedMips(); List<Double> currentRequestedMips = getCloudletScheduler().getCurrentRequestedMips();
if (isRecentlyCreated()) { if (isRecentlyCreated()) {
setRecentlyCreated(false);
//boolean mipsIsNull = true; //boolean mipsIsNull = true;
//if (CloudSim.clock() > 0) { //if (CloudSim.clock() > 0) {
//mipsIsNull = false; //mipsIsNull = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment