Coder Social home page Coder Social logo

graphcli's Introduction

graphcli

graphcli is a command-line tool to build dependency graphs and check what tasks can be run parallelly.

Build

In the source directory you can run

cmake -S . -B build
cmake --build build

Or alternatively if you are on linux, you can simply run

./cleanbuild.sh

Binaries will be under 'build'.

Run

To run graphcli you can do

graphcli <options|filename>

where options can be:

-h  print the help message
-i  build dependency graph interactively

Whether you choose interactive session or an input file the input should be structured as follows

  • first line is the number of nodes in your graph
  • following lines should describe the directed edges between the nodes in 'X,Y' format which means X's output is required by Y. Nodes are identified by their number, indexed from zero, that is if the first line was 3, you can work with nodes 0, 1 and 2.
  • in interactive mode an empty line terminates the sequence. You don't need an empty line at the end in case you use an input file.

For example

/build/graphcli -i
Starting interactive session
Number of nodes: 3
Add edges to the graph in X,Y format one by one where X,Y represents an X-->Y edge 
meaning X's output is required by Y. Hit enter when done
0,1
1,2
2,0

See example.txt for file input example.

Once you finished constructing your dependency graph graphcli will run a check to see if the input graph contains any circular dependencies. If it does, you'll see

Graph contains circular dependency.    

If not it will output the batches of nodes that can be run in parallel.

Batches: 
Batch 1: 0 1 2 
Batch 2: 3 9 
Batch 3: 4 5 
Batch 4: 6 
Batch 5: 7 8 

graphcli's People

Watchers

 avatar  avatar

graphcli's Issues

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.