Skip to content

Instantly share code, notes, and snippets.

@Schroedi
Created June 27, 2012 16:43
Show Gist options
  • Save Schroedi/3005311 to your computer and use it in GitHub Desktop.
Save Schroedi/3005311 to your computer and use it in GitHub Desktop.
#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;
}
$ 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