MCPcopy Create free account
hub / github.com/boutproject/BOUT-dev / PVecAllReduce

Function PVecAllReduce

externalpackages/PVODE/source/nvector.cpp:658–686  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

656/***************** Private Helper Functions **********************/
657
658static 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
689static void VCopy(N_Vector x, N_Vector z)

Callers 8

N_VDotProdFunction · 0.85
N_VMaxNormFunction · 0.85
N_VWrmsNormFunction · 0.85
N_VMinFunction · 0.85
N_VWL2NormFunction · 0.85
N_VL1NormFunction · 0.85
N_VInvTestFunction · 0.85
N_VConstrProdPosFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected