Cloudslab / cloudsim

CloudSim: A Framework For Modeling And Simulation Of Cloud Computing Infrastructures And Services
http://www.cloudbus.org/cloudsim/
810 stars 492 forks source link

Wrong calculation of size and remainingLength in method `cloudletResume` in `CloudletSchedulerSpaceShared` #100

Open NhatPhan opened 7 years ago

NhatPhan commented 7 years ago

This piece of codes in cloudletResume is buggy: image

  1. in line 257 rcl.getRemainingCloudletLength() is assigned to size, the getRemainingCloudletLength : image which uses getCloudletTotalLength, which already includes getNumberOfPes(). however on line 258 size is multiplied by getNumberOfPes(), making the value wrong.
  2. in line 259 the cloudletLength is updated with size (which is the remaining cloudlet length). but the cloudletFinishedSoFar is not reset to 0. therefore subsequent calls to getRemainingCloudletLength() (like line 276) will get the wrong value since the cloudletFinishedSoFar will be subtracted twice.
douglasleer commented 6 years ago

I agree with you on these two errors. I actually found many more errors in other places within the code.