Add abc-model documentation

This commit is contained in:
Anton Reinhard 2023-08-28 14:13:04 +02:00
parent 7110007817
commit e07ade47ad
2 changed files with 123 additions and 8 deletions

View File

@ -1,21 +1,102 @@
# define compute_efforts tasks computation
# put some "random" numbers here for now
"""
compute_effort(t::ComputeTaskS1)
Return the compute effort of an S1 task.
"""
compute_effort(t::ComputeTaskS1) = 10
"""
compute_effort(t::ComputeTaskS2)
Return the compute effort of an S2 task.
"""
compute_effort(t::ComputeTaskS2) = 10
"""
compute_effort(t::ComputeTaskU)
Return the compute effort of a U task.
"""
compute_effort(t::ComputeTaskU) = 6
"""
compute_effort(t::ComputeTaskV)
Return the compute effort of a V task.
"""
compute_effort(t::ComputeTaskV) = 20
"""
compute_effort(t::ComputeTaskP)
Return the compute effort of a P task.
"""
compute_effort(t::ComputeTaskP) = 15
"""
compute_effort(t::ComputeTaskSum)
Return the compute effort of a Sum task.
Note: This is a constant compute effort, even though sum scales with the number of its inputs. Since there is only ever a single sum node in a graph generated from the ABC-Model,
this doesn't matter.
"""
compute_effort(t::ComputeTaskSum) = 1
"""
show(io::IO, t::DataTask)
Print the data task to io.
"""
function show(io::IO, t::DataTask)
return print(io, "Data", t.data)
end
"""
show(io::IO, t::ComputeTaskS1)
Print the S1 task to io.
"""
show(io::IO, t::ComputeTaskS1) = print("ComputeS1")
"""
show(io::IO, t::ComputeTaskS2)
Print the S2 task to io.
"""
show(io::IO, t::ComputeTaskS2) = print("ComputeS2")
"""
show(io::IO, t::ComputeTaskP)
Print the P task to io.
"""
show(io::IO, t::ComputeTaskP) = print("ComputeP")
"""
show(io::IO, t::ComputeTaskU)
Print the U task to io.
"""
show(io::IO, t::ComputeTaskU) = print("ComputeU")
"""
show(io::IO, t::ComputeTaskV)
Print the V task to io.
"""
show(io::IO, t::ComputeTaskV) = print("ComputeV")
"""
show(io::IO, t::ComputeTaskSum)
Print the sum task to io.
"""
show(io::IO, t::ComputeTaskSum) = print("ComputeSum")
"""
copy(t::DataTask)
Copy the data task and return it.
"""
copy(t::DataTask) = DataTask(t.data)

View File

@ -1,25 +1,59 @@
"""
DataTask <: AbstractDataTask
Task representing a specific data transfer in the ABC Model.
"""
struct DataTask <: AbstractDataTask
data::UInt64
end
# S task with 1 child
"""
ComputeTaskS1 <: AbstractComputeTask
S task with a single child.
"""
struct ComputeTaskS1 <: AbstractComputeTask end
# S task with 2 children
"""
ComputeTaskS2 <: AbstractComputeTask
S task with two children.
"""
struct ComputeTaskS2 <: AbstractComputeTask end
# P task with 0 children
"""
ComputeTaskP <: AbstractComputeTask
P task with no children.
"""
struct ComputeTaskP <: AbstractComputeTask end
# v task with 2 children
"""
ComputeTaskV <: AbstractComputeTask
v task with two children.
"""
struct ComputeTaskV <: AbstractComputeTask end
# u task with 1 child
"""
ComputeTaskU <: AbstractComputeTask
u task with a single child.
"""
struct ComputeTaskU <: AbstractComputeTask end
# task that sums all its inputs, n children
"""
ComputeTaskSum <: AbstractComputeTask
Task that sums all its inputs, n children.
"""
struct ComputeTaskSum <: AbstractComputeTask end
"""
ABC_TASKS
Constant vector of all tasks of the ABC-Model.
"""
ABC_TASKS = [
DataTask,
ComputeTaskS1,