Deixando de fora o código não essencial:
double* max_of_two(double *r,double *n);
int npoints = 1000000;
double* xy = (double*)malloc(2*npoints*sizeof(double));
double zero_coord[2] = {0.0,0.0};
double max_coord[2] = {0.0,0.0};
#pragma omp declare reduction\
(takemax:double*:omp_out=max_of_two(omp_out,omp_in)) \
initializer(omp_priv=zero_coord)
#pragma omp parallel for reduction(takemax:max_coord)
for (int i=0; i<npoints; i++) {
max_coord = max_of_two(max_coord,xy+2*i);
}
Isso dá o erro:
error: '#pragma omp declare reduction' initializer refers to variable 'zero_coord' which is not 'omp_priv' nor 'omp_orig'
O que é estranho porque em códigos mais simples eu posso inicializar omp_priv=-1
e tal.