Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
shalakhansidmul opened this issue Oct 9, 2018 · 0 comments

Comments

@shalakhansidmul
Copy link

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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant