Fixed Issue #40: Inconsistencies on the return of Cloudlet.isCloudletFinished()…

Fixed Issue #40: Inconsistencies on the return of Cloudlet.isCloudletFinished() and the Cloudlet status.
parent de990a01
...@@ -619,7 +619,6 @@ public class Cloudlet { ...@@ -619,7 +619,6 @@ public class Cloudlet {
if (result <= 0.0) { if (result <= 0.0) {
completed = true; completed = true;
} }
return completed; return completed;
} }
......
...@@ -437,7 +437,7 @@ public class ResCloudlet { ...@@ -437,7 +437,7 @@ public class ResCloudlet {
return 0; return 0;
} }
return (long) Math.ceil(length / 1000000); return (long) Math.floor(length / 1000000);
} }
/** /**
...@@ -459,7 +459,8 @@ public class ResCloudlet { ...@@ -459,7 +459,8 @@ public class ResCloudlet {
cloudlet.setExecParam(wallClockTime, totalCompletionTime); cloudlet.setExecParam(wallClockTime, totalCompletionTime);
long finished = 0; long finished = 0;
if (cloudlet.getCloudletTotalLength() * 1000000 < cloudletFinishedSoFar) { //if (cloudlet.getCloudletTotalLength() * 1000000 < cloudletFinishedSoFar) {
if (cloudlet.getCloudletStatus()==Cloudlet.SUCCESS) {
finished = cloudlet.getCloudletLength(); finished = cloudlet.getCloudletLength();
} else { } else {
finished = cloudletFinishedSoFar / 1000000; finished = cloudletFinishedSoFar / 1000000;
......
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