Skip to content

Semantics of 'original_message' and 'original_to' arguments to 'send' method. #24

Description

@shalakhansidmul

DistAlgo version: 1.1.0b13
The use of 'original_message' and 'original_to' as arguments to the 'send' method must add value of 'original_message' and 'original_to' to the sent message sequence.
However, it does not support this behavior.
For example, ping.da is modified to illustrate this issue:

import sys
class Pong(process):
    def setup(total_pings:int): pass

    def run():
        await(total_pings == 0)

    def receive(msg=('Ping',), from_=p):
        output("Pinged")
        send(('Pong',), to=p)
        total_pings -= 1

class Ping(process):
    def setup(p:Pong, nrounds:int): pass

    def run():
        for i in range(nrounds):
            clk = logical_clock()
            send(('Ping',), to=p,  original_message=('Test',), original_to=self)
            await(some(received(('Pong',), clk=rclk), has=(rclk > clk)))
            output('Checking whether sent sequence contains original_message:')
            output(some(sent(('Test',)), has = True))

    def receive(msg=('Pong',)):
        output("Ponged.")

    def receive(msg=('Test',)):
        output('Received test')

def main():
    nrounds = int(sys.argv[1]) if len(sys.argv) > 1 else 3
    npings = int(sys.argv[2]) if len(sys.argv) > 2 else 3
    config(clock='Lamport')
    pong = new(Pong, [npings], num= 1)
    ping = new(Ping, num= 1)
    setup(ping, (pong, nrounds))
    start(pong)
    start(ping)

Output:

The above program must report "Checking if Test is sent: True" but it reports report "Checking if Test is sent: False"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions