GithubHelp home page GithubHelp logo

kwencel / misra83 Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 23 KB

Implementation of a token-based mutual exclusion with token loss detection and recovery using a Misra'83 algorithm.

CMake 0.90% C++ 99.10%

misra83's Introduction

Misra'83 token-based mutex

An implementation of a token-based mutual exclusion with token loss detection and recovery using a Misra'83 algorithm.

This program simulates an algorithm run on a distributed system with a user-defined number of nodes. It uses OpenMPI to provision such a system and serve as a medium of communication in this system.

You can force a certain node to lose a particular token by inputting q for ping or w for ping, followed by a whitespace, followed by the number of the node (starting from 0) to STDIN and pressing ENTER.

For instance, input q 0 to make Process 0 lose the next PING token, and input w 2 to make Process 2 lose the next PONG token.

The algorithm should handle the loss of one token at a time.

Build prerequisites

CMake 3.9 (it will probably compile using older versions too, see the last paragraph)
C++17 compliant compiler
OpenMPI

Build instructions

git clone https://github.com/kwencel/Misra83
cd Misra83
cmake .
make

How to use

Invoke compiled executables by mpirun with at least 2 processes, for example:

mpirun -np 3 Misra83 | tee log && clear && echo "----- SORTED LOG -----" && cat log | sort

It will run the program and stream the logs as they are generated. After the program completes however, it will display the log sorted by the messages lamport timestamp, which is crucial for analysing the program runtime.

Older CMake version?

Try to change the minimum required version in CMakeLists.txt to match the version you have installed. There shouldn't be any issues.

misra83's People

Contributors

kwencel avatar

Watchers

James Cloos avatar  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.