Commit 2b56aadc authored by Andreas Schmidt's avatar Andreas Schmidt

Thread-based interpolation.

parent 8de8d37e
This source diff could not be displayed because it is too large. You can view the blob instead.
data_files:
sender: "sender.csv"
receiver: "receiver.csv"
threads:
- app_send
- trans_send
- trans_recv
- app_recv
cycle_reference:
sender:
app_send:
Start: PrrtSendStart
Stop: PrrtSendEnd
trans_send:
Start: PrrtTransmitStart
Stop: LinkTransmitEnd
receiver:
trans_recv:
Start: LinkReceive
Stop: PrrtReturnPackage
app_recv:
Start: PrrtReceivePackage
Stop: PrrtDeliver
time_reference:
......@@ -18,67 +29,90 @@ time_reference:
stamps:
PrrtSendStart:
Source: sender
Thread: app_send
Type: time
PrrtSubmitPackage:
Source: sender
Thread: app_send
Type: cycle
PrrtSendEnd:
Source: sender
Thread: app_send
Type: time
PrrtSubmitPackage:
PrrtTransmitStart:
Source: sender
Thread: trans_send
Type: time
PrrtTransmitEnd:
Source: sender
Thread: trans_send
Type: cycle
PrrtEncodeStart:
Source: sender
Thread: trans_send
Type: cycle
PrrtEncodeEnd:
Source: sender
Type: cycle
PrrtTransmitStart:
Source: sender
Type: cycle
PrrtTransmitEnd:
Source: sender
Thread: trans_send
Type: cycle
LinkTransmitStart:
Source: sender
Thread: trans_send
Type: cycle
LinkTransmitEnd:
Source: sender
Thread: trans_send
Type: time
LinkReceive:
Source: receiver
Type: time
PrrtDeliver:
Source: receiver
Thread: trans_recv
Type: time
SendFeedbackStart:
Source: receiver
Thread: trans_recv
Type: cycle
SendFeedbackEnd:
Source: receiver
Thread: trans_recv
Type: cycle
DecodeStart:
Source: receiver
Thread: trans_recv
Type: cycle
DecodeEnd:
Source: receiver
Thread: trans_recv
Type: cycle
HandlePacketStart:
Source: receiver
Thread: trans_recv
Type: cycle
HandlePacketEnd:
Source: receiver
Thread: trans_recv
Type: cycle
PrrtReturnPackage:
Source: receiver
Thread: trans_recv
Type: time
PrrtDeliver:
Source: receiver
Thread: app_recv
Type: time
CopyOutputStart:
Source: receiver
Thread: app_recv
Type: cycle
CopyOutputEnd:
Source: receiver
Thread: app_recv
Type: cycle
PrrtReturnPackage:
Source: receiver
Type: time
PrrtReceivePackage:
Source: receiver
Thread: app_recv
Type: time
durations:
Send:
......@@ -126,6 +160,7 @@ durations:
Start: DecodeStart
Stop: DecodeEnd
Source: receiver
packet_types:
Data: 0
Redundancy: 1
......@@ -8,6 +8,10 @@ def _stamp_name_by_src_and_type(all_stamps, src, kind=None):
kind = ["time", "cycle"]
return [c for c, v in all_stamps.items() if v["Source"] == src and v["Type"] in kind]
def _stamp_name_by_thread_and_type(all_stamps, thread, kind=None):
if kind is None:
kind = ["time", "cycle"]
return [c for c, v in all_stamps.items() if v["Thread"] == thread and v["Type"] in kind]
def _extract_stamps_by_type(all_stamps, src, kind=None):
columns = _stamp_name_by_src_and_type(all_stamps, src, kind)
......@@ -52,21 +56,20 @@ def evaluate(sender_file, receiver_file, config, kind=0):
for s in _stamp_name_by_src_and_type(stamps, "receiver", kind=["time"]):
df[s + "_T"] -= df["Channel_D"]
for src in ["sender", "receiver"]:
for src in config["threads"]:
# Generate Processing Duration
src_name = src.capitalize()
time, cycles = _diff_t_c(df, tr[src]["Start"], tr[src]["Stop"])
df[src_name + "_D"] = time
df[src_name + "_C"] = cycles
src_name = "".join(map(str.capitalize, src.split("_")))
# Generate Cycle Times
time, cycles = _diff_t_c(df, cr[src]["Start"], cr[src]["Stop"])
# TODO: Introduce check if both are on the same host.
df[src_name + "_D"] = time
df[src_name + "_C"] = cycles
df[src_name + "Cycle_D"] = time / cycles
# Recreate missing timestamps from cycles
for stamp_name in _stamp_name_by_src_and_type(stamps, src, "cycle"):
start_stamp = tr[src]["Start"]
for stamp_name in _stamp_name_by_thread_and_type(stamps, src, "cycle"):
start_stamp = cr[src]["Start"]
diff = df[stamp_name + "_C"] - df[start_stamp + "_C"]
df[stamp_name + "_T"] = (diff * df[src_name + "Cycle_D"] + df[start_stamp + "_T"]).astype(int)
......@@ -74,7 +77,9 @@ def evaluate(sender_file, receiver_file, config, kind=0):
for name, duration in config["durations"].items():
df[name + "_D"] = df[duration["Stop"] + "_T"] - df[duration["Start"] + "_T"]
df["EndToEnd_D"] = df["Sender_D"] + df["Receiver_D"]
df["Sender_D"] = df[tr["sender"]["Stop"] + "_T"] - df[tr["sender"]["Start"] + "_T"]
df["Receiver_D"] = df[tr["receiver"]["Stop"] + "_T"] - df[tr["receiver"]["Start"] + "_T"]
df["EndToEnd_D"] = df[tr["receiver"]["Stop"] + "_T"] - df[tr["sender"]["Start"] + "_T"]
return df
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment