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

visualization of distAlgo #33

Closed
lmarne01 opened this issue Mar 10, 2020 · 2 comments
Closed

visualization of distAlgo #33

lmarne01 opened this issue Mar 10, 2020 · 2 comments

Comments

@lmarne01
Copy link

I am interested in learning about the visualization feature in DistAlgo, which will be very helpful. So I downloaded one of the examples in lamutex folder, which contains this feature and ran it but the message i'm getting is this: Invalid configuration value. . I have also tried using the code on line 4 instead of line 6 and even though it ran, there was no visualization.In addition I have the latest version of distAlgo.


1. def main():
2.     nprocs = int(sys.argv[1]) if len(sys.argv) > 1 else 10
3.     nrequests = int(sys.argv[2]) if len(sys.argv) > 2 else 1
4.     #config(channel is fifo, clock is lamport, visualize is True)
5.     config(channel is fifo,clock is lamport)
6.     config(visualize is {
7.         # colors: override message and process colors, defaults to random
8.         #         supports any valid CSS color value
9.         # https://developer.mozilla.org/en-US/docs/Web/CSS/color_value
10.         # examples: Transparent, Yellow, DarkRed, rgb(255, 255 ,0),
11.         #           rgba(255, 255, 0, 0.1), hsl(210, 100%, 50%)
12.         'colors': {
13.             # processes
14.             'P': 'MediumVioletRed',
15.             # messages
16.             'request': 'PapayaWhip',
17.             'release': 'hsl(210, 100%, 50%)',
18.             'ack': 'rgba(255, 0, 0, 0.1)'
19.         }
20.     })
21. 
22.     ps = new(P, num=nprocs)
23.     for p in ps: setup(p, (ps-{p}, nrequests))
24.     start(ps)
25.     await(each(p in ps, has=received(('done', p))))
26.     send(('done',), to=ps)

@yanhongliu
Copy link
Member

this has been for internal use as we are still studying the best way going forward (so things will definitely change), but since you've found it yourself (i wonder how), you may enjoy some of the joys we have had since last year:

you just have to get the viz branch, and see the config stmt in this example
https://github.com/DistAlgo/distalgo/blob/viz/da/examples/lamutex/orig.da

run as usual and when it finishes, the result should pop up in your default browser.

then in the displayed process line area, use > to run forward, and < backward.
if you mouse over the lines, you will see the msg contents displayed.

@lmarne01
Copy link
Author

Thanks. It worked

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

2 participants