| 416 | |
| 417 | |
| 418 | real N_VDotProd(N_Vector x, N_Vector y) |
| 419 | { |
| 420 | integer loclen; |
| 421 | real sum = ZERO, *xd, *yd, gsum; |
| 422 | machEnvType machenv; |
| 423 | |
| 424 | loclen = x->length; |
| 425 | xd = x->data; |
| 426 | yd = y->data; |
| 427 | machenv = x->machEnv; |
| 428 | |
| 429 | #pragma omp parallel for reduction(+: sum) |
| 430 | for (integer i=0; i < loclen; i++) |
| 431 | sum += xd[i] * yd[i]; |
| 432 | |
| 433 | gsum = PVecAllReduce(sum, 1, machenv); |
| 434 | return(gsum); |
| 435 | } |
| 436 | |
| 437 | |
| 438 | real N_VMaxNorm(N_Vector x) |
no test coverage detected