Created
June 27, 2012 16:43
-
-
Save Schroedi/3005311 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include "findMaxP.h" | |
int getSizeForMax() { | |
return 10000; | |
} | |
int findMaxP(int length, int arr[]) { | |
int i, foo = 0; | |
int max = -1; | |
for (i = 0; i < length; ++i) { | |
if (arr[i] > max) | |
max = arr[i]; | |
} | |
#pragma omp parallel for | |
for (i = 0; i < 2 * 42000000; ++i){ | |
foo += i; | |
} | |
return max; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ time ./run.sh | |
Average sequential runtime: 0.000000 seconds. | |
Average parallel runtime: 1.084200 seconds. | |
YOU LOSE | |
Fehler bei Prefixmaximabestimmung. | |
Fehler bei Faerbung. | |
Fehler bei List-Ranking. | |
real 0m14.307s | |
user 0m54.420s | |
sys 0m0.077s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment