KuMo
Documentation for KuMo.
KuMo.AbstractAlgorithmKuMo.AbstractJobKuMo.AbstractRequestKuMo.AbstractResourceKuMo.AdditiveNodeKuMo.ConvexLinkKuMo.DataKuMo.DirectedTopologyKuMo.EqualLoadBalancingNodeKuMo.FlatLinkKuMo.FlatNodeKuMo.FreeLinkKuMo.IdleStateNodeKuMo.JobKuMo.LinkKuMo.MultiplicativeNodeKuMo.NodeKuMo.PremiumNodeKuMo.ShortestPathKuMo.SnapShotKuMo.StateKuMo.TopologyKuMo.UserKuMo.add_load!KuMo.capacityKuMo.cleanKuMo.cond_minmaxKuMo.dataKuMo.execution_resultsKuMo.execution_resultsKuMo.graphKuMo.init_executionKuMo.init_executionKuMo.inner_queueKuMo.insert_sorted!KuMo.jobKuMo.job_distributionsKuMo.make_dfKuMo.marksKuMo.paramKuMo.pseudo_costKuMo.pseudo_costKuMo.push_snap!KuMo.rand_jobKuMo.rem_load!KuMo.retrieve_pathKuMo.userKuMo.valid_loadKuMo.vtx
KuMo.AbstractAlgorithm — TypeAbstractAlgorithmAn abstract supertype for algorithms.
KuMo.AbstractJob — TypeAbstractJobAn abstract supertype for jobs.
KuMo.AbstractRequest — TypeAbstractRequestsAn abstract supertype for job requests.
KuMo.AbstractResource — TypeAbstractResourceAn abstract supertype for resources in a cloud morphing architecture. Any type MyResource <: AbstractResource needs to either:
- have a field
capacity::TwhereT <: Number, - implement a
capacity(r::MyResource)method.
Optionally, one can implement a specific pseudo_cost(r::MyResource, charge) method.
KuMo.AdditiveNode — TypeAdditiveNode{T1 <: Number, T2 <: Number} <: AbstractNodeA node structure where the default pseudo-cost is translated by the value in the param field.
KuMo.ConvexLink — TypeConvexLink <: KuMo.AbstractLinkLink structure with a convex pseudo-cost function.
KuMo.Data — TypeDataStructure to store the information related to some Data. Currently, only the location of such data is stored.
KuMo.DirectedTopology — TypeDirectedTopology{N<:AbstractNode,L<:AbstractLink}A structure to store the topology of a network. Beside the graph structure itself, it also stores the kinds of all nodes and links.
KuMo.EqualLoadBalancingNode — TypeEqualLoadBalancingNode{T <: Number} <: AbstractNodeNode structure with an equal load balancing (monotonic) pseudo-cost function.
KuMo.FlatLink — TypeFlatLink <: KuMo.AbstractLinkLink structure with a constant pseudo-cost function.
KuMo.FlatNode — TypeFlatNode{T <: Number} <: AbstractNodeNode structure with a constant pseudo-cost function.
KuMo.FreeLink — TypeFreeLink <: AbstractLinkThe pseudo-cost of such links is always zero.
KuMo.IdleStateNode — TypeIdleStateNode{T1 <: Number, T2 <: Number} <: AbstractNodeNode structure that stays iddle until a bigger system load than the default node. The param field is used to set the activation threshold.
KuMo.Job — TypeJob <: AbstractJobThe most generic job type.
Arguments:
backend::Int: size of the backend data to be sent from data location to the servercontainers::Int: number of containers required to execute the jobduration::Float64: job durationfrontend::Int: size of the frontend data to be sent from the user location to the server
KuMo.Link — TypeLink{T <: Number} <: AbstractLinkDefault link structure with an equal load balancing (monotonic) pseudo-cost function.
KuMo.MultiplicativeNode — TypeMultiplicativeNode{T1 <: Number, T2 <: Number} <: AbstractNodeA node structure where the default pseudo-cost is multiplied by the value in the param field.
KuMo.Node — TypeNode{T <: Number} <: AbstractNodeDefault node structure, defined by its maximal capacity and the default convex pseudo-cost function.
KuMo.PremiumNode — TypePremiumNode{T1 <: Number, T2 <: Number} <: AbstractNodeA node structure for premium resources. The param field set the premium threshold.
KuMo.ShortestPath — TypeShortestPath <: AbstractAlgorithmA ShortestPath algorithm.
KuMo.SnapShot — TypeSnapShotA structure to take snapshot from the state of network and its resources at a specific instant.
Arguments:
state::State: state atinstanttotal::Float64: total load atinstantselected::Int: selected node atinstant; value is zero if load is removedduration::Float64: duration of all the actions taken during corresponding to the state of this snapsolving_time::Float64: time taken specifically by the solving algorithm (<: AbstractAlgorithm)instant::Float64
KuMo.State — TypeStateA structure to store the state of the different resources, e.g. nodes and links, during a simulation.
Arguments:
links::SparseMatrixCSC{Float64, Int64}: sparse matrice with the links loadsnodes::SparseVector{Float64, Int64}: sparse vector with the nodes loadsState(n): inner constructor given the number of nodesnState(links, nodes): inner constructor given thelinksandnodesof an existing state
KuMo.Topology — TypeTopology{N<:AbstractNode,L<:AbstractLink}A structure to store the topology of a network. Beside the graph structure itself, it also stores the kinds of all nodes and links.
KuMo.User — TypeUser{R<:AbstractRequests}A structure to store a user information. A user is defined as a location (node id).
KuMo.add_load! — Methodadd_load!(state, links, containers, v, n)Adds load to a given state.
Arguments:
statelinks: the load increase to be added on linkscontainers: the containers load to be added tovv: node selected to execute a taskn: amount of available nodes
KuMo.capacity — Methodcapacity(r::R) where {R<:AbstractResource}Return the capacity of a resource r.
KuMo.clean — Methodclean(snaps)Clean the snapshots by merging snaps occurring at the same time.
KuMo.cond_minmax — Methodcond_minmax(x, y, b)Return the min of x and y if b is false, and the max of x and y otherwise.
KuMo.data — Methoddata(location)Construct data at location. If the location is a collection, a random location is chosen.
KuMo.execution_results — Methodpost_simulate(s, snapshots, verbose, output)Post-simulation process that covers cleaning the snapshots and producing an output.
Arguments:
s: simulated scenariosnapshots: resulting snapshots (before cleaning)verbose: if set to true, prints information about the output and the snapshotsoutput: output path
KuMo.execution_results — Methodpost_simulate(s, snapshots, verbose, output)Post-simulation process that covers cleaning the snapshots and producing an output.
Arguments:
s: simulated scenariosnapshots: resulting snapshots (before cleaning)verbose: if set to true, prints information about the output and the snapshotsoutput: output path
KuMo.graph — Methodgraph(topo::Topology, algorithm::AbstractAlgorithm)Creates an appropriate digraph using Graph.jl based on a topology and the requirement of an algorithm.
KuMo.init_execution — Methodinit_execution(::BatchSimulation)Initialize a synchronous batch simulation.
KuMo.init_execution — Methodinit_execution(::InteractiveRun)Initialize an interactive run.
KuMo.inner_queue — Functioninner_queue(g, u, j, nodes, capacities, state, ::ShortestPath, ii = 0; lck = ReentrantLock(), demands = nothing, links)DOCSTRING
Arguments:
g: a graph representing the topology of the networku: user locationj: requested jobnodes: nodes capacitiescapacities: links capacitiesstate: current state of the networkalgo:ShortestPath <: AbstractAlgorithmii: a counter to measure the progress in the simulationlck: a lck for asynchronous simulationdemands: not needed forShortestPathalgorithmlinks: description of the links topology
KuMo.insert_sorted! — Functioninsert_sorted!(w, val, it = iterate(w))Insert element in a sorted collection.
Arguments:
w: sorted collectionval: value to be insertedit: optional iterator
KuMo.job — Methodjob(backend::Int, containers::Int, data_location::Int, duration::Float64, frontend::Int)Method to create new jobs.
KuMo.job_distributions — Methodjob_distributions(; backend, container, data_locations, duration, frontend)Construct a dictionary with random distributions to generate new jobs. Beside data_locations, the other arguments should be a 2-tuple defining normal distributions as in the Distributions.jl package.
Arguments:
backendcontainerdata_locations: a collection/range of possible data locationdurationfrontend
KuMo.make_df — Methodmake_df(snapshots::Vector{SnapShot}, topo; verbose = true)Make a DataFrame from the raw snapshots.
Arguments:
snapshots: A collection of snapshotstopo: topology of the networkverbose: if set to true, it will print a description of the snapshots in the terminal
KuMo.marks — Methodmarks(df::DataFrame)Returns a 4-tuple (a, b, c, d) that marks the start and end of the nodes and links columns in the dataframe.
(a, b)mark the start and end indices of thenodescolumns(c, d)mark the start and end indices of thelinkscolumns
KuMo.param — Methodparam(r::R) where {R<:AbstractResource}Default accessor for an optional parameter for R. If no param field exists, returns nothing.
KuMo.pseudo_cost — Functionpseudo_cost(cap, charge, resource, param...)
pseudo_cost(r::<:AbstractResource, charge)Methods to compute the pseudo-cost of various resources.
KuMo.pseudo_cost — Methodpseudo_cost(r::R, charge) where {R<:AbstractResource}Compute the pseudo-cost of r given its charge.
KuMo.push_snap! — Methodpush_snap!(snapshots, state, total, selected, duration, solving_time, instant, n)Add a snapshot to an existing collection of snapshots.
Arguments:
snapshots: collection of snapshotsstate: current statetotal: loadselected: node where a request is executedduration: duration of the whole resource allocation for the requestsolving_time: time taken specifically by the solving algorithm (<: AbstractAlgorithm)instant: instant when the request is receivedn: number of available nodes
KuMo.rand_job — Methodrand_job(jd::Dict)Create a random job given a job_distribution dictionary.
KuMo.rem_load! — Methodrem_load!(state, links, containers, v, n)Removes load from a given state.
Arguments:
statelinks: the load increase to be removed from linkscontainers: the containers load to be removed fromvv: node where a task is endindn: amount of available nodes
KuMo.retrieve_path — Methodretrieve_path(u, v, paths)Retrieves the path from u to v.
Arguments:
u: source vertexv: target vertexpaths: list of shortest paths within a network
KuMo.user — Methoduser(location)Construct a user at location. If the location is a collection, a random location is chosen.
KuMo.valid_load — Functionvalid_load(s, task, g, capacities, state, algo, demands, ii = 0)Compute the best load allocation and return if it is a valid one.
Arguments:
s: scenario being simulatedtask: task being requestedg: graph of the network topologycapacities: capacities of the networkstate: current state of resourcesalgo: algo used for computing the best allocation costdemands: if algo isKuMoFlowExt.MinCostFlow, demands are requiredii: a counter to measure the approximative progress of the simulation
KuMo.vtx — Methodvtx(algorithm::AbstractAlgorithm)Return the number of additional vertices required by the algorithm used to allocate resources in the network.