Skip to content

This is the source codes of my programming assignment (Parallel Sorting) of PC2019 (Parallel Computing) courses at NJU.

License

Notifications You must be signed in to change notification settings

StardustDL-Labs/NJU-PC-Lab

Repository files navigation

Parallel Sorting

This project contains the serial and parallel implements of several sort algorithms like Quicksort, Enumsort and Mergesort, and it use benchmark tests for these implements to compare the running time of them.

  • This is the source codes of my programming assignment of PC2019 (Parallel computing - structures, algorithms, programming) courses.
  • Each push (or pull request) will be tested and benchmarked. The reports will be uploaded to CI artifacts.

Guide

The interface ISorter defines the main API:

public interface ISorter
{
    Task<Memory<int>> Sort(in ReadOnlyMemory<int> seq);
}
  • Each element of the argument seq should be distinct.
  • The return array of the method is in ascending order.

Namespaces:

  • Systems: Sorter built by the framework library.
  • Serials: Serial sorting algorithms.
  • Parallels: Parallel sorting algorithms.

Test

Use the following command to test the correctness of the algorithms.

dotnet test

Benchmark

The project Benchmark.Base create dynamic inputs, and run many times to get average running time for each algorithm.

  1. Use the following command to run it.
dotnet run --project ./test/Benchmark.Base -c Release
  1. The results and logs will also be saved at directory BenchmarkDotNet.Artifacts.

Custom Input

Use the project Benchmark.FromFile.

  1. Fill input to the file assets/random.txt. The current random.txt is generated randomly.
    • Each element from the input data should be distinct.
  2. Run the project. The time will print to terminal, and the sorting result will write to assets/output*.txt.
cd ./test/Benchmark.FromFile
dotnet run

Depedencies

About

This is the source codes of my programming assignment (Parallel Sorting) of PC2019 (Parallel Computing) courses at NJU.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages