Skip to content

Commit

Permalink
Makefile fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cnphil committed Apr 5, 2013
1 parent 70d7cd4 commit 75ae206
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 112 deletions.
Binary file modified MergesortMulti
Binary file not shown.
12 changes: 10 additions & 2 deletions MergesortMulti.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@ void *m_sort(void *args)
{
struct arg_struct *aus = (struct arg_struct *) args;
int mid, left = aus->le, right = aus->ri;




if (right > left)
{

mid = (right + left) / 2;
pthread_t lth, rth;
struct arg_struct lst, rst;
Expand All @@ -39,7 +42,12 @@ void *m_sort(void *args)
pthread_join(lth, NULL);
pthread_join(rth, NULL);
merge(left, mid+1, right);


}



pthread_exit(0);
}

Expand Down Expand Up @@ -79,7 +87,7 @@ void merge(int left, int mid, int right)
mid = mid + 1;
temp_pos = temp_pos + 1;
}

for (i=0; i <= num_elements; i++)
{
numbers[right] = temp[right];
Expand Down
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ MergesortSingle: MergesortSingle.o
MergesortSingle.o:
g++ -c MergesortSingle.c
MergesortMulti: MergesortMulti.o
g++ -lpthread MergesortMulti.o -o MergesortMulti
g++ -pthread MergesortMulti.o -o MergesortMulti
MergesortMulti.o:
g++ -c MergesortMulti.c

Binary file removed testwork
Binary file not shown.
42 changes: 0 additions & 42 deletions testwork.c

This file was deleted.

Binary file removed z
Binary file not shown.
67 changes: 0 additions & 67 deletions zD.c

This file was deleted.

0 comments on commit 75ae206

Please sign in to comment.