SomeNet
/
public repos
/
pub
/
astra
/
parallel.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
kleinigkeit ausgebessert
[pub/astra/parallel.git]
/
prefix
/
reduce.c
1
/*
2
* Recursive parallel prefix with auxiliary array y
3
*/
4
#include "recurse.h"
5
#include <omp.h>
6
7
void algorithm (numtype x[], unsigned long n, unsigned int ops[]) {
8
unsigned long i;
9
unsigned long sum = 0;
10
#pragma omp parallel for reduction(+ : sum)
11
for (i = 0; i < n; i++) {
12
sum += x[i];
13
}
14
x[n-1] = sum;
15
}