Skip to content

Review/serial and readme bunsarak#4

Open
Bunsarak27 wants to merge 9 commits into
Goobahfish:mainfrom
Izak8:review/serial-and-readme-bunsarak
Open

Review/serial and readme bunsarak#4
Bunsarak27 wants to merge 9 commits into
Goobahfish:mainfrom
Izak8:review/serial-and-readme-bunsarak

Conversation

@Bunsarak27
Copy link
Copy Markdown

What’s in this PR:
I combined Izak merge function and buildargs with my my_mergesort functions, Matthew currently working on parallel_mergesort func.

  • Implemented my_mergesort(left,right) (serial mergesort base case):
    • Base case: left >= right
    • Recurse on [left..mid] and [mid+1..right]
    • Merge with merge(left, mid, mid+1, right)
  • Added README with overview, build/usage, testing plan, and design notes.

others

  • parallel_mergesort(void*) is intentionally still a stub; teammate is implementing it.
  • The harness runs fine in serial for validation; merge unit tests pass.

Izak8 and others added 9 commits October 24, 2025 14:16
Includes a partially-authored README file. However, there are still some changes to make, as there are sections which
we cannot fill out yet. This commit was accidentally authored under my university GitHub identity, woops.

---------

Co-authored-by: Izak Baldacchino <a1830164@student.adelaide.edu.au>
Follows the basic mergesort algorithm provided by the video shown
on the assignment description. Other sources accessed include:
cppreference.com (for memcpy).
Includes a Makefile based on a template I created for an old project
(which can be found here: github.com/Izak8/gl).

Build flags differ from original assignment; changed C standard from gnu89
to c11. gnu89 seems unecessarily limiting.
Just simply uses scopes to create predictable conditions.
If the test executable isn't aborted by a failed assertion, then it is
considered to pass.
…hat still has elements.Finish with a single memcpy from B[left..right] back to A

had to remove  <error.h> include so tests build locally
…hat still has elements.Finish with a single memcpy from B[left..right] back to A

had to remove  <error.h> include so tests build locally
…el_mergesort, No threading changes yet; parallel_mergesort() remains a stub,fix(sort): correct my_mergesort base case (use left >= right)
…rt stub:testing goes well- (base) bunsarakann@Bunsaraks-MacBook-Air concurrency-os-assignment3 % ./test-mergesort 1000 0 42

Sorting 1000 elements took 0.00 seconds.
(base) bunsarakann@Bunsaraks-MacBook-Air concurrency-os-assignment3 % ./test-mergesort 1000000 0 42
Sorting 1000000 elements took 0.16 seconds.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants