cloudsim icon indicating copy to clipboard operation
cloudsim copied to clipboard

The simulation with energy consumption awareness failed

Open zijie1024 opened this issue 6 months ago • 10 comments

I'm running an energy-aware simulation as follows, but the console shows that the Datacenter, Host, and Vm all failed to be created. I can provide the full code if needed.

new PowerHost(
          i,
          new RamProvisionerSimple(HOST_RAM),
          new BwProvisionerSimple(HOST_BW),
          HOST_STORAGE,
          peList,
          new VmSchedulerTimeShared(peList),
          new PowerModelLinear(HOST_MAX_POWER, HOST_STATIC_POWER_PERCENT)
)
new PowerDatacenter(
        name,
        datacenterCharacteristics,
        new VmAllocationPolicySimple(hostList),
        new LinkedList<>(),
        Constants.SCHEDULING_INTERVAL
);
new DatacenterBroker(name)
new PowerVm(
          i,
          userId,
          VM_MIPS,
          VM_PE_NUM,
          VM_RAM,
          VM_BW,
          VM_SIZE,
          1,
          VM_VMM,
          new CloudletSchedulerTimeShared(),
          Constants.SCHEDULING_INTERVAL
)
Image

Additionally, I found that some CloudSim documents mention PowerHostUtilizationHistory and PowerDatacenterBroker, but these classes don't exist in the latest code.

Image Image

zijie1024 avatar Aug 09 '25 12:08 zijie1024

The simulation without energy awareness was successful, with all parameters (such as the number of Hosts, MIPS, etc.) remaining unchanged.

zijie1024 avatar Aug 09 '25 12:08 zijie1024

I found that PowerHostUtilizationHistory and PowerDatacenterBroker exist in the jdk17-lts branch but not in the master branch. If I need to perform an energy-aware simulation, how should I create components like Datacenter and Host?

zijie1024 avatar Aug 09 '25 12:08 zijie1024

@zijie1024 PowerDatacenterBroker was removed in commit 199206ed; PowerHostUtilizationHistory was removed in commit a5e66a6e. You can have a look at the deleted source code and see if any of that can be useful for you, but I doubt that's the issue (I should have merge all the relevant code in the remaining components, but please double-check).

deRemo avatar Aug 09 '25 13:08 deRemo

I suggest you to use a powerful IDE like IntelliJ, set a couple of breakpoints in the VM allocation stage, and follow the execution step-by-step using Debug mode

deRemo avatar Aug 09 '25 13:08 deRemo

@zijie1024 if you are interested in contributing to the codebase, I'd leave this issue open. Feel free to ask for assistance, but please provide evidence that you have been working on it (I don't have time myself)

deRemo avatar Aug 10 '25 10:08 deRemo

I would be happy to contribute to the code repository.

@zijie1024 if you are interested in contributing to the codebase, I'd leave this issue open. Feel free to ask for assistance, but please provide evidence that you have been working on it (I don't have time myself)如果你有兴趣为代码库做贡献,我建议你保留这个问题。欢迎随时寻求帮助,但请提供你一直在处理此事的证据(我自己没时间)。

zijie1024 avatar Aug 10 '25 10:08 zijie1024

@deRemo I was running the official 'IqrMmt' example and added a print statement within RunnerAbstract to observe the final state of the cloudlets after the simulation completes. This print statement is executed once the simulation is over.

However, I've noticed that the cloudlets are not in the expected SUCCESS state. Instead, they appear to be stuck in the INEXEC (in execution) state, even though the simulation has finished. Consequently, when I call getCloudletReceivedList(), it returns an empty list.

The other official examples under the power package also have a similar situation.

My understanding is that all submitted cloudlets should have completed and be marked as SUCCESS by the end of the simulation. I'm unsure if this behavior is a bug or if I'm misunderstanding something.

Image Image Image Image

zijie1024 avatar Aug 10 '25 10:08 zijie1024

It's most probably a bug

deRemo avatar Aug 10 '25 11:08 deRemo

It's most probably a bug这很可能是一个 bug

@deRemo I ran the examples under the power package in versions 4.0, 5.0, and 7.0 of the master branch, and all of them showed "Received 0 cloudlets". Is this the expected result?

Image Image

zijie1024 avatar Aug 10 '25 12:08 zijie1024

@zijie1024 are you sure you actually compiled the previous version? It is not a very straightforward procedure, since the build process was not standardized before 7G

deRemo avatar Aug 11 '25 21:08 deRemo