阅读背景:

在CloudSim中执行执行顺序

来源:互联网 

In cloudSim how can I enforce that cloudlet_2 should start after cloudlet_1 (Speaking of their execution time) ?

在cloudSim中,如何强制执行cloudlet_2应该在cloudlet_1之后启动(说到执行时间)?

I try to do it some thing like this:

我尝试做这样的事情:

cloudlet_2.setExecStartTime(cloudlet_1.getFinishTime());

But this has no effect at run time, both of the cloudlets start at 0.0sec.

但这在运行时没有任何影响,两个cloudlet都在0.0秒开始。

Is there any mechanism to enforce cloudlet_2 to not start execution (or even not submitted to the data-center) before cloudlet_1 finish executing ?

在cloudlet_1完成执行之前,是否有任何机制可以强制cloudlet_2不开始执行(甚至不提交到数据中心)?

this can be by setting start time or by imposing some boolean condition on cloudlet_2, or other trick ... ???

这可以通过设置开始时间或在cloudlet_2上施加一些布尔条件,或其他技巧...... ???

The above requirement comes from the fact that I need some pipeline computation pattern of cloudlets that should execute one after the other (not at once.)

上面的要求来自于我需要一些cloudlet的管道计算模式,这些模式应该一个接一个地执行(不是一次)。

thanks.

1 个解决方案

#1


0  

Which cloudlet gets executed when is totally depends on your scheduling policy. Here what you need is something like FCFS policy. Actually Cloudsim's default scheduling policy is FCFS.

哪个cloudlet执行完全取决于您的调度策略。这里你需要的是像FCFS政策。实际上,Cloudsim的默认调度策略是FCFS。

But as per your requirement "cloudlet_2 should start after cloudlet_1",you need to change the vm/cloudlet scheduling policy. I think what you need is SpaceSharedPolicy for both vm/cloudlet scheduler.Butt not sure.

但是根据您的要求“cloudlet_2应该在cloudlet_1之后启动”,您需要更改vm / cloudlet调度策略。我认为你需要的是用于vm / cloudlet调度程序的SpaceSharedPolicy。但是不确定。

There are 4 cases for applying different scheduling policy, you can refer Figure No 4 of this.

应用不同的调度策略有4种情况,您可以参考图4。

And about how to change these schedulers in code, you can refer examples which is already there in Cloudsim package.

关于如何在代码中更改这些调度程序,您可以参考Cloudsim包中已有的示例。

For instance, if you want to change VM scheduler ,you can change parameter [VmSchedulerTimeShared or VmSchedulerSpaceShared] at line no 188 of above example and for changing cloudlet scheduler you can change parameter [CloudletSchedulerTimeShared() or CloudletSchedulerSpaceShared() ] at line no 104 of above example.

例如,如果要更改VM调度程序,可以在上面的示例第188行更改参数[VmSchedulerTimeShared或VmSchedulerSpaceShared],并且可以更改cloudlet调度程序,在第104行更改参数[CloudletSchedulerTimeShared()或CloudletSchedulerSpaceShared()]上面的例子。


分享到: