Giter Site home page Giter Site logo

multithreadmania's Introduction

Multithread Mania

This is a project created for an operating systems course at Kansas State University by myself, Erin Payne, and Samantha Montgomery. This purpose of this project is to process a text file consisting of 1,000,000 lines and for each line, calculate the longest common substring between itself and its subsequent line. We solved this problem three times, using three different multithreading libraries (OpenMP, MPI, and Pthreads). The scripts were then scheduled to run on Beocat, the KSU supercomputer, with a variable number of cores and threads and the processing times and memory usages were recorded and analyzed.

In order to make use of multiple threads to speed the processing time, we read in a chunk of the file and then spawned off n child threads (determined by the Beocat scheduling environment). For each thread created, it processed every line of the file chunk where the file line % the thread count = the thread's id. So, if four threads were spawned, the first child thread processes lines 0, 4, 8, ... and the second child thread processes lines 1, 5, 9, ...

For each line in the file, the longest common substring problem was solved using a dynamic programming approach. For two strings, a and b, of lines m and n, respectively, an array is created of size m * n. Then, the array is populated so that the entry at position i,j corresponds to the length of the longest common substring between the substring of a from 0 to i and the substring of b from 0 to j. Once the array is populated, we iterate over the table starting at position m,n and reconstruct the largest common substring between the two strings.

multithreadmania's People

Contributors

laurel-thomson avatar montgomerysamantha avatar enpayne27 avatar

Watchers

James Cloos avatar

multithreadmania's Issues

Fix openMP code

Figure out why the first and last lines are processed incorrectly.

Attempt to read in the file in chunks rather than all at once (if possible).

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.