cloudsim
cloudsim copied to clipboard
Datacenter doubles expected file transfer time
Datacenter adds the file transfer time to the estimated estimatedFinishTime when sending a cloudlet to a vm's scheduler .
double estimatedFinishTime = scheduler.cloudletSubmit(cl, fileTransferTime);
// if this cloudlet is in the exec queue
if (estimatedFinishTime > 0.0 && !Double.isInfinite(estimatedFinishTime)) {
estimatedFinishTime += fileTransferTime;
send(getId(), estimatedFinishTime, CloudSimTags.VM_DATACENTER_EVENT);
However, a proper cloudlet scheduler is already expected to incorporate the extra cloudlet calculation cost of the file transfer and subsequently returns an estimatedFinishTime based on this new total calculation cost which already includes the file transfer time. (taken from the default CloudletSchedulerTimeShared)
public double cloudletSubmit(Cloudlet cloudlet, double fileTransferTime) {
...
// use the current capacity to estimate the extra amount of
// time to file transferring. It must be added to the cloudlet length
double extraSize = getCapacity(getCurrentMipsShare()) * fileTransferTime;
long length = (long) (cloudlet.getCloudletLength() + extraSize);
cloudlet.setCloudletLength(length);
return cloudlet.getCloudletLength() / getCapacity(getCurrentMipsShare());
}
Having the Datacenter add the calculation time again thus results in an inacurate time for the next datacenter event.