| 656 | /***************** Private Helper Functions **********************/ |
| 657 | |
| 658 | static real PVecAllReduce(real d, int op, machEnvType machEnv) |
| 659 | { |
| 660 | /* This function does a global reduction. The operation is |
| 661 | sum if op = 1, |
| 662 | max if op = 2, |
| 663 | min if op = 3. |
| 664 | The operation is over all processors in the group defined by |
| 665 | the parameters within machEnv. */ |
| 666 | |
| 667 | MPI_Comm comm; |
| 668 | real out; |
| 669 | |
| 670 | comm = machEnv->comm; |
| 671 | |
| 672 | switch (op) { |
| 673 | case 1: MPI_Allreduce(&d, &out, 1, PVEC_REAL_MPI_TYPE, MPI_SUM, comm); |
| 674 | break; |
| 675 | |
| 676 | case 2: MPI_Allreduce(&d, &out, 1, PVEC_REAL_MPI_TYPE, MPI_MAX, comm); |
| 677 | break; |
| 678 | |
| 679 | case 3: MPI_Allreduce(&d, &out, 1, PVEC_REAL_MPI_TYPE, MPI_MIN, comm); |
| 680 | break; |
| 681 | |
| 682 | default: break; |
| 683 | } |
| 684 | |
| 685 | return(out); |
| 686 | } |
| 687 | |
| 688 | |
| 689 | static void VCopy(N_Vector x, N_Vector z) |
no outgoing calls
no test coverage detected