IPCC  1.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
CKNGeometricConstructionLaunch Class Reference

#include "KNGeometricConstructionLaunch.h"

Collaboration diagram for CKNGeometricConstructionLaunch:
Collaboration graph

Public Member Functions

 CKNGeometricConstructionLaunch ()
 
 ~CKNGeometricConstructionLaunch ()
 

Static Public Member Functions

static CKNMatrixOperation::CKNCSRLaunchingGeometricConstruction (char *pszInputCommnadFileName, CKNGeometricShape *pShape, CKNCommandFileParser::LPINPUT_CMD_PARAM *lpParam, bool bReturnCSR)
 
static void LaunchingGeometricConstructionMPI (char *pszInputCommnadFileName, CKNGeometricShape *pShape, bool bReturnCSR)
 
static void SetShapeInformation (CKNGeometricShape &shape, CKNCommandFileParser::LPINPUT_CMD_PARAM lpParam)
 
static void SetUnitCellInformation (CKNCommandFileParser::LPINPUT_CMD_PARAM lpParam)
 

Detailed Description

Definition at line 6 of file KNGeometricConstructionLaunch.h.

Constructor & Destructor Documentation

CKNGeometricConstructionLaunch::CKNGeometricConstructionLaunch ( )

Definition at line 12 of file KNGeometricConstructionLaunch.cpp.

13 {
14 }
CKNGeometricConstructionLaunch::~CKNGeometricConstructionLaunch ( )

Definition at line 17 of file KNGeometricConstructionLaunch.cpp.

18 {
19 }

Member Function Documentation

CKNMatrixOperation::CKNCSR * CKNGeometricConstructionLaunch::LaunchingGeometricConstruction ( char *  pszInputCommnadFileName,
CKNGeometricShape pShape,
CKNCommandFileParser::LPINPUT_CMD_PARAM lpParam,
bool  bReturnCSR 
)
static

< MPIÀÇ °æ¿ì ¿©±â¼­ Àüü À妽º¸¦ Á¶Á¤ÇØ¾ß ÇÑ´Ù.

Definition at line 117 of file KNGeometricConstructionLaunch.cpp.

References CKNMatrixOperation::CKNCSR::BuildDataBuffer(), CKNGeometricShape::FillUnitcell(), NEIGHBOR_MAP_INFO::fItemCount, CKNGeometricShape::FreeMapInfo(), CKNCommandFileParser::ParsingInputCommand(), CKNGeometricShape::PeriodicUnitCellNumbering(), CKNMatrixOperation::CKNCSR::SetColumnCount(), CKNMatrixOperation::CKNCSR::SetRowCount(), SetShapeInformation(), and SetUnitCellInformation().

118 {
119  NEIGHBOR_MAP_INFO mapInfo;
120  PERIODIC_INFO periodicInfo;
121  CKNMatrixOperation::CKNCSR *pResult = NULL;
122  CKNGeometricShape shape, *pShapeOperand;
123 
124  *lpParam = CKNCommandFileParser::ParsingInputCommand(pszInputCommnadFileName);
125 
126 
127  /*CKNMatrixOperation::CKNCSR *pCSR = new CKNMatrixOperation::CKNCSR();
128  if (NULL == pCSR)
129  return pResult;*/
130 
131  if (NULL == *lpParam)
132  return pResult;
133 
134  if (NULL != pShape)
135  pShapeOperand = pShape;
136  else
137  pShapeOperand = &shape;
138 
139  SetShapeInformation(*pShapeOperand, *lpParam);
140  SetUnitCellInformation(*lpParam);
141  pShapeOperand->FillUnitcell();
143  pShapeOperand->PeriodicUnitCellNumbering();
144  pShapeOperand->BuildNeighborMap();
145  mapInfo.fItemCount = 0;
146  pShapeOperand->BuildNeighborMapInfo(&mapInfo, true);
147  if (bReturnCSR)
148  {
149 #ifdef DISABLE_MPI_ROUTINE
150  //pResult = BuildDumyMatrix(mapInfo.fItemCount * 10, mapInfo.fItemCount * 10);
151  pResult = new CKNMatrixOperation::CKNCSR();
152 
153  pResult->SetRowCount(mapInfo.fItemCount * 10);
154  pResult->SetColumnCount(mapInfo.fItemCount * 10);
155  pResult->BuildDataBuffer();
156 #else //DISABLE_MPI_ROUTINE
157 #endif //DISABLE_MPI_ROUTINE
158  if (NULL == pResult)
159  return pResult;
160  pShapeOperand->BuildHamiltonian(*lpParam, &mapInfo, pResult);
161  }
162 
163  pShapeOperand->FreeMapInfo(&mapInfo);
164  //free(lpParam);
165 
166  return pResult;
167 }
static void FreeMapInfo(LPNEIGHBOR_MAP_INFO lpMapInfo)
Release mapinfo data.
static void SetShapeInformation(CKNGeometricShape &shape, CKNCommandFileParser::LPINPUT_CMD_PARAM lpParam)
Data and operation representation of CSR(Compressed Sparse Row)
void BuildDataBuffer()
Allocating memory for class member variable.
static LPINPUT_CMD_PARAM ParsingInputCommand(char *pszInputCommnadFileName)
Parsing Commaind file.
Class for Geometric shape.
static void SetUnitCellInformation(CKNCommandFileParser::LPINPUT_CMD_PARAM lpParam)
double fItemCount
Item count at atom map.
bool FillUnitcell(CKNCommandFileParser::LPINPUT_CMD_PARAM lpParam)
Set bondary condition of shape.
void PeriodicUnitCellNumbering(bool bXAxis=false)
Numbering to periodic unitcell.
void SetRowCount(unsigned int nRow)
Settting row size of matrix.
void SetColumnCount(unsigned int nColumn)
Settting column size of matrix.
Structure for neighbor information.

Here is the call graph for this function:

void CKNGeometricConstructionLaunch::LaunchingGeometricConstructionMPI ( char *  pszInputCommnadFileName,
CKNGeometricShape pShape,
bool  bReturnCSR 
)
static

< For template using

< MPIÀÇ °æ¿ì ¿©±â¼­ Àüü À妽º¸¦ Á¶Á¤ÇØ¾ß ÇÑ´Ù.

TEMP

Definition at line 32 of file KNGeometricConstructionLaunch.cpp.

References CKNCommandFileParser::INPUT_CMD_PARAM::bConsiderBoundaryCondition, CKNGeometricShape::ExchangeAtomInfoBetweenNode(), CKNGeometricShape::FillUnitcell(), CKNMPIManager::FinalizeManager(), CKNCommandFileParser::INPUT_CMD_PARAM::fShapeLength, CKNCommandFileParser::INPUT_CMD_PARAM::fUnitcellLength, getCurrentTime(), CKNMPIManager::InitCommunicationBufferMetric(), CKNMPIManager::IsRootRank(), CKNMPIManager::LoadBlancingForLanczos(), CKNCommandFileParser::INPUT_CMD_PARAM::nMatrixDemension, CKNCommandFileParser::ParsingInputCommand(), CKNGeometricShape::PeriodicUnitCellNumbering(), CKNMPIManager::SetMPIEnviroment(), SetShapeInformation(), SetUnitCellInformation(), and CKNMatrixDebug::ShowMsg().

33 {
34  NEIGHBOR_MAP_INFO mapInfo;
35  PERIODIC_INFO periodicInfo;
36  CKNMatrixOperation::CKNCSR *pResult = NULL;
38  if (NULL == lpParam)
39  return;
40  char szMsg[1024];
41  CKNGeometricShape shape, *pShapeOperand;
42 
43  if (NULL != pShape)
44  pShapeOperand = pShape;
45  else
46  pShapeOperand = &shape;
47 
48  MPI_Init(NULL, NULL);
49 
50  int world_size;
51  MPI_Comm_size(MPI_COMM_WORLD, &world_size);
52 
53  int rank;
54  MPI_Comm_rank(MPI_COMM_WORLD, &rank);
55 
56  CKNMPIManager::SetMPIEnviroment(rank, world_size);
59 
61  {
62  char szTime[1024];
63  getCurrentTime(szTime);
64  sprintf(szMsg, "\n-Start Geomatric Construction - [%s]\n", szTime);
66  }
67 
69 
70  lpParam->fUnitcellLength[CKNGeometricShape::LX] = 1;
71  lpParam->fUnitcellLength[CKNGeometricShape::LY] = 1;
72  lpParam->fUnitcellLength[CKNGeometricShape::LZ] = 1;
73  //lpParam->fUnitcellLength = 0.5430950;
74  lpParam->bConsiderBoundaryCondition[CKNGeometricShape::LX] = false;
75  lpParam->bConsiderBoundaryCondition[CKNGeometricShape::LY] = false;
76  lpParam->bConsiderBoundaryCondition[CKNGeometricShape::LZ] = false;
77  lpParam->bConsiderBoundaryCondition[CKNGeometricShape::LX] = true;
78  lpParam->bConsiderBoundaryCondition[CKNGeometricShape::LY] = true;
79  lpParam->bConsiderBoundaryCondition[CKNGeometricShape::LZ] = true;
80  lpParam->fShapeLength[CKNGeometricShape::LX] = 6.;
81  lpParam->fShapeLength[CKNGeometricShape::LY] = 6.;
82  lpParam->fShapeLength[CKNGeometricShape::LZ] = 6.;
84 
85  try{
86  SetShapeInformation(*pShapeOperand, lpParam);
87  SetUnitCellInformation(lpParam);
88  pShapeOperand->FillUnitcell();
90 #ifndef DISABLE_MPI_ROUTINE
91  pShapeOperand->ExchangeAtomInfoBetweenNode();
92 #endif //DISABLE_MPI_ROUTINE
93  pShapeOperand->PeriodicUnitCellNumbering();
94  pShapeOperand->BuildNeighborMap();
95  pShapeOperand->BuildNeighborMapInfo(&mapInfo, false);
96  if (bReturnCSR)
97  {
98  pShapeOperand->BuildHamiltonian(lpParam, &mapInfo, pResult);
99  }
100  }
101  catch (unsigned long dwError)
102  {
103  switch (dwError)
104  {
105  case ERROR_LOAD_BLANCING_FAIL:
106  CKNMatrixDebug::ShowMsg("Rank is too much for current shape!\n");
107  break;
108  }
109  }
110 
111  free(lpParam);
112 
114  MPI_Finalize();
115 }
static void InitCommunicationBufferMetric()
Initializing MPI Communication buffer for MVMul.
static void FinalizeManager()
Get Root rank.
void ExchangeAtomInfoBetweenNode()
Get start index of atom in shape, using in MPI running enviroment.
static void SetMPIEnviroment(int nRank, int nTotalNode)
Set MPI Enviroment.
void getCurrentTime(char *pszBuffer)
static void SetShapeInformation(CKNGeometricShape &shape, CKNCommandFileParser::LPINPUT_CMD_PARAM lpParam)
Data and operation representation of CSR(Compressed Sparse Row)
static LPINPUT_CMD_PARAM ParsingInputCommand(char *pszInputCommnadFileName)
Parsing Commaind file.
Class for Geometric shape.
static void SetUnitCellInformation(CKNCommandFileParser::LPINPUT_CMD_PARAM lpParam)
Structure for save input command file parsing result.
double fShapeLength[NMAXDOMAIN][3]
Shap length x, y, z, direction.
bool FillUnitcell(CKNCommandFileParser::LPINPUT_CMD_PARAM lpParam)
Set bondary condition of shape.
double fUnitcellLength[3]
Unitcell length x, y, z direction.
static void ShowMsg(char *pszBuffer)
Show message.
void PeriodicUnitCellNumbering(bool bXAxis=false)
Numbering to periodic unitcell.
static void LoadBlancingForLanczos(int nRowCount)
Load blancing for MPI, this function only for lanczos solving without geometric constrcution.
static bool IsRootRank()
Get Total node count.
int nMatrixDemension
Hamiltonian matrix demension.
Structure for neighbor information.
bool bConsiderBoundaryCondition[3]
Considering bondary condition or not x, y, z direction.

Here is the call graph for this function:

void CKNGeometricConstructionLaunch::SetShapeInformation ( CKNGeometricShape shape,
CKNCommandFileParser::LPINPUT_CMD_PARAM  lpParam 
)
static

Definition at line 169 of file KNGeometricConstructionLaunch.cpp.

References CKNCommandFileParser::INPUT_CMD_PARAM::bConsiderBoundaryCondition, CKNCommandFileParser::INPUT_CMD_PARAM::fOrigin, CKNCommandFileParser::INPUT_CMD_PARAM::fShapeLength, CKNMPIManager::GetCurrentRank(), CKNMPIManager::GetTotalNodeCount(), CKNMPIManager::IsRootRank(), CKNGeometricShape::SetBackendFace(), CKNGeometricShape::SetConsideringBoundaryCondition(), CKNGeometricShape::SetDirection(), CKNGeometricShape::SetFrontFace(), CKNGeometricShape::SetLength(), CKNGeometricShape::SetMaterialType(), CKNGeometricShape::SetOriginCoordination(), CKNGeometricShape::SetShapeForm(), and CKNCommandFileParser::INPUT_CMD_PARAM::szDomainMat.

Referenced by LaunchingGeometricConstruction(), and LaunchingGeometricConstructionMPI().

170 {
171 
172  shape.SetDirection(1, 0, 0);
173  shape.SetLength(lpParam->fShapeLength[CKNGeometricShape::LX], lpParam->fShapeLength[CKNGeometricShape::LY], lpParam->fShapeLength[CKNGeometricShape::LZ]);
174  shape.SetOriginCoordination(lpParam->fOrigin[CKNGeometricShape::LX], lpParam->fOrigin[CKNGeometricShape::LY], lpParam->fOrigin[CKNGeometricShape::LZ]);
175  shape.SetMaterialType(lpParam->szDomainMat);
176  shape.SetShapeForm(CKNGeometricShape::BOX);
177  shape.SetConsideringBoundaryCondition(lpParam->bConsiderBoundaryCondition[CKNGeometricShape::LX], CKNGeometricShape::LX);
178  shape.SetConsideringBoundaryCondition(lpParam->bConsiderBoundaryCondition[CKNGeometricShape::LY], CKNGeometricShape::LY);
179  shape.SetConsideringBoundaryCondition(lpParam->bConsiderBoundaryCondition[CKNGeometricShape::LZ], CKNGeometricShape::LZ);
180 #ifdef DISABLE_MPI_ROUTINE
181  shape.SetFrontFace(true);
182  shape.SetBackendFace(true);
183 #else //DISABLE_MPI_ROUTINE
185  shape.SetFrontFace(true);
187  shape.SetBackendFace(true);
188 #endif //DISABLE_MPI_ROUTINE
189 }
void SetMaterialType(MATERIAL_INDEX type)
Get maetrial typpe of shap.
void SetConsideringBoundaryCondition(bool bConsider, AXIS_DEFINE direction)
Get bondary condition of shape.
void SetOriginCoordination(double x, double y, double z)
Building Geometric part.
void SetDirection(double x_axis, double y_axis, double z_axis)
Set direciton of shape.
void SetLength(double lx, double ly, double lz)
Set length of shape.
static int GetTotalNodeCount()
Definition: KNMPIManager.h:44
double fShapeLength[NMAXDOMAIN][3]
Shap length x, y, z, direction.
char szDomainMat[NMAXDOMAIN][1024]
Material type.
void SetBackendFace(bool bBackendFace)
Check is this back end face side in MPI running enviroment.
void SetShapeForm(unsigned int form)
Get form type of shape.
void SetFrontFace(bool bFrontFace)
Check is this front face side in MPI running enviroment.
static int GetCurrentRank()
Definition: KNMPIManager.h:42
static bool IsRootRank()
Get Total node count.
bool bConsiderBoundaryCondition[3]
Considering bondary condition or not x, y, z direction.
double fOrigin[NMAXDOMAIN][3]
Coordinator original coordinate.

Here is the call graph for this function:

Here is the caller graph for this function:

void CKNGeometricConstructionLaunch::SetUnitCellInformation ( CKNCommandFileParser::LPINPUT_CMD_PARAM  lpParam)
static

< µ¥ÀÌÅ͸¦ ÀÐ¾î µéÀÌ´Â ºÎºÐÀº ¿ì¼± ¹«½Ã°í Àӽ÷Πµ¥ÀÌÅ͸¦ ÀÔ·ÂÇÏ¿© ÁøÇàÇÑ´Ù.

Definition at line 191 of file KNGeometricConstructionLaunch.cpp.

References CKNGeometricAtom::A, CKNGeometricAtom::A2C, CKNGeometricAtom::C, CKNGeometricAtom::C2A, CKNCommandFileParser::INPUT_CMD_PARAM::fUnitcellLength, CKNGeometricAtomFactory::SetAtomCoordination(), CKNGeometricUnitCell::SetLength(), and CKNGeometricAtomFactory::SetNeighborCoordination().

Referenced by LaunchingGeometricConstruction(), and LaunchingGeometricConstructionMPI().

192 {
194 
199 
204 
209 
214 
216 
217 }
static void SetNeighborCoordination(CKNGeometricAtom::NEIGHOR_RELATION type, double x, double y, double z)
Setting neighbor coordination.
static void SetAtomCoordination(CKNGeometricAtom::ATOM_TYPE type, double x, double y, double z)
Setting atom coordination.
double fUnitcellLength[3]
Unitcell length x, y, z direction.
static void SetLength(double fLength[3], double fOriginLength[3])
Set unit cell length.

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following files: