summaryrefslogtreecommitdiff
path: root/opendc-compute
diff options
context:
space:
mode:
Diffstat (limited to 'opendc-compute')
-rw-r--r--opendc-compute/opendc-compute-simulator/src/main/java/org/opendc/compute/simulator/service/ComputeService.java17
-rw-r--r--opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/scheduler/ComputeSchedulers.kt9
-rw-r--r--opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/scheduler/MemorizingScheduler.kt6
-rw-r--r--opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/parquet/ComputeExportConfig.kt2
-rw-r--r--opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/parquet/DfltBatteryExportColumns.kt10
-rw-r--r--opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/parquet/DfltHostExportColumns.kt32
-rw-r--r--opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/parquet/DfltPowerSourceExportColumns.kt10
-rw-r--r--opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/parquet/DfltServiceExportColumns.kt25
-rw-r--r--opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/parquet/DfltTaskExportColumns.kt18
-rw-r--r--opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/table/host/HostTableReader.kt2
-rw-r--r--opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/table/host/HostTableReaderImpl.kt12
-rw-r--r--opendc-compute/opendc-compute-topology/src/main/kotlin/org/opendc/compute/topology/TopologyFactories.kt4
-rw-r--r--opendc-compute/opendc-compute-topology/src/main/kotlin/org/opendc/compute/topology/specs/TopologySpecs.kt44
13 files changed, 83 insertions, 108 deletions
diff --git a/opendc-compute/opendc-compute-simulator/src/main/java/org/opendc/compute/simulator/service/ComputeService.java b/opendc-compute/opendc-compute-simulator/src/main/java/org/opendc/compute/simulator/service/ComputeService.java
index 6d973b3f..11394ce9 100644
--- a/opendc-compute/opendc-compute-simulator/src/main/java/org/opendc/compute/simulator/service/ComputeService.java
+++ b/opendc-compute/opendc-compute-simulator/src/main/java/org/opendc/compute/simulator/service/ComputeService.java
@@ -418,7 +418,8 @@ public final class ComputeService implements AutoCloseable, CarbonReceiver {
LOGGER.debug("Enqueueing task {} to be assigned to host", task.getUid());
if (task.getNumFailures() >= maxNumFailures) {
- LOGGER.warn("task {} has been terminated because it failed {} times", task, task.getNumFailures());
+ LOGGER.warn("task {} has been terminated because it failed {} times", (Object) task, (Object)
+ task.getNumFailures());
tasksTerminated++;
task.setState(TaskState.TERMINATED);
@@ -493,20 +494,6 @@ public final class ComputeService implements AutoCloseable, CarbonReceiver {
final ServiceFlavor flavor = task.getFlavor();
- // if (task.getNumFailures() >= maxNumFailures) {
- // LOGGER.warn("task {} has been terminated because it failed {} times", task,
- // task.getNumFailures());
- //
- // taskQueue.remove(req);
- // tasksPending--;
- // tasksTerminated++;
- // task.setState(TaskState.TERMINATED);
- //
- // scheduler.removeTask(task, hv);
- // this.setTaskToBeRemoved(task);
- // continue;
- // }
-
if (result.getResultType() == SchedulingResultType.FAILURE) {
LOGGER.trace("Task {} selected for scheduling but no capacity available for it at the moment", task);
diff --git a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/scheduler/ComputeSchedulers.kt b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/scheduler/ComputeSchedulers.kt
index 35c66e44..e70cec58 100644
--- a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/scheduler/ComputeSchedulers.kt
+++ b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/scheduler/ComputeSchedulers.kt
@@ -48,7 +48,6 @@ public enum class ComputeSchedulerEnum {
Random,
TaskNumMemorizing,
Timeshift,
- TimeshiftNoPeak,
}
public fun createPrefabComputeScheduler(
@@ -129,13 +128,5 @@ public fun createPrefabComputeScheduler(
clock = clock,
random = SplittableRandom(seeder.nextLong()),
)
- ComputeSchedulerEnum.TimeshiftNoPeak ->
- TimeshiftScheduler(
- filters = listOf(ComputeFilter(), VCpuFilter(cpuAllocationRatio), RamFilter(ramAllocationRatio)),
- weighers = listOf(RamWeigher(multiplier = 1.0)),
- windowSize = 168,
- clock = clock,
- random = SplittableRandom(seeder.nextLong()),
- )
}
}
diff --git a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/scheduler/MemorizingScheduler.kt b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/scheduler/MemorizingScheduler.kt
index 4108ed3d..72d9199f 100644
--- a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/scheduler/MemorizingScheduler.kt
+++ b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/scheduler/MemorizingScheduler.kt
@@ -35,7 +35,7 @@ public class MemorizingScheduler(
private val filters: List<HostFilter>,
private val maxTimesSkipped: Int = 7,
) : ComputeScheduler {
- // We assume that there will be max 200 tasks per host.
+ // We assume that there will be max 100 tasks per host.
// The index of a host list is the number of tasks on that host.
private val hostsQueue = List(100, { mutableListOf<HostView>() })
private var minAvailableHost = 0
@@ -78,6 +78,10 @@ public class MemorizingScheduler(
return SchedulingResult(SchedulingResultType.FAILURE)
}
+// if (minAvailableHost == 1) {
+// return SchedulingResult(SchedulingResultType.EMPTY);
+// }
+
val maxIters = 10000
var numIters = 0
diff --git a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/parquet/ComputeExportConfig.kt b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/parquet/ComputeExportConfig.kt
index 7c753ebf..c7549433 100644
--- a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/parquet/ComputeExportConfig.kt
+++ b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/parquet/ComputeExportConfig.kt
@@ -106,7 +106,7 @@ public data class ComputeExportConfig(
/**
* Config that includes all columns defined in [DfltHostExportColumns], [DfltTaskExportColumns],
- * [DfltPowerSourceExportColumns], [batteryExportColumns], [DfltServiceExportColumns] among all other loaded
+ * [DfltPowerSourceExportColumns], [DfltBatteryExportColumns], [DfltServiceExportColumns] among all other loaded
* columns for [HostTableReader], [TaskTableReader] and [ServiceTableReader].
*/
public val ALL_COLUMNS: ComputeExportConfig by lazy {
diff --git a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/parquet/DfltBatteryExportColumns.kt b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/parquet/DfltBatteryExportColumns.kt
index 594d518c..29e0f899 100644
--- a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/parquet/DfltBatteryExportColumns.kt
+++ b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/parquet/DfltBatteryExportColumns.kt
@@ -57,12 +57,12 @@ public object DfltBatteryExportColumns {
field = Types.required(INT64).named("timestamp_absolute"),
) { it.timestampAbsolute.toEpochMilli() }
- public val NAME: ExportColumn<BatteryTableReader> =
+ public val BATTERY_NAME: ExportColumn<BatteryTableReader> =
ExportColumn(
field =
Types.required(BINARY)
.`as`(LogicalTypeAnnotation.stringType())
- .named("name"),
+ .named("battery_name"),
) { Binary.fromString(it.batteryInfo.name) }
public val CLUSTER_NAME: ExportColumn<BatteryTableReader> =
@@ -111,9 +111,9 @@ public object DfltBatteryExportColumns {
*/
internal val BASE_EXPORT_COLUMNS =
setOf(
- TIMESTAMP_ABS,
- TIMESTAMP,
- NAME,
+ BATTERY_NAME,
CLUSTER_NAME,
+ TIMESTAMP,
+ TIMESTAMP_ABS,
)
}
diff --git a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/parquet/DfltHostExportColumns.kt b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/parquet/DfltHostExportColumns.kt
index a691bc45..00f7854d 100644
--- a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/parquet/DfltHostExportColumns.kt
+++ b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/parquet/DfltHostExportColumns.kt
@@ -58,12 +58,12 @@ public object DfltHostExportColumns {
field = Types.required(INT64).named("timestamp_absolute"),
) { it.timestampAbsolute.toEpochMilli() }
- public val NAME: ExportColumn<HostTableReader> =
+ public val HOST_NAME: ExportColumn<HostTableReader> =
ExportColumn(
field =
Types.required(BINARY)
.`as`(LogicalTypeAnnotation.stringType())
- .named("name"),
+ .named("host_name"),
) { Binary.fromString(it.hostInfo.name) }
public val CLUSTER_NAME: ExportColumn<HostTableReader> =
@@ -84,30 +84,30 @@ public object DfltHostExportColumns {
field = Types.required(INT64).named("mem_capacity"),
) { it.hostInfo.memCapacity }
- public val GUESTS_TERMINATED: ExportColumn<HostTableReader> =
+ public val TASKS_TERMINATED: ExportColumn<HostTableReader> =
ExportColumn(
- field = Types.required(INT32).named("guests_terminated"),
+ field = Types.required(INT32).named("tasks_terminated"),
) { it.tasksTerminated }
- public val GUESTS_RUNNING: ExportColumn<HostTableReader> =
+ public val TASKS_RUNNING: ExportColumn<HostTableReader> =
ExportColumn(
- field = Types.required(INT32).named("guests_running"),
+ field = Types.required(INT32).named("tasks_running"),
) { it.tasksActive }
- public val GUESTS_ERROR: ExportColumn<HostTableReader> =
+ public val TASKS_ERROR: ExportColumn<HostTableReader> =
ExportColumn(
- field = Types.required(INT32).named("guests_error"),
+ field = Types.required(INT32).named("tasks_error"),
) { it.guestsError }
- public val GUESTS_INVALID: ExportColumn<HostTableReader> =
+ public val TASKS_INVALID: ExportColumn<HostTableReader> =
ExportColumn(
- field = Types.required(INT32).named("guests_invalid"),
+ field = Types.required(INT32).named("tasks_invalid"),
) { it.guestsInvalid }
- public val CPU_LIMIT: ExportColumn<HostTableReader> =
+ public val CPU_CAPACITY: ExportColumn<HostTableReader> =
ExportColumn(
- field = Types.required(FLOAT).named("cpu_limit"),
- ) { it.cpuLimit }
+ field = Types.required(FLOAT).named("cpu_capacity"),
+ ) { it.cpuCapacity }
public val CPU_USAGE: ExportColumn<HostTableReader> =
ExportColumn(
@@ -179,9 +179,9 @@ public object DfltHostExportColumns {
*/
internal val BASE_EXPORT_COLUMNS =
setOf(
- TIMESTAMP_ABS,
- TIMESTAMP,
- NAME,
+ HOST_NAME,
CLUSTER_NAME,
+ TIMESTAMP,
+ TIMESTAMP_ABS,
)
}
diff --git a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/parquet/DfltPowerSourceExportColumns.kt b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/parquet/DfltPowerSourceExportColumns.kt
index 192667b9..e221a41a 100644
--- a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/parquet/DfltPowerSourceExportColumns.kt
+++ b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/parquet/DfltPowerSourceExportColumns.kt
@@ -57,12 +57,12 @@ public object DfltPowerSourceExportColumns {
field = Types.required(INT64).named("timestamp_absolute"),
) { it.timestampAbsolute.toEpochMilli() }
- public val NAME: ExportColumn<PowerSourceTableReader> =
+ public val SOURCE_NAME: ExportColumn<PowerSourceTableReader> =
ExportColumn(
field =
Types.required(BINARY)
.`as`(LogicalTypeAnnotation.stringType())
- .named("name"),
+ .named("source_name"),
) { Binary.fromString(it.powerSourceInfo.name) }
public val CLUSTER_NAME: ExportColumn<PowerSourceTableReader> =
@@ -98,9 +98,9 @@ public object DfltPowerSourceExportColumns {
*/
internal val BASE_EXPORT_COLUMNS =
setOf(
- TIMESTAMP_ABS,
- TIMESTAMP,
- NAME,
+ SOURCE_NAME,
CLUSTER_NAME,
+ TIMESTAMP,
+ TIMESTAMP_ABS,
)
}
diff --git a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/parquet/DfltServiceExportColumns.kt b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/parquet/DfltServiceExportColumns.kt
index 374b2d31..5f3dccf4 100644
--- a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/parquet/DfltServiceExportColumns.kt
+++ b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/parquet/DfltServiceExportColumns.kt
@@ -59,16 +59,21 @@ public object DfltServiceExportColumns {
field = Types.required(INT32).named("hosts_up"),
) { it.hostsUp }
- public val TASKS_PENDING: ExportColumn<ServiceTableReader> =
+ public val HOSTS_DOWN: ExportColumn<ServiceTableReader> =
ExportColumn(
- field = Types.required(INT32).named("tasks_pending"),
- ) { it.tasksPending }
+ field = Types.required(INT32).named("hosts_down"),
+ ) { it.hostsDown }
public val TASKS_TOTAL: ExportColumn<ServiceTableReader> =
ExportColumn(
field = Types.required(INT32).named("tasks_total"),
) { it.tasksTotal }
+ public val TASKS_PENDING: ExportColumn<ServiceTableReader> =
+ ExportColumn(
+ field = Types.required(INT32).named("tasks_pending"),
+ ) { it.tasksPending }
+
public val TASKS_ACTIVE: ExportColumn<ServiceTableReader> =
ExportColumn(
field = Types.required(INT32).named("tasks_active"),
@@ -79,27 +84,17 @@ public object DfltServiceExportColumns {
field = Types.required(INT32).named("tasks_completed"),
) { it.tasksCompleted }
- public val TASKS_FAILED: ExportColumn<ServiceTableReader> =
+ public val TASKS_TERMINATED: ExportColumn<ServiceTableReader> =
ExportColumn(
field = Types.required(INT32).named("tasks_terminated"),
) { it.tasksTerminated }
- public val ATTEMPTS_SUCCESS: ExportColumn<ServiceTableReader> =
- ExportColumn(
- field = Types.required(INT32).named("attempts_success"),
- ) { it.attemptsSuccess }
-
- public val ATTEMPTS_FAILURE: ExportColumn<ServiceTableReader> =
- ExportColumn(
- field = Types.required(INT32).named("attempts_failure"),
- ) { it.attemptsFailure }
-
/**
* The columns that are always included in the output file.
*/
internal val BASE_EXPORT_COLUMNS =
setOf(
- TIMESTAMP_ABS,
TIMESTAMP,
+ TIMESTAMP_ABS,
)
}
diff --git a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/parquet/DfltTaskExportColumns.kt b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/parquet/DfltTaskExportColumns.kt
index 6f6b5bdd..5c3ef3bf 100644
--- a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/parquet/DfltTaskExportColumns.kt
+++ b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/parquet/DfltTaskExportColumns.kt
@@ -74,16 +74,24 @@ public object DfltTaskExportColumns {
.named("task_name"),
) { Binary.fromString(it.taskInfo.name) }
- public val CPU_COUNT: ExportColumn<TaskTableReader> =
+ public val HOST_NAME: ExportColumn<TaskTableReader> =
ExportColumn(
- field = Types.required(INT32).named("cpu_count"),
- ) { it.taskInfo.cpuCount }
+ field =
+ Types.required(BINARY)
+ .`as`(LogicalTypeAnnotation.stringType())
+ .named("host_name"),
+ ) { Binary.fromString(it.host?.name) }
public val MEM_CAPACITY: ExportColumn<TaskTableReader> =
ExportColumn(
field = Types.required(INT64).named("mem_capacity"),
) { it.taskInfo.memCapacity }
+ public val CPU_COUNT: ExportColumn<TaskTableReader> =
+ ExportColumn(
+ field = Types.required(INT32).named("cpu_count"),
+ ) { it.taskInfo.cpuCount }
+
public val CPU_LIMIT: ExportColumn<TaskTableReader> =
ExportColumn(
field = Types.required(FLOAT).named("cpu_limit"),
@@ -167,9 +175,9 @@ public object DfltTaskExportColumns {
*/
internal val BASE_EXPORT_COLUMNS =
setOf(
- TIMESTAMP_ABS,
- TIMESTAMP,
TASK_ID,
TASK_NAME,
+ TIMESTAMP,
+ TIMESTAMP_ABS,
)
}
diff --git a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/table/host/HostTableReader.kt b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/table/host/HostTableReader.kt
index 5cbdcd28..ff0115df 100644
--- a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/table/host/HostTableReader.kt
+++ b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/table/host/HostTableReader.kt
@@ -75,7 +75,7 @@ public interface HostTableReader : Exportable {
/**
* The capacity of the CPUs in the host (in MHz).
*/
- public val cpuLimit: Double
+ public val cpuCapacity: Double
/**
* The usage of all CPUs in the host (in MHz).
diff --git a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/table/host/HostTableReaderImpl.kt b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/table/host/HostTableReaderImpl.kt
index 913e0a17..6e1dac48 100644
--- a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/table/host/HostTableReaderImpl.kt
+++ b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/table/host/HostTableReaderImpl.kt
@@ -49,7 +49,7 @@ public class HostTableReaderImpl(
_tasksActive = table.tasksActive
_guestsError = table.guestsError
_guestsInvalid = table.guestsInvalid
- _cpuLimit = table.cpuLimit
+ _cpuCapacity = table.cpuCapacity
_cpuDemand = table.cpuDemand
_cpuUsage = table.cpuUsage
_cpuUtilization = table.cpuUtilization
@@ -99,9 +99,9 @@ public class HostTableReaderImpl(
get() = _guestsInvalid
private var _guestsInvalid = 0
- override val cpuLimit: Double
- get() = _cpuLimit
- private var _cpuLimit = 0.0
+ override val cpuCapacity: Double
+ get() = _cpuCapacity
+ private var _cpuCapacity = 0.0
override val cpuUsage: Double
get() = _cpuUsage
@@ -176,7 +176,7 @@ public class HostTableReaderImpl(
_tasksActive = hostSysStats.guestsRunning
_guestsError = hostSysStats.guestsError
_guestsInvalid = hostSysStats.guestsInvalid
- _cpuLimit = hostCpuStats.capacity
+ _cpuCapacity = hostCpuStats.capacity
_cpuDemand = hostCpuStats.demand
_cpuUsage = hostCpuStats.usage
_cpuUtilization = hostCpuStats.utilization
@@ -211,7 +211,7 @@ public class HostTableReaderImpl(
_guestsError = 0
_guestsInvalid = 0
- _cpuLimit = 0.0
+ _cpuCapacity = 0.0
_cpuUsage = 0.0
_cpuDemand = 0.0
_cpuUtilization = 0.0
diff --git a/opendc-compute/opendc-compute-topology/src/main/kotlin/org/opendc/compute/topology/TopologyFactories.kt b/opendc-compute/opendc-compute-topology/src/main/kotlin/org/opendc/compute/topology/TopologyFactories.kt
index cc2c4b4e..afc3ee62 100644
--- a/opendc-compute/opendc-compute-topology/src/main/kotlin/org/opendc/compute/topology/TopologyFactories.kt
+++ b/opendc-compute/opendc-compute-topology/src/main/kotlin/org/opendc/compute/topology/TopologyFactories.kt
@@ -129,7 +129,7 @@ private fun ClusterJSONSpec.toClusterSpec(): ClusterSpec {
val powerSourceSpec =
PowerSourceSpec(
createUniqueName(this.powerSource.name, powerSourceNames),
- totalPower = this.powerSource.totalPower,
+ totalPower = this.powerSource.maxPower,
carbonTracePath = this.powerSource.carbonTracePath,
)
@@ -140,8 +140,8 @@ private fun ClusterJSONSpec.toClusterSpec(): ClusterSpec {
createUniqueName(this.battery.name, batteryNames),
this.battery.capacity,
this.battery.chargingSpeed,
- this.battery.batteryPolicy,
this.battery.initialCharge,
+ this.battery.batteryPolicy,
this.battery.embodiedCarbon,
this.battery.expectedLifetime,
)
diff --git a/opendc-compute/opendc-compute-topology/src/main/kotlin/org/opendc/compute/topology/specs/TopologySpecs.kt b/opendc-compute/opendc-compute-topology/src/main/kotlin/org/opendc/compute/topology/specs/TopologySpecs.kt
index 920d8373..f9675b31 100644
--- a/opendc-compute/opendc-compute-topology/src/main/kotlin/org/opendc/compute/topology/specs/TopologySpecs.kt
+++ b/opendc-compute/opendc-compute-topology/src/main/kotlin/org/opendc/compute/topology/specs/TopologySpecs.kt
@@ -44,7 +44,6 @@ import org.opendc.simulator.engine.engine.FlowEngine
@Serializable
public data class TopologySpec(
val clusters: List<ClusterJSONSpec>,
- val schemaVersion: Int = 1,
)
/**
@@ -52,7 +51,6 @@ public data class TopologySpec(
*
* @param name The name of the cluster.
* @param hosts List of the different hosts (nodes) available in this cluster
- * @param location Location of the cluster. This can impact the carbon intensity
*/
@Serializable
public data class ClusterJSONSpec(
@@ -61,7 +59,6 @@ public data class ClusterJSONSpec(
val hosts: List<HostJSONSpec>,
val powerSource: PowerSourceJSONSpec = PowerSourceJSONSpec.DFLT,
val battery: BatteryJSONSpec? = null,
- val location: String = "NL",
)
/**
@@ -77,46 +74,47 @@ public data class ClusterJSONSpec(
public data class HostJSONSpec(
val name: String = "Host",
val cpu: CPUJSONSpec,
+ val count: Int = 1,
val memory: MemoryJSONSpec,
val powerModel: PowerModelSpec = PowerModelSpec.DFLT,
- val count: Int = 1,
)
/**
* Definition of a compute CPU modeled in the simulation.
*
- * @param vendor The vendor of the storage device.
* @param modelName The model name of the device.
+ * @param vendor The vendor of the storage device.
* @param arch The micro-architecture of the processor node.
- * @param coreCount The number of cores in the CPU
- * @param coreSpeed The speed of the cores
+ * @param count The number of CPUs of this type in the host.
+ * @param coreCount The number of cores in the CPU.
+ * @param coreSpeed The speed of the cores.
*/
@Serializable
public data class CPUJSONSpec(
- val vendor: String = "unknown",
val modelName: String = "unknown",
+ val vendor: String = "unknown",
val arch: String = "unknown",
+ val count: Int = 1,
val coreCount: Int,
val coreSpeed: Frequency,
- val count: Int = 1,
)
/**
* Definition of a compute Memory modeled in the simulation.
*
- * @param vendor The vendor of the storage device.
* @param modelName The model name of the device.
+ * @param vendor The vendor of the storage device.
* @param arch The micro-architecture of the processor node.
- * @param memorySpeed The speed of the cores
* @param memorySize The size of the memory Unit
+ * @param memorySpeed The speed of the cores
*/
@Serializable
public data class MemoryJSONSpec(
- val vendor: String = "unknown",
val modelName: String = "unknown",
+ val vendor: String = "unknown",
val arch: String = "unknown",
- val memorySpeed: Frequency = Frequency.ofMHz(-1),
val memorySize: DataSize,
+ val memorySpeed: Frequency = Frequency.ofMHz(-1),
)
@Serializable
@@ -145,25 +143,17 @@ public data class PowerModelSpec(
/**
* Definition of a power source used for JSON input.
*
- * @property vendor
- * @property modelName
- * @property arch
- * @property totalPower
+ * @property maxPower in Watt
*/
@Serializable
public data class PowerSourceJSONSpec(
val name: String = "PowerSource",
- val vendor: String = "unknown",
- val modelName: String = "unknown",
- val arch: String = "unknown",
- val totalPower: Long = Long.MAX_VALUE,
+ val maxPower: Long = Long.MAX_VALUE,
val carbonTracePath: String? = null,
) {
public companion object {
public val DFLT: PowerSourceJSONSpec =
- PowerSourceJSONSpec(
- totalPower = Long.MAX_VALUE,
- )
+ PowerSourceJSONSpec()
}
}
@@ -172,9 +162,9 @@ public data class PowerSourceJSONSpec(
*
* @property name The name of the battery
* @property capacity The capacity of the battery in kWh
- * @property chargingSpeed The charging speed of the battery in J
- * @property batteryPolicy The policy used to decide when the battery charges and discharges
+ * @property chargingSpeed The charging speed of the battery in W
* @property initialCharge The initial charge in the battery
+ * @property batteryPolicy The policy used to decide when the battery charges and discharges
* @property embodiedCarbon The embodied carbon needed to create the battery in gram
* @property expectedLifetime The expected lifetime of the battery in years
*
@@ -184,8 +174,8 @@ public data class BatteryJSONSpec(
val name: String = "Battery",
var capacity: Double,
val chargingSpeed: Double,
- val batteryPolicy: BatteryPolicyJSONSpec,
var initialCharge: Double = 0.0,
+ val batteryPolicy: BatteryPolicyJSONSpec,
var embodiedCarbon: Double = 0.0,
var expectedLifetime: Double = 0.0,
)