projects
/
parallel_computing.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
02d88b2
)
Copy sort-check from src/sorting/main.c to assignments/archive/sorting/soln/main.c.
author
W. Trevor King
<wking@drexel.edu>
Fri, 29 Oct 2010 15:42:46 +0000
(11:42 -0400)
committer
W. Trevor King
<wking@drexel.edu>
Fri, 29 Oct 2010 15:42:46 +0000
(11:42 -0400)
assignments/archive/sorting/soln/main.c
patch
|
blob
|
history
diff --git
a/assignments/archive/sorting/soln/main.c
b/assignments/archive/sorting/soln/main.c
index 0810318ab6ec3a51ed527e80bf92095325806789..9bcb2195e4fda89d3b09e3ca3221d82d152b526a 100644
(file)
--- a/
assignments/archive/sorting/soln/main.c
+++ b/
assignments/archive/sorting/soln/main.c
@@
-320,6
+320,14
@@
void master(int rank, int size, const char *file_name)
printarray(stderr, array_size, array, NUM_SHOWN);
fprintf(stderr, "check: sum of %d elements = %g\n",
array_size, checkarray(array_size, array));
+ for (i = 0; i < array_size - 1; i++) {
+ if (array[i] > array[i + 1]) {
+ fprintf(stderr,
+ "error: sorted array[%d] = %g > %g = array[%d]\n",
+ i, array[i], array[i + 1], i + 1);
+ exit(EXIT_FAILURE);
+ }
+ }
#endif /* DEBUG */
#ifdef DEBUG_TIMING