Code Monkey home page Code Monkey logo

multithreaded-rr-scheduler's Introduction

Multithreaded Round Robin Scheduler For Matrix Multiplication

This project aims to optimize an I/O and calculation heavy task such as matrix multiplication by the use of multithreading and round robin scheduling between the script reading the matrices and the one performing the calculation. Implemented in C

Usage

  • Run MatrixGen.py to create two random matrices
    • Usage: python3 MatrixGen.py <A> <B> <C> where A,B,C are positive integers
    • This creates 2 random matrices, the first one of size AxB stored in in1.txt, and the second one of size BxC stored in in2.txt.
    • It also creates the expected output of the multiplication of these matrices and stores the result in matrixres.txt
  • Run transpose.py to transpose the 2nd matrix for simplification of calculation
    • Usage: python3 transpose.py
  • Update the run.sh file's 5th line
    • Usage: time ./c <A> <B> <C> <input_file1> <input_file2> <output_file> where A, B and C are the same dimensions as above. input_file1, input_file2 and output_file can be left as is.
  • Run the above bash file. Output will be generated in the output file specified above.

We can see a significant improvement in overall time taken, especially on large improvements. Graphs about waiting times, turn around times, time taken to read/compute the inputs vs number of threads is present in Images folder. The data for the same is in CSVs folder.

Normally 1e9 sized input takes little more than 10 minutes. However we were able to run it totally in around 0.8 seconds. This is a huge improvement in performance.

multithreaded-rr-scheduler's People

Contributors

kishank12312 avatar

Stargazers

Prithvi Hegde 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.