Giter VIP home page Giter VIP logo

dpdebugger's Introduction

dpDebugger

Visual debugger for the Dining Philosophers simulation.

Save an output of your program into this directory as log.txt and boot up the Tkinter tool for it to work. You can adjust how quickly frames pass through the animation with an entry widget. Might add more to this later.

In order for this to work, your output has to include single lines that display nothing but the state of the chops[] array; i.e., lines like [-1, 1, 2] that indicate that each philosopher has their left chopstick aside from philosopher 0 (assuming -1 denotes a NONE state).

A workable example output looks like the following, where lines like [-1, -1, -1] allow dpDebugger to do its job:

$ mpic++ dp.cpp -o dp; mpirun -np 4 ./dp
P0: thinking
P1: thinking
P2: thinking
P0: picking up left
0 asks for left
-1 -1 -1 
L: assigning 0 to chop[0]
-1 -1 -1 

0 -1 -1 
P2: picking up left
2 asks for left
0 -1 -1 
L: assigning 2 to chop[2]
0 -1 -1 

0 -1 2 
P1: picking up left
1 asks for left
0 -1 2 
L: assigning 1 to chop[1]
0 -1 2 

If something about my output doesn't look right, well, that's the entire reason why I made this thing :^)

dpdebugger's People

Contributors

agforero avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.