Git Product home page Git Product logo

c-parallel-prefix-sum's Introduction

C Parallel implementation of Prefix-sum

A C and Pthreads implementation of the prefix sum algorithm.

The University of Edinburgh

Originally Coursework : Parallel Programming Languages and Systems

Author : Gavin Waite

Spring 2018

Grade received: A

Confirmed to be working on macOS as of 2020-01-27

Description

This project was the second coursework for the Parallel Programming Languages and Systems class in my 5th year at The University of Edinburgh. The original requirements and brief are found at ex2.pdf.

The task was to implement, using C and pthreads, a parallel implementation of the Prefix-sum algorithm. The challenge was to ensure timing and memory consistency between the parallel threads to speed up the output but still produce the correct result.

To run a test, the code will first compute the standard, trivial sequential prefix-sum before attempting the parallel method. It will validate the outputs are the same.

Code to run a test:

gcc -o ex2 ex2.c -DNITEMS=10 -DNTHREADS=4 -DSHOWDATA=1 -lpthread

Where NITEMS controls the number of items in the prefix sum array and NTHREADS controls the number of threads used.

I included a test suite to test the system under various conditions up to 10,000,000 items and 32 threads. This can be run with:

./test.sh

c-parallel-prefix-sum's People

Contributors

gavwaite avatar

Watchers

James Cloos avatar  avatar

Forkers

wangxi0706

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.