|
IPCC
1.0
|
MPI Mangement class. More...
#include "KNMPIManager.h"

Classes | |
| struct | COMPLEX_NUMBER |
| Complex number. More... | |
Public Member Functions | |
| CKNMPIManager () | |
| Constructor. More... | |
| ~CKNMPIManager () | |
| Destructor. More... | |
Static Public Member Functions | |
| static bool | InitLevel (int nMPILevel, int nFindingDegeneratedEVCount) |
| Init MPI Level, most low level is for multi node cacluation for Lanczos. More... | |
| static bool | CheckDeflationNodeCount (int nNeedNodeCount) |
| Checking node counts fix to deflation group. More... | |
| static void | SetMPIEnviroment (int nRank, int nTotalNode) |
| Set MPI Enviroment. More... | |
| static void | LoadBlancingForLanczos (int nRowCount) |
| Load blancing for MPI, this function only for lanczos solving without geometric constrcution. More... | |
| static void | LoadBlancing (int nElementCount) |
| Load blancing for MPI, This function for lanczos solving with geometric constrcution. More... | |
| static int | GetCurrentLoadBalanceCount () |
| Get Current node's rank load balancing number. More... | |
| static int | GetLoadBalanceCount (int nRank) |
| static int | GetCurrentRank () |
| static int | GetCurrentRank (MPI_Comm comm) |
| Get Current node's rank number. More... | |
| static int | GetTotalNodeCount () |
| static bool | IsRootRank () |
| Get Total node count. More... | |
| static bool | IsRootRank (MPI_Comm comm) |
| Check this node is root rank in 'comm' MPI_Comm. More... | |
| static bool | IsInMPIRoutine () |
| static void | BroadcastVector (CKNMatrixOperation::CKNVector *pVector) |
| Check this processing running on MPI Enviorment. More... | |
| static void | BroadcastBool (bool *boolValue, int nRootRank=0) |
| Broadcst boolean value. More... | |
| static void | BroadcastDouble (double *pValue, unsigned int nSize, int nRootRank=0, MPI_Comm comm=MPI_COMM_NULL) |
| Broadcst boolean value. More... | |
| static void | BroadcastInt (int *pValue, unsigned int nSize, int nRootRank=0, MPI_Comm comm=MPI_COMM_NULL) |
| Broadcst boolean value. More... | |
| static void | BroadcastLanczosResult (CKNLanczosMethod::LPEIGENVALUE_RESULT lpResult, int nIterationCount) |
| Broadcast Lanczos result. More... | |
| static void | SplitVector (CKNMatrixOperation::CKNVector *pVector, int nRootRank) |
| Split vector to sub rank. More... | |
| static void | MergeVector (CKNMatrixOperation::CKNVector *pVector, CKNMatrixOperation::CKNVector *pResultVector, unsigned int nMergeSize) |
| Merge vector to sub rank. More... | |
| static void | MergeVectorOptimal (CKNMatrixOperation::CKNVector *pSrcVector, CKNMatrixOperation::CKNVector *pResultVector, unsigned int nMergeSize, double fFirstIndex) |
| Merge vector to sub rank, operated without vector class member function call. More... | |
| static void | MergeVectorEx_Optimal (CKNMatrixOperation::CKNVector *pVector, CKNMatrixOperation::CKNVector *pResultVector, unsigned int nMergeSize, double fFirstIndex, unsigned int nSizeFromPrevRank, unsigned int nSizeFromNextRank, unsigned int nSizetoPrevRank, unsigned int nSizetoNextRank, unsigned int *) |
| Merge vector for 1 layer exchanging. More... | |
| static LPCOMPLEX_NUMBER | ConvertVectorToMPIComplexBuffer (CKNMatrixOperation::CKNVector *pVector) |
| Convert vector class to MPI_COMPLEX array. More... | |
| static void | AllReduceComlex (CKNComplex *pNumber, CKNTimeMeasurement::MEASUREMENT_INDEX INDEX=CKNTimeMeasurement::COMM) |
| Do all reduce function with CKNComplex. More... | |
| static double | AllReduceDouble (double fNumber) |
| Do all reduce function with CKNComplex. More... | |
| static int | GetRootRank () |
| static void | FinalizeManager () |
| Get Root rank. More... | |
| static void | InitCommunicationBufferMetric () |
| Initializing MPI Communication buffer for MVMul. More... | |
| static void | SendDoubleBufferSync (int nTargetRank, double *pBuffer, int nSize, MPI_Request *req, MPI_Comm commWorld=MPI_COMM_NULL) |
| Sending buffer for double data array with sync. More... | |
| static void | WaitSendDoubleBufferSync (MPI_Request *req) |
| Waiting sending double buffer sync function. More... | |
| static void | ReceiveDoubleBufferSync (int nSourceRank, double *pBuffer, int nSize, MPI_Request *req, MPI_Comm commWorld=MPI_COMM_NULL) |
| Receivinging buffer for double data array with sync. More... | |
| static void | WaitReceiveDoubleBufferAsync (MPI_Request *req) |
| Waiting recevinging double buffer sync function. More... | |
| static MPI_Comm | GetMPIComm () |
| static bool | IsMultiLevelMPI () |
| Get MPI_Comm. More... | |
| static void | BarrierAllComm () |
| Is Multilevel MPI Setting. More... | |
| static void | Barrier () |
| static bool | IsLanczosComputeRoot () |
| Barrier current deflation group. More... | |
| static bool | IsDeflationRoot () |
| Checking is root rank of Lanczos computation. More... | |
| static int * | GetEigenvalueCountFromDeflationGroup (int nDeflationGroupCount, int nLocalEVCount) |
| Checking is root rank of Deflation computation. More... | |
| static void | GatherVDouble (int nSourceCount, double *pReceiveBuffer, int *pSourceCount, double *pSendBuffer, int nSendCount, MPI_Comm comm=MPI_COMM_NULL) |
| GatherV for double wrapping function. More... | |
| static void | GatherVInt (int nSourceCount, int *pReceiveBuffer, int *pSourceCount, int *pSendBuffer, int nSendCount, MPI_Comm comm=MPI_COMM_NULL) |
| GahterV for int wrapping function. More... | |
| static void | GatherEVFromDeflationGroup (int nSourceCount, double *pReceiveBuffer, int *pSourceCount, double *pSendBuffer, int nSendCount) |
| static void | GatherEVIterationFromDeflationGroup (int nSourceCount, int *pReceiveBuffer, int *pSourceCount, int *pSendBuffer, int nSendCount) |
| Gather eigenvalue from deflation group. More... | |
| static void | ExchangeCommand (double *pfCommand, MPI_Comm comm) |
| Gather eigenvalue finding iteration number from deflation group. More... | |
| static MPI_Comm | GetLanczosComputComm () |
| static MPI_Comm | GetDeflationComm () |
| Getting Lanczos computing group MPI_Comm. More... | |
| static void | SendVectorSync (int nTargetRank, CKNMatrixOperation::CKNVector *pVector, int nSize, MPI_Request *req, MPI_Comm commWorld=MPI_COMM_NULL) |
| Getting Deflation computing group MPI_Comm. More... | |
| static void | ReceiveVectorSync (int nSourceRank, CKNMatrixOperation::CKNVector *pVector, int nSize, MPI_Request *req, MPI_Comm commWorld=MPI_COMM_NULL) |
| Receiving Vector with sync. More... | |
| static unsigned int | GetLanczosGroupIndex () |
Private Types | |
| typedef struct CKNMPIManager::COMPLEX_NUMBER * | LPCOMPLEX_NUMBER |
Static Private Attributes | |
| static int | m_nCurrentRank = 0 |
| Getting Lanczos group index. More... | |
| static int | m_nCommWorldRank = 0 |
| MPI Rank before split. More... | |
| static int | m_nTotalNode = 1 |
| Total node count. More... | |
| static bool | m_bStartMPI = false |
| MPI_Init call or not. More... | |
| static int * | m_pLoadBalance = NULL |
| Load blancing for MPI Communication. More... | |
| static LPCOMPLEX_NUMBER | m_pCommBuffer = NULL |
| Data buffer for MPI Communication. More... | |
| static LPCOMPLEX_NUMBER | m_pConvertingBuffer = NULL |
| Data buffer for Vector converting. More... | |
| static int * | m_pRecvCount = NULL |
| Reciving count variable for MPI comminication. More... | |
| static int * | m_pSendCount = NULL |
| Sending count variable for MPI comminication. More... | |
| static int * | m_pBankInfo = NULL |
| After MPI Split bank infomation. More... | |
| static int * | m_pDispls = NULL |
| Displ for MPI comminication. More... | |
| static MPI_Request | m_SendDoubleAsyncRequest = MPI_REQUEST_NULL |
| Request for sending double. More... | |
| static MPI_Request | m_ReceiveDoubleAsyncRequest = MPI_REQUEST_NULL |
| Request for receving double. More... | |
| static unsigned int | m_nMPILevel = 1 |
| MPI Level. More... | |
| static bool | m_bNeedPostOperation [10] = { false, false, false, false, false, false, false, false, false, false } |
| MPI Level. More... | |
| static MPI_Comm | m_mpiCommIndex = MPI_COMM_WORLD |
| Lanczos Method MPI_Comm. More... | |
| static MPI_Comm | m_deflationComm = MPI_COMM_NULL |
| Deflation computing MPI_Comm. More... | |
| static MPI_Group | m_lanczosGroup = MPI_GROUP_EMPTY |
| MPI Group for Lanczos computation. More... | |
| static MPI_Group | m_deflationGroup = MPI_GROUP_EMPTY |
| MPI Group for Deflation computation. More... | |
| static unsigned int | m_nLanczosGroupIndex = 0 |
| MPI Group index for Lanczos group. More... | |
| static bool | m_bMultiLevel = false |
| Flag for Multilevel MPI group. More... | |
|
private |
| CKNMPIManager::CKNMPIManager | ( | ) |
| CKNMPIManager::~CKNMPIManager | ( | ) |
|
static |
Do all reduce function with CKNComplex.
| pNumber | Variable that want to sum |
| INDEX | Time measurement index |
Definition at line 625 of file KNMPIManager.cpp.
References CKNComplex::GetImaginaryNumber(), CKNComplex::GetRealNumber(), m_mpiCommIndex, CKNTimeMeasurement::MeasurementEnd(), CKNTimeMeasurement::MeasurementStart(), and CKNComplex::SetComplexNumber().
Referenced by CKNMatrixOperation::VVDot().


|
static |
Do all reduce function with CKNComplex.
| fNumber | Variable that want to sum |
Definition at line 647 of file KNMPIManager.cpp.
References CKNTimeMeasurement::COMM, m_mpiCommIndex, CKNTimeMeasurement::MeasurementEnd(), and CKNTimeMeasurement::MeasurementStart().
Referenced by CKNGeometricShape::CalculateUnitcellCount(), CKNMatrixOperation::CKNVector::GetNorm(), and CKNTBMS_Solver::Launching_TBMS_Solver().


|
inlinestatic |
Definition at line 70 of file KNMPIManager.h.
References m_mpiCommIndex.
Referenced by CKNLanczosMethod::SaveLanczosResult().

|
static |
Is Multilevel MPI Setting.
Barrier MPI_COMM_WORLD
< Caution! This function wait all rank even if Comm split into several colors
Definition at line 791 of file KNMPIManager.cpp.
Referenced by CKNLanczosMethod::MergeDegeneratedEigenvalues().

|
static |
Broadcst boolean value.
| boolValue | bool variable for want to broadcasting |
| nRootRank | Root rank index |
Definition at line 524 of file KNMPIManager.cpp.
References CKNTimeMeasurement::COMM, m_mpiCommIndex, CKNTimeMeasurement::MeasurementEnd(), and CKNTimeMeasurement::MeasurementStart().
Referenced by CKNLanczosMethod::LanczosIterationLoop().


|
static |
Broadcst boolean value.
| pValue | double data buffer for want to broadcasting |
| nSize | Data buffer size |
| nRootRank | Root rank index |
Definition at line 540 of file KNMPIManager.cpp.
References CKNTimeMeasurement::COMM, m_mpiCommIndex, CKNTimeMeasurement::MeasurementEnd(), and CKNTimeMeasurement::MeasurementStart().
Referenced by CKNLanczosMethod::DoResidualCheck(), CKNGeometricShape::ExchangeAtomInfoBetweenNode(), ExchangeCommand(), and CKNLanczosMethod::MergeDegeneratedEigenvalues().


|
static |
Broadcst boolean value.
| [in,out] | pValue | Broadcasting variable |
| nSize | Broadcasting variable size | |
| nRootRank | Root rank number | |
| comm | Broadcating MPI_Comm range |
Definition at line 560 of file KNMPIManager.cpp.
References CKNTimeMeasurement::COMM, m_mpiCommIndex, CKNTimeMeasurement::MeasurementEnd(), and CKNTimeMeasurement::MeasurementStart().
Referenced by CKNLanczosMethod::MergeDegeneratedEigenvalues().


|
static |
Broadcast Lanczos result.
| lpResult | Lanczos method result that want to boardcasting |
| nIterationCount | Current iteration count |
Definition at line 578 of file KNMPIManager.cpp.
References CKNTimeMeasurement::COMM, GetRootRank(), IsRootRank(), m_mpiCommIndex, CKNTimeMeasurement::MALLOC, CKNTimeMeasurement::MeasurementEnd(), CKNTimeMeasurement::MeasurementStart(), CKNLanczosMethod::EIGENVALUE_RESULT::nEigenValueCount, CKNLanczosMethod::EIGENVALUE_RESULT::nEigenValueCountForMemeory, CKNLanczosMethod::EIGENVALUE_RESULT::nEigenVectorSize, CKNLanczosMethod::EIGENVALUE_RESULT::nMaxEigenValueFoundIteration, CKNLanczosMethod::EIGENVALUE_RESULT::pEigenValueFoundIteration, and CKNLanczosMethod::EIGENVALUE_RESULT::pEigenVectors.
Referenced by CKNLanczosMethod::LanczosIteration().


|
static |
Check this processing running on MPI Enviorment.
Broadcast vector to sub rank
| pVector | Vector for want to broadcast |
Definition at line 263 of file KNMPIManager.cpp.
References IsInMPIRoutine().

|
static |
Checking node counts fix to deflation group.
| nNeedNodeCount | Deflation group count |
Definition at line 127 of file KNMPIManager.cpp.
References m_nTotalNode.
Referenced by InitLevel().

|
static |
Convert vector class to MPI_COMPLEX array.
| pVector | Converting target verctor |
Definition at line 667 of file KNMPIManager.cpp.
References CKNMPIManager::COMPLEX_NUMBER::fImginary, CKNMPIManager::COMPLEX_NUMBER::fReal, CKNMatrixOperation::CKNVector::GetAt(), CKNComplex::GetImaginaryNumber(), CKNComplex::GetRealNumber(), CKNMatrixOperation::CKNVector::GetSize(), and m_pConvertingBuffer.
Referenced by SplitVector().


|
static |
Gather eigenvalue finding iteration number from deflation group.
Exchanging command between MPI_Comm
| pfCommand | Command buffer |
| comm | MPI_Comm for exchaning command |
Definition at line 878 of file KNMPIManager.cpp.
References BroadcastDouble(), and COMMAND_SIZE.
Referenced by CKNLanczosMethod::MergeDegeneratedEigenvalues().


|
static |
Get Root rank.
Release all memory
Definition at line 693 of file KNMPIManager.cpp.
References FREE_MEM, CKNTimeMeasurement::FREE_MEM, m_bStartMPI, m_deflationComm, m_deflationGroup, m_lanczosGroup, m_mpiCommIndex, m_nCurrentRank, m_nTotalNode, m_pBankInfo, m_pDispls, m_pLoadBalance, m_pRecvCount, m_pSendCount, CKNTimeMeasurement::MeasurementEnd(), and CKNTimeMeasurement::MeasurementStart().
Referenced by CKNLanczosTest::COmpareWIthMatLabSeOrthMPI(), CKNTBMS_Solver::FinalEvn(), CKNLanczosTest::LargeSizeMatrixMPI(), and CKNGeometricConstructionLaunch::LaunchingGeometricConstructionMPI().


|
inlinestatic |
Definition at line 76 of file KNMPIManager.h.
References GatherVDouble(), and m_deflationComm.
Referenced by CKNLanczosMethod::MergeDegeneratedEigenvalues().


|
inlinestatic |
Gather eigenvalue from deflation group.
Definition at line 77 of file KNMPIManager.h.
References GatherVInt(), and m_deflationComm.
Referenced by CKNLanczosMethod::MergeDegeneratedEigenvalues().


|
static |
GatherV for double wrapping function.
| nSourceCount | Gather double buffer source count | |
| [out] | pReceiveBuffer | Saving buffer |
| pSourceCount | Srouce counts (ref. MPI_Gatherv) | |
| pSendBuffer | Sending buffer | |
| nSendCount | Sending counts | |
| comm | MPI_Comm for gather data |
Definition at line 822 of file KNMPIManager.cpp.
References FREE_MEM, IsDeflationRoot(), and m_mpiCommIndex.
Referenced by GatherEVFromDeflationGroup().


|
static |
GahterV for int wrapping function.
| nSourceCount | Gather double buffer source count | |
| [out] | pReceiveBuffer | Saving buffer |
| pSourceCount | Srouce counts (ref. MPI_Gatherv) | |
| pSendBuffer | Sending buffer | |
| nSendCount | Sending counts | |
| comm | MPI_Comm for gather data |
Definition at line 852 of file KNMPIManager.cpp.
References FREE_MEM, IsDeflationRoot(), and m_mpiCommIndex.
Referenced by GatherEVIterationFromDeflationGroup().


|
static |
Get Current node's rank load balancing number.
Definition at line 684 of file KNMPIManager.cpp.
References m_nCurrentRank, and m_pLoadBalance.
Referenced by CKNLanczosMethod::BuildWaveFunction(), CKNLanczosMethod::CalculateEigenVector(), CKNLanczosMethod::DoResidualCheck(), CKNLanczosMethod::InitLanczosVector(), CKNLanczosMethod::LanczosIteration(), CKNLanczosMethod::LanczosIterationLoop(), CKNLanczosTest::LargeSizeMatrixMPI(), CKNLanczosMethod::MergeDegeneratedEigenvalues(), MergeVector(), MergeVectorEx_Optimal(), MergeVectorOptimal(), CKNLanczosMethod::RecalcuWaveFunction(), CKNLanczosMethod::SortSolution(), SplitVector(), CKNLanczosTest::TestCSRBuildingViaFileLoad(), and CKNLanczosTest::TestCSRBuildingViaFileLoad_().

|
inlinestatic |
Definition at line 42 of file KNMPIManager.h.
References m_nCurrentRank.
Referenced by CKNMatrixOperation::AllocateLocalCSR(), CKNGeometricShape::ArrangeUnitCell(), CKNGeometricShape::CalculateUnitcellCount(), CKNGeometricShape::ConstructMapInfo(), CKNMatrixDebug::DumpCSR(), CKNIPCCUtility::DumpCSR(), CKNMatrixDebug::DumpCSRBinary(), CKNIPCCUtility::DumpCSRBinary(), CKNGeometricShape::ExchangeAtomInfoBetweenNode(), CKNGeometricShape::GetPeriodicDirection(), InitLevel(), CKNGeometricShape::IsInBoundaryCondition(), IsRootRank(), CKNLanczosMethod::LanczosIterationLoop(), CKNLanczosTest::LargeSizeMatrixMPI(), CKNTBMS_Solver::Launching_TBMS_Solver(), CKNLanczosLaunching::LaunchingLanczos(), CKNLanczosMethod::MergeDegeneratedEigenvalues(), CKNMatrixOperation::MVMulEx_AsyncCommWithLocalBlocks(), CKNGeometricShape::PeriodicUnitCellNumbering(), ReceiveDoubleBufferSync(), CKNLanczosMethod::SaveLanczosResult(), SendDoubleBufferSync(), CKNGeometricConstructionLaunch::SetShapeInformation(), CKNGeometricShape::SetShapeInformation(), SplitVector(), CKNLanczosTest::TestCSRBuildingViaFileLoad(), and CKNLanczosTest::TestCSRBuildingViaFileLoad_().

|
static |
Get Current node's rank number.
Get Current node's rank number
| comm | MPI_Comm |
Definition at line 251 of file KNMPIManager.cpp.
|
inlinestatic |
Getting Lanczos computing group MPI_Comm.
Definition at line 80 of file KNMPIManager.h.
References m_deflationComm.
Referenced by CKNLanczosMethod::MergeDegeneratedEigenvalues().

|
static |
Checking is root rank of Deflation computation.
Collecting total eigenvalue count from All deflation group
| nDeflationGroupCount | Deflation group counts |
| nLocalEVCount | Local deflation group eigenvalue counts |
Definition at line 802 of file KNMPIManager.cpp.
References IsRootRank(), and m_deflationComm.
Referenced by CKNLanczosMethod::MergeDegeneratedEigenvalues().


|
inlinestatic |
Definition at line 79 of file KNMPIManager.h.
References m_mpiCommIndex.
Referenced by CKNLanczosMethod::MergeDegeneratedEigenvalues().

|
inlinestatic |
Definition at line 83 of file KNMPIManager.h.
Referenced by CKNLanczosMethod::LanczosIteration(), and CKNLanczosMethod::MergeDegeneratedEigenvalues().

|
static |
| nRank | Target rank index |
Definition at line 203 of file KNMPIManager.cpp.
References m_nTotalNode, and m_pLoadBalance.
Referenced by CKNMatrixOperation::AllocateLocalCSR(), InitCommunicationBufferMetric(), CKNLanczosTest::LargeSizeMatrixMPI(), MergeVectorEx_Optimal(), MergeVectorOptimal(), SplitVector(), CKNLanczosTest::TestCSRBuildingViaFileLoad(), and CKNLanczosTest::TestCSRBuildingViaFileLoad_().

|
inlinestatic |
Definition at line 67 of file KNMPIManager.h.
References m_mpiCommIndex.
Referenced by CKNMatrixOperation::AllocateLocalCSR(), CKNLanczosMethod::LanczosIterationLoop(), and CKNMatrixOperation::MVMulEx_AsyncCommWithLocalBlocks().

|
inlinestatic |
Definition at line 60 of file KNMPIManager.h.
Referenced by BroadcastLanczosResult().

|
inlinestatic |
Definition at line 44 of file KNMPIManager.h.
References m_nTotalNode.
Referenced by CKNMatrixOperation::AllocateLocalCSR(), CKNGeometricShape::ArrangeUnitCell(), CKNGeometricShape::CalculateUnitcellCount(), CKNGeometricShape::ConstructMapInfo(), CKNMatrixDebug::DumpCSR(), CKNIPCCUtility::DumpCSR(), CKNMatrixDebug::DumpCSRBinary(), CKNIPCCUtility::DumpCSRBinary(), CKNGeometricShape::ExchangeAtomInfoBetweenNode(), CKNGeometricShape::GetPeriodicDirection(), InitCommunicationBufferMetric(), InitLevel(), CKNGeometricShape::IsInBoundaryCondition(), CKNLanczosMethod::LanczosIterationLoop(), CKNTBMS_Solver::Launching_TBMS_Solver(), CKNLanczosLaunching::LaunchingLanczos(), CKNLanczosMethod::MergeDegeneratedEigenvalues(), CKNMatrixOperation::MVMulEx_AsyncCommWithLocalBlocks(), CKNMatrixOperation::MVMulEx_Optimal(), CKNGeometricShape::PeriodicUnitCellNumbering(), CKNLanczosMethod::SaveLanczosResult(), CKNLanczosTest::SaveResultCVS(), CKNGeometricConstructionLaunch::SetShapeInformation(), CKNGeometricShape::SetShapeInformation(), CKNLanczosMethod::ShowLanczosResult(), and SplitVector().

|
static |
Initializing MPI Communication buffer for MVMul.
| nMatrixSize | Matrix size that want to solving |
Definition at line 718 of file KNMPIManager.cpp.
References GetLoadBalanceCount(), GetTotalNodeCount(), m_pDispls, m_pRecvCount, m_pSendCount, CKNTimeMeasurement::MALLOC, CKNTimeMeasurement::MeasurementEnd(), and CKNTimeMeasurement::MeasurementStart().
Referenced by CKNTBMS_Solver::AllocateCSR(), CKNLanczosTest::COmpareWIthMatLabSeOrthMPI(), CKNLanczosTest::LargeSizeMatrixMPI(), CKNGeometricConstructionLaunch::LaunchingGeometricConstructionMPI(), and CKNLanczosLaunching::LaunchingLanczos().


|
static |
Init MPI Level, most low level is for multi node cacluation for Lanczos.
| nMPILevel | MPI level count |
| nFindingDegeneratedEVCount | Deflation group count |
< First make group for lanczos method
< Second make group for deflation lanczos - vertical connected group
Definition at line 51 of file KNMPIManager.cpp.
References CheckDeflationNodeCount(), FREE_MEM, GetCurrentRank(), GetTotalNodeCount(), IsDeflationRoot(), IsLanczosComputeRoot(), m_bMultiLevel, m_bNeedPostOperation, m_deflationComm, m_deflationGroup, m_lanczosGroup, m_mpiCommIndex, m_nCommWorldRank, m_nLanczosGroupIndex, SetMPIEnviroment(), and CKNIPCCUtility::SetShow().
Referenced by CKNTBMS_Solver::InitMPIEnv(), and CKNLanczosLaunching::LaunchingLanczos().


|
inlinestatic |
Checking is root rank of Lanczos computation.
Definition at line 72 of file KNMPIManager.h.
References IsRootRank(), and m_deflationComm.
Referenced by CKNGeometricShape::ConstructMapInfo(), CKNIPCCUtility::DumpCSR(), GatherVDouble(), GatherVInt(), InitLevel(), CKNTBMS_Solver::Launching_TBMS_Solver(), CKNLanczosMethod::MergeDegeneratedEigenvalues(), CKNLanczosMethod::RecalcuWaveFunction(), CKNLanczosMethod::SaveLanczosResult(), and CKNLanczosMethod::ShowLanczosResult().


|
inlinestatic |
Definition at line 47 of file KNMPIManager.h.
References m_bStartMPI.
Referenced by BroadcastVector(), and CKNLanczosTest::TestCSRBuildingViaFileLoad().

|
inlinestatic |
Barrier current deflation group.
Definition at line 71 of file KNMPIManager.h.
References IsRootRank(), and m_mpiCommIndex.
Referenced by InitLevel(), and CKNLanczosMethod::MergeDegeneratedEigenvalues().


|
inlinestatic |
Get MPI_Comm.
Definition at line 68 of file KNMPIManager.h.
References m_bMultiLevel.
Referenced by CKNLanczosMethod::LanczosIteration(), CKNTBMS_Solver::Launching_TBMS_Solver(), and CKNLanczosLaunching::LaunchingLanczos().

|
static |
Get Total node count.
Check this node is root rank?
Definition at line 217 of file KNMPIManager.cpp.
References GetCurrentRank().
Referenced by CKNTBMS_Solver::ApplyPhPotential(), BroadcastLanczosResult(), CKNGeometricShape::CalculateUnitcellCount(), CKNLanczosTest::COmpareWIthMatLabSeOrthMPI(), CKNGeometricShape::ConstructMapInfo(), CKNLanczosMethod::DoEigenValueSolving(), CKNLanczosMethod::DoResidualCheck(), CKNIPCCUtility::DumpCSR(), CKNMatrixDebug::DumpCSR(), CKNIPCCUtility::DumpCSRBinary(), CKNMatrixDebug::DumpCSRBinary(), CKNGeometricShape::ExchangeAtomInfoBetweenNode(), CKNLanczosMethod::FinalizeLanczosInterationVariable(), GetEigenvalueCountFromDeflationGroup(), CKNGeometricShape::GetPeriodicDirection(), CKNLanczosMethod::InitLanczosIterationVariables(), IsDeflationRoot(), CKNGeometricShape::IsInBoundaryCondition(), IsLanczosComputeRoot(), CKNLanczosMethod::LanczosIteration(), CKNLanczosMethod::LanczosIterationLoop(), CKNLanczosTest::LargeSizeMatrixMPI(), CKNTBMS_Solver::Launching_TBMS_Solver(), CKNGeometricConstructionLaunch::LaunchingGeometricConstructionMPI(), CKNLanczosLaunching::LaunchingLanczos(), CKNLanczosMethod::MergeDegeneratedEigenvalues(), CKNGeometricShape::PeriodicUnitCellNumbering(), CKNLanczosMethod::SaveLanczosResult(), CKNGeometricConstructionLaunch::SetShapeInformation(), CKNGeometricShape::SetShapeInformation(), CKNLanczosMethod::ShowLanczosResult(), and CKNLanczosMethod::SortSolution().


|
static |
Check this node is root rank in 'comm' MPI_Comm.
| comm | MPI_Comm |
Definition at line 236 of file KNMPIManager.cpp.
References GetCurrentRank().

|
static |
Load blancing for MPI, This function for lanczos solving with geometric constrcution.
| nElementCount | Load balancing count |
Definition at line 189 of file KNMPIManager.cpp.
References m_mpiCommIndex, m_nTotalNode, and m_pLoadBalance.
Referenced by CKNTBMS_Solver::AllocateCSR().

|
static |
Load blancing for MPI, this function only for lanczos solving without geometric constrcution.
| nRowCount | Matrix row count |
Definition at line 150 of file KNMPIManager.cpp.
References m_nTotalNode, m_pLoadBalance, and CKNIPCCUtility::ShowMsg().
Referenced by CKNLanczosTest::COmpareWIthMatLabSeOrthMPI(), CKNLanczosTest::LargeSizeMatrixMPI(), and CKNGeometricConstructionLaunch::LaunchingGeometricConstructionMPI().


|
static |
Merge vector to sub rank.
| pVector | Vector for sharing | |
| [out] | pResultVector | Vector for saving merging result |
| nMergeSize | Vector size that after mergsing |
Definition at line 276 of file KNMPIManager.cpp.
References CKNTimeMeasurement::COMM, FREE_MEM, GetCurrentLoadBalanceCount(), m_mpiCommIndex, m_pDispls, m_pRecvCount, CKNMatrixOperation::CKNVector::m_vectValueImaginaryBuffer, CKNMatrixOperation::CKNVector::m_vectValueRealBuffer, CKNTimeMeasurement::MeasurementEnd(), and CKNTimeMeasurement::MeasurementStart().
Referenced by CKNMatrixOperation::MVMul().


|
static |
Merge vector for 1 layer exchanging.
| pSrcVector | Vector for sharing | |
| [out] | pResultVector | Vector for saving merging result |
| nMergeSize | Vector size that after mergsing | |
| fFirstIndex | First index for local vector index | |
| nSizeFromPrevRank | Exchanging size from previous node | |
| nSizeFromNextRank | Exchanging size from next node | |
| nSizetoPrevRank | Exchanging size to previous node | |
| nSizetoNextRank | Exchanging size to next node | |
| mPos | Previous, local, next node start index |
Definition at line 317 of file KNMPIManager.cpp.
References GetCurrentLoadBalanceCount(), GetLoadBalanceCount(), m_mpiCommIndex, m_nCurrentRank, m_nTotalNode, m_pDispls, m_pRecvCount, CKNMatrixOperation::CKNVector::m_vectValueImaginaryBuffer, CKNMatrixOperation::CKNVector::m_vectValueRealBuffer, CKNTimeMeasurement::MeasurementEnd(), CKNTimeMeasurement::MeasurementStart(), and CKNTimeMeasurement::MV_COMM.
Referenced by CKNMatrixOperation::MVMulEx_Optimal().


|
static |
Merge vector to sub rank, operated without vector class member function call.
| pSrcVector | Vector for sharing | |
| [out] | pResultVector | Vector for saving merging result |
| nMergeSize | Vector size that after mergsing | |
| fFirstIndex | First index for local vector index |
Definition at line 389 of file KNMPIManager.cpp.
References FREE_MEM, GetCurrentLoadBalanceCount(), GetLoadBalanceCount(), m_mpiCommIndex, m_nCurrentRank, m_nTotalNode, m_pDispls, m_pRecvCount, CKNMatrixOperation::CKNVector::m_vectValueImaginaryBuffer, CKNMatrixOperation::CKNVector::m_vectValueRealBuffer, CKNTimeMeasurement::MeasurementEnd(), CKNTimeMeasurement::MeasurementStart(), CKNTimeMeasurement::MV_COMM, CKNTimeMeasurement::MV_FREE_MEM, and CKNTimeMeasurement::MV_MALLOC.
Referenced by CKNMatrixOperation::MVMulOptimal().


|
static |
Receivinging buffer for double data array with sync.
| nSourceRank | Source rank index |
| pBuffer | Data buffer that want to receive |
| nSize | Data buffer size |
| req | MPI request parameter |
Definition at line 770 of file KNMPIManager.cpp.
References GetCurrentRank(), and m_mpiCommIndex.
Referenced by CKNGeometricShape::ConstructMapInfo(), CKNIPCCUtility::DumpCSR(), CKNMatrixDebug::DumpCSR(), CKNMatrixDebug::DumpCSRBinary(), CKNIPCCUtility::DumpCSRBinary(), CKNGeometricShape::ExchangeAtomInfoBetweenNode(), and ReceiveVectorSync().


|
static |
Receiving Vector with sync.
| nSourceRank | Source rank for receiving data |
| pVector | Receiving buffer |
| nSize | Receiving size |
| req | MPI_Request for MPI_Recv |
| commWorld | MPI_Comm for Receiving data |
Definition at line 910 of file KNMPIManager.cpp.
References FREE_MEM, ReceiveDoubleBufferSync(), and CKNMatrixOperation::CKNVector::Serialize().
Referenced by CKNLanczosMethod::MergeDegeneratedEigenvalues().


|
static |
Sending buffer for double data array with sync.
| nTargetRank | Target rank index |
| pBuffer | Data buffer that want to send |
| nSize | Data buffer size |
| req | MPI request parameter |
Definition at line 742 of file KNMPIManager.cpp.
References GetCurrentRank(), and m_mpiCommIndex.
Referenced by CKNGeometricShape::ConstructMapInfo(), CKNIPCCUtility::DumpCSR(), CKNMatrixDebug::DumpCSR(), CKNMatrixDebug::DumpCSRBinary(), CKNIPCCUtility::DumpCSRBinary(), CKNGeometricShape::ExchangeAtomInfoBetweenNode(), and SendVectorSync().


|
static |
Getting Deflation computing group MPI_Comm.
Sending Vector with sync
| nTargetRank | Sending target rank |
| pVector | Sending buffer |
| nSize | Sending size |
| req | MPI_Request for MPI_Send |
| commWorld | MPI_Comm for sending data |
Definition at line 890 of file KNMPIManager.cpp.
References FREE_MEM, SendDoubleBufferSync(), and CKNMatrixOperation::CKNVector::Serialize().
Referenced by CKNLanczosMethod::MergeDegeneratedEigenvalues().


|
static |
Set MPI Enviroment.
| nRank | Current rank index |
| nTotalNode | Total rank count |
Definition at line 139 of file KNMPIManager.cpp.
References m_bStartMPI, m_nCurrentRank, and m_nTotalNode.
Referenced by CKNLanczosTest::COmpareWIthMatLabSeOrthMPI(), InitLevel(), CKNTBMS_Solver::InitMPIEnv(), CKNLanczosTest::LargeSizeMatrixMPI(), CKNGeometricConstructionLaunch::LaunchingGeometricConstructionMPI(), and CKNLanczosLaunching::LaunchingLanczos().

|
static |
Split vector to sub rank.
| pVector | Vector for want to share |
| nRootRank | Root rank index |
Definition at line 467 of file KNMPIManager.cpp.
References CKNTimeMeasurement::COMM, ConvertVectorToMPIComplexBuffer(), ERROR_MALLOC, CKNMPIManager::COMPLEX_NUMBER::fImginary, CKNMatrixOperation::CKNVector::Finalize(), CKNMPIManager::COMPLEX_NUMBER::fReal, FREE_MEM, CKNTimeMeasurement::FREE_MEM, GetCurrentLoadBalanceCount(), GetCurrentRank(), GetLoadBalanceCount(), GetTotalNodeCount(), m_mpiCommIndex, CKNTimeMeasurement::MALLOC, CKNTimeMeasurement::MeasurementEnd(), CKNTimeMeasurement::MeasurementStart(), CKNMatrixOperation::CKNVector::SetAt(), and CKNMatrixOperation::CKNVector::SetSize().

|
static |
Waiting recevinging double buffer sync function.
| req | MPI request parameter |
Definition at line 784 of file KNMPIManager.cpp.
References m_ReceiveDoubleAsyncRequest.
|
static |
Waiting sending double buffer sync function.
| req | MPI request parameter |
Definition at line 757 of file KNMPIManager.cpp.
References m_SendDoubleAsyncRequest.
|
staticprivate |
Flag for Multilevel MPI group.
Definition at line 106 of file KNMPIManager.h.
Referenced by InitLevel(), and IsMultiLevelMPI().
|
staticprivate |
|
staticprivate |
MPI_Init call or not.
Definition at line 89 of file KNMPIManager.h.
Referenced by FinalizeManager(), IsInMPIRoutine(), and SetMPIEnviroment().
|
staticprivate |
Deflation computing MPI_Comm.
Definition at line 102 of file KNMPIManager.h.
Referenced by FinalizeManager(), GatherEVFromDeflationGroup(), GatherEVIterationFromDeflationGroup(), GetDeflationComm(), GetEigenvalueCountFromDeflationGroup(), InitLevel(), and IsDeflationRoot().
|
staticprivate |
MPI Group for Deflation computation.
Definition at line 104 of file KNMPIManager.h.
Referenced by FinalizeManager(), and InitLevel().
|
staticprivate |
MPI Group for Lanczos computation.
Definition at line 103 of file KNMPIManager.h.
Referenced by FinalizeManager(), and InitLevel().
|
staticprivate |
Lanczos Method MPI_Comm.
Definition at line 101 of file KNMPIManager.h.
Referenced by AllReduceComlex(), AllReduceDouble(), Barrier(), BroadcastBool(), BroadcastDouble(), BroadcastInt(), BroadcastLanczosResult(), FinalizeManager(), GatherVDouble(), GatherVInt(), GetLanczosComputComm(), GetMPIComm(), InitLevel(), IsLanczosComputeRoot(), LoadBlancing(), MergeVector(), MergeVectorEx_Optimal(), MergeVectorOptimal(), ReceiveDoubleBufferSync(), SendDoubleBufferSync(), and SplitVector().
|
staticprivate |
|
staticprivate |
Getting Lanczos group index.
MPI Rank.
MPI Rank
Definition at line 83 of file KNMPIManager.h.
Referenced by FinalizeManager(), GetCurrentLoadBalanceCount(), GetCurrentRank(), MergeVectorEx_Optimal(), MergeVectorOptimal(), and SetMPIEnviroment().
|
staticprivate |
MPI Group index for Lanczos group.
Definition at line 105 of file KNMPIManager.h.
Referenced by InitLevel().
|
staticprivate |
MPI Level.
Definition at line 99 of file KNMPIManager.h.
|
staticprivate |
Total node count.
Definition at line 88 of file KNMPIManager.h.
Referenced by CheckDeflationNodeCount(), FinalizeManager(), GetLoadBalanceCount(), GetTotalNodeCount(), LoadBlancing(), LoadBlancingForLanczos(), MergeVectorEx_Optimal(), MergeVectorOptimal(), and SetMPIEnviroment().
|
staticprivate |
After MPI Split bank infomation.
Definition at line 95 of file KNMPIManager.h.
Referenced by FinalizeManager().
|
staticprivate |
Data buffer for MPI Communication.
Load blancing for MPI Communication.
Data buffer for MPI Communication
Definition at line 91 of file KNMPIManager.h.
|
staticprivate |
Data buffer for Vector converting.
Definition at line 92 of file KNMPIManager.h.
Referenced by ConvertVectorToMPIComplexBuffer().
|
staticprivate |
Displ for MPI comminication.
Definition at line 96 of file KNMPIManager.h.
Referenced by FinalizeManager(), InitCommunicationBufferMetric(), MergeVector(), MergeVectorEx_Optimal(), and MergeVectorOptimal().
|
staticprivate |
Load blancing for MPI Communication.
Definition at line 90 of file KNMPIManager.h.
Referenced by FinalizeManager(), GetCurrentLoadBalanceCount(), GetLoadBalanceCount(), LoadBlancing(), and LoadBlancingForLanczos().
|
staticprivate |
Reciving count variable for MPI comminication.
Definition at line 93 of file KNMPIManager.h.
Referenced by FinalizeManager(), InitCommunicationBufferMetric(), MergeVector(), MergeVectorEx_Optimal(), and MergeVectorOptimal().
|
staticprivate |
Sending count variable for MPI comminication.
Definition at line 94 of file KNMPIManager.h.
Referenced by FinalizeManager(), and InitCommunicationBufferMetric().
|
staticprivate |
Request for receving double.
Definition at line 98 of file KNMPIManager.h.
Referenced by WaitReceiveDoubleBufferAsync().
|
staticprivate |
Request for sending double.
Definition at line 97 of file KNMPIManager.h.
Referenced by WaitSendDoubleBufferSync().