Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

import org.cloudsimplus.cloudlets.CloudletSimple;
import org.cloudsimplus.hosts.HostSimple;
import org.cloudsimplus.resources.PeSimple;
import org.cloudsimplus.resources.CoreCapacity;
import org.cloudsimplus.vms.VmSimple;

import java.lang.management.ManagementFactory;
Expand Down Expand Up @@ -79,15 +79,15 @@ public final class MemoryFootprintBenchmark {
private static final int GC_CALLS = 3;

private static final double VM_MIPS = 1000;
private static final long VM_PES = 1;
private static final long VM_CORES = 1;

private static final double PE_MIPS = 1000;
private static final double HOST_CORE_MIPS = 1000;
private static final long HOST_RAM = 4096;
private static final long HOST_BW = 10_000;
private static final long HOST_STORAGE = 100_000;

private static final long CLOUDLET_LENGTH = 10_000;
private static final int CLOUDLET_PES = 1;
private static final int CLOUDLET_CORES = 1;

private static final MemoryMXBean MEMORY = ManagementFactory.getMemoryMXBean();

Expand All @@ -107,18 +107,18 @@ public static void main(final String[] args) {
}

private static VmSimple newVm(final int index) {
return new VmSimple(VM_MIPS, VM_PES);
return new VmSimple(new CoreCapacity(VM_CORES, VM_MIPS));
}

/// Creates a Host with a single PE.
/// The PE is included in the measured size, but it's the same before and after the change.
/// Creates a Host with a single CPU core.
/// The Host Processor is included in the measured size.
private static HostSimple newHost(final int index) {
return new HostSimple(HOST_RAM, HOST_BW, HOST_STORAGE, List.of(new PeSimple(PE_MIPS)));
return new HostSimple(HOST_RAM, HOST_BW, HOST_STORAGE, new CoreCapacity(HOST_CORE_MIPS));
}

/// Creates a Cloudlet with the default utilization models.
private static CloudletSimple newCloudlet(final int index) {
return new CloudletSimple(CLOUDLET_LENGTH, CLOUDLET_PES);
return new CloudletSimple(CLOUDLET_LENGTH, CLOUDLET_CORES);
}

/// {@return the median heap (in bytes) retained by each object created by a given function}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
import org.cloudsimplus.datacenters.DatacenterSimple;
import org.cloudsimplus.hosts.Host;
import org.cloudsimplus.hosts.HostSimple;
import org.cloudsimplus.resources.Pe;
import org.cloudsimplus.resources.PeSimple;
import org.cloudsimplus.resources.CoreCapacity;
import org.cloudsimplus.util.Log;
import org.cloudsimplus.util.TimeUtil;
import org.cloudsimplus.utilizationmodels.UtilizationModelDynamic;
Expand All @@ -60,13 +59,13 @@ public class SimulationTimeBenchmark {
public static final int SIMULATIONS = 4;
public static final int HOSTS_INCREMENT = 100;
public static final int INITIAL_HOSTS_NUMBER = 100;
private static final int HOST_PES = 64;
private static final int HOST_CORES = 64;

private static final int VM_PES = 1;
private static final int VM_CORES = 1;
/// Value used to multiply the number of VMs to get the number of Cloudlets.
private static final int VMS_MULTIPLIER = 55;

private static final int CLOUDLET_PES = 1;
private static final int CLOUDLET_CORES = 1;
private static final int CLOUDLET_LENGTH = 1000;

private final int hostsNumber;
Expand Down Expand Up @@ -139,30 +138,25 @@ private Datacenter createDatacenter() {
}

private Host createHost() {
final List<Pe> peList = new ArrayList<>(HOST_PES);
//List of Host's CPUs (Processing Elements, PEs)
for (int i = 0; i < HOST_PES; i++) {
//Uses a PeProvisionerSimple by default to provision PEs for VMs
peList.add(new PeSimple(1000));
}
final var cpuCapacity = new CoreCapacity(HOST_CORES, 1000);

final long ram = 4096*HOST_PES; //in Megabytes
final long bw = 100000*HOST_PES; //in Megabits/s
final long storage = 1000000*HOST_PES; //in Megabytes
final long ram = 4096*HOST_CORES; //in Megabytes
final long bw = 100000*HOST_CORES; //in Megabits/s
final long storage = 1000000*HOST_CORES; //in Megabytes

/*
Uses ResourceProvisionerSimple by default for RAM and BW provisioning
and VmSchedulerSpaceShared for VM scheduling.
*/
return new HostSimple(ram, bw, storage, peList);
return new HostSimple(ram, bw, storage, cpuCapacity);
}

/// Creates a list of VMs.
private List<Vm> createVms() {
final List<Vm> list = new ArrayList<>(vmsNumber);
for (int i = 0; i < vmsNumber; i++) {
//Uses a CloudletSchedulerTimeShared by default to schedule Cloudlets
final Vm vm = new VmSimple(1000, VM_PES);
final Vm vm = new VmSimple(new CoreCapacity(VM_CORES, 1000));
vm.setRam(512).setBw(1000).setSize(10000);
list.add(vm);
}
Expand All @@ -178,7 +172,7 @@ private List<Cloudlet> createCloudlets() {
final UtilizationModelDynamic utilizationModel = new UtilizationModelDynamic(0.5);

for (int i = 0; i < cloudletsNumber; i++) {
final Cloudlet cloudlet = new CloudletSimple(CLOUDLET_LENGTH, CLOUDLET_PES, utilizationModel);
final Cloudlet cloudlet = new CloudletSimple(CLOUDLET_LENGTH, CLOUDLET_CORES, utilizationModel);
cloudlet.setSizes(1024);
list.add(cloudlet);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

import org.cloudsimplus.cloudlets.CloudletSimple;
import org.cloudsimplus.distributions.UniformDistr;
import org.cloudsimplus.resources.CoreCapacity;
import org.cloudsimplus.utilizationmodels.UtilizationModel;
import org.cloudsimplus.vms.VmSimple;
import org.openjdk.jmh.annotations.*;
Expand Down Expand Up @@ -62,7 +63,7 @@ private CloudletToVmMappingSolution createInstance() {
IntStream.range(0, 100).forEach(i
-> result.bindCloudletToVm(
new CloudletSimple(i, 1, 1).setUtilizationModel(um),
new VmSimple(i, 1000, 1))
new VmSimple(i, new CoreCapacity(1, 1000)))
);

return result;
Expand Down
Loading