IsaacMAllen / Parallel-Quicksort-Project

Parallelizes Quicksorting of BMS Data for Team Sunergy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sorting Parallelization via OpenMP with Solar Vehicle Applications

By Logan Richardson & Isaac Allen

Project Purpose:

This project parallelizes the QuickSort and Merge Sort algorithms using OpenMP. Our goal was to practice parallelization and build a useful tool for team Sunergy. Team Sunergy is Appalachian State University's solar vehicle racing team. Data is collected from the battery management system at the race each year. The data contains over thirty variables such as state of charge, highest/lowest cell volt, pack current charge limit, and highest/lowest cell temperature. The battery management system of the car constantly outputs data and the dataset therefore scales quite rapidly. For example, in the period from Wed Jul 21 17:34:07 PDT 2021 to Thu Jul 22 00:27:15 PDT 2021 (Roughly 7 Hours) the BMS generated 78,210 data points. Our program parallelizes the sorting of this data using QuickSort & Merge Sort. The program scans in the comma separated value dataset and populates the data structure. We organized the data into a structure of structures grouping similar variables together. The bmsData structure contains pack, cell, and hiLo data sub structures. The end user can scan in a csv dataset and then choose which variable to sort the data upon.

How to Use:

1. Setup: Clone the repo on a server such as App State's student2 machine.
2. Compile: Run the 'make' command found within the makefile.
3. Run: ./sorter -n {X} -t {Y} -- X = 2^# of arrays -- Y = # of threads.
4. Commands: -m runs MergeSort, -q runs QuickSort, ./sorter -h provides information.

Completed objectives:

    1. Sequential & Parallelized QuickSort
    2. Sequential & Parallelized Merge Sort
    3. Speedup comparison between algorithms
    4. Created a tool which the solar vehicle team could use and expand upon
    5. Practiced parallelization
    6. Learned how to parse & import CSV data
    7. Learned more about valgrind and gdb

Unfinished objectives:

    1. Bug related:

      1. GPU QuickSort
    2. Time related:

      1. Sorting the data on the varibale of choice.

Resource List:

  1. "Data Collection and Analysis Techniques for Solar Car Telemetry Data"
https://solarcar.mst.edu/wp-content/uploads/sites/14/2019/10/Data-Collection-and-Analysis-Techniques-for-Solar-Car-Telemetry-Data.pdf
  1. Sample Data Sets: data.world
https://data.world/datasets/solar
  1. "Parallel Depth First Search, Part 1: Implementation"
https://www.lrde.epita.fr/~bleton/doc/parallel-depth-first-search.pdf
  1. Section 3.2 of textbook: "Parallel Programming, Concepts and Practice"
    By Bertil Schmidt, Jorge Gonazales-Dominguez, Christian Hundt, & Moritz Schlarb
Parallel Programming, Concepts and Practice
  1. "How can I read and parse CSV files in C++?"
https://stackoverflow.com/questions/1120140/how-can-i-read-and-parse-csv-files-in-c
  1. "Quicksort: an improved GPU-based implementation of quicksort"
    By Emanuele Manca, Andrea Manconi, Alessandro Orro, Giuliano Armano and Luciano Milanes.
Quicksort: an improved GPU-based implementation of quicksort
  1. "GPU-Quicksort: A Practical Quicksort Algorithm for Graphics Processors"
    By Daniel Cederman and Philippas Tsigas
GPU-Quicksort: A Practical Quicksort Algorithm for Graphics Processors
  1. Advice and Guidance from Dr. Cindy Norris
    Professor of Computer Science, Appalachian State University
https://compsci.appstate.edu/faculty-staff/dr-cindy-norris
  1. Team Sunergy Private Dataset
    cellvoltages_2021-07-21-17-34-00

Hours Log: Total Hours 87.57

# Hours Date / Time In Class Yes/No Description Person
4
(2 x 2)
6/15/22
2 - 4p
Y Picking a topic & starting research LWR & IMA
1.5
6/16/22
11 - 12:30p
N Reading about GPU Quicksort IMA
1
6/16/22
1 - 2p
N Article Reading LWR
5
(2.5 x 2)
6/16/22
2 - 4:30p
Y Read QuickSort article, setup codebase, gpuquicksort.cu & makefile LWR & IMA
2
6/17/22
2 - 4p
N Debugging makefile, working on Gpuquicksort, organizing codebase LWR
2.75
6/17/22
2:30 - 5:15p
N Structuring the build files and layout of the codebase IMA
1
6/17//22
8 - 9p
N Reading Quicksort documentation LWR
5.32
(2.66 x 2)
6/18/22
8 - 10:40p
N Implementing Host logic LWR & IMA
6
(3 X 2)
6/20/22
9:30 - 12:30p
N CPU Kernel implementation & consulting with Dr. Norris LWR & IMA
5
(2.5 x 2)
6/20/22
2 - 4:30p
Y Research, consulting with Dr. Norris, GPUQuickSort LWR & IMA
8
(4 x 2)
6/20/22
8:30 - 12:30a
N BMS Data entry pair programming session LWR & IMA
2
(1 x 2)
6/21/22
10 - 12p
N Debugging sorter.cu LWR
3
(1.5 x 2)
6/21/22
12:30 - 2p
N Debugging code LWR & IMA
5
(2.5 x 2)
6/21/22
2 - 4:30p
Y Code Compiling, Further Debugging LWR & IMA
0.75
6/21/22
4:30 - 5:15p
N Debugging IMA
6
(3 x 2)
6/21/22
9:45 - 12:45a
N Resolved Execution Bugs LWR & IMA
1.75
6/22/22
7 - 8:45a
N Optimizing Memory Access IMA
0.5
6/22/22
9 - 9:30a
N Further Investigations IMA
6
(3 x 2)
6/22/22
10 - 1p
N Implementing Algorithm, debugging, documenting code, updating readme, & creating power point presentation. LWR & IMA
5
(2.5 x 2)
6/22/22
2 - 4:30p
Y Work on presentation, redesign git repo, rework readme, mergesort is now running LWR & IMA
8
(4 x 2)
6/22/22
5 - 9p
N Creating presentation, polishing readme, debugging sorting algorithms to increase speedup. LWR & IMA
8
(4 x 2)
6/23/22
9:30 - 1:30p
N Refactored algorithms, fixed speedup issue, created sorted CSV download, polished presentation & readme LWR & IMA

About

Parallelizes Quicksorting of BMS Data for Team Sunergy


Languages

Language:C 71.8%Language:C++ 17.8%Language:Cuda 8.8%Language:Makefile 1.6%