Giter Site home page Giter Site logo

dininduviduneth / bucket-sort-uu Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 14.42 MB

A project to implement a parallelized bucket sorting algorithm using C, PThreads and OpenMP

Makefile 0.30% C 3.73% Jupyter Notebook 95.97%
cprogramming makefile openmp parallel-programming pthreads

bucket-sort-uu's Introduction

BUCKET SORT IMPLEMENTATION

This README section will explain how to run the code in different modes.

1. Array generation

The program to generate number arrays is in array_gen folder. The Makefile in it contains commands to create different types of arrays and save them in files. Comment off the unwanted ones and run make to automatically generate the files. Or simply run the ./generate_array command in the following format to generate a custom array of your choice.

    ./generate_array N distribution_type relative_output_file_name.bin

N could be any integer value. distribution_type should could be U for uniform distribution, N for normal distribution and E for exponential distribution.

2.Running the serial code

To run the serial bucket sorting program on a generated set of numbers,

  • Navigate into serial folder and run make.

  • Run the ./bucket program in the folliwing format.

    /bucket relative_input_file_path bucket_count
    
  • If the code was run correctly, a file with the sorted set of numbers with the name results.bin will be created in the same directory.

  • Add the desired number of buckets in the place of bucket_count.

3. Running the parallel code

To run the parallel bucket sorting program on a generated set of numbers,

  • Navigate into parallel folder and run make.

  • Run the ./bucket program in the folliwing format.

    /bucket relative_input_file_path thread_count
    
  • If the code was run correctly, a file with the sorted set of numbers with the name results.bin will be created in the same directory.

  • Add the desired number of buckets in the place of thread_count. In the parallel implementation, the thread_count will be taken as the number of buckets.

4. Validate the result

To validate if a generated file of numbers consists of accurately sorted numbers, navigate to check_accuracy folder and run make.

  • Run the ./check_accuracy program in the folliwing format.

    /check_accuracy relative_path_of_result_file relative_path_of_original_file
    

The result will be displayed in the console.

5. View experiments

The experiments are saved in a python notebook named experiments.ipynb in the experiments directory. It also contains the csv files which contains the data gathered for experimentation.

6. Reset the directory

The directory can be reset (remove all generated files) by running make clean from the main directory path.

If required to clean files within the sub-directories, their versions of make clean can be used.

bucket-sort-uu's People

Contributors

dininduviduneth avatar

Watchers

 avatar

bucket-sort-uu'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.