Main program for HPhi.
180 char cFileListName[D_FileNameMax];
188 if (mode == STANDARD_DRY_MODE) {
203 if (stat(
"./output/", &tmpst) != 0) {
204 if (mkdir(
"./output/", 0777) != 0) {
205 fprintf(stdoutMPI,
"%s",
"Error: Fail to make output folder in current directory. \n");
211 strcpy(cFileListName, argv[2]);
213 if(mode==STANDARD_MODE || mode == STANDARD_DRY_MODE){
215 strcpy(cFileListName,
"namelist.def");
216 if (mode == STANDARD_DRY_MODE){
217 fprintf(stdout,
"Dry run is Finished. \n\n");
224 fprintf(stdoutMPI,
"%s",
"Error: Definition files(*.def) are incomplete.\n");
228 if (X.Bind.Def.nvec < X.Bind.Def.k_exct){
229 fprintf(stdoutMPI,
"%s",
"Error: nvec should be smaller than exct are incorrect.\n");
230 fprintf(stdoutMPI,
"Error: nvec = %d, exct=%d.\n",
231 X.Bind.Def.nvec, X.Bind.Def.k_exct);
234 fprintf(stdoutMPI,
"%s",
"\n###### Definition files are correct. ######\n\n");
241 TimeKeeper(&(X.Bind),
"%s_TimeKeeper.dat",
"Read File starts: %s",
"w");
244 "Error: Indices and Parameters of Definition files(*.def) are incomplete.\n");
247 TimeKeeper(&(X.Bind),
"%s_TimeKeeper.dat",
"Read File finishes: %s",
"a");
248 fprintf(stdoutMPI,
"%s",
"\n###### Indices and Parameters of Definition files(*.def) are complete. ######\n\n");
259 if(X.Bind.Def.iFlgCalcSpec == CALCSPEC_NOT ||
260 X.Bind.Def.iFlgCalcSpec == CALCSPEC_SCRATCH) {
262 if(
check(&(X.Bind))==MPIFALSE){
268 fprintf(stdoutMPI,
"Error: Fail for memory allocation.");
278 if(X.Bind.Def.WRITE==1){
286 switch (X.Bind.Def.iCalcType) {
295 if (X.Bind.Def.iFlgScaLAPACK == 0 &&
nproc != 1) {
296 fprintf(stdoutMPI,
"Error: Full Diagonalization by LAPACK is only allowed for one process.\n");
315 if (
CalcByTEM(X.Bind.Def.Param.ExpecInterval, &X) != 0) {
326 if(X.Bind.Def.iFlgCalcSpec != CALCSPEC_NOT){
void exitMPI(int errorcode)
MPI Abortation wrapper.
void SetConvergenceFactor(struct DefineList *X)
function to set convergence factors
int nproc
Number of processors, defined in InitializeMPI()
int JudgeDefType(const int argc, char *argv[], int *mode)
function of judging a type of define files.
int HPhiTrans(struct BindStruct *X)
Function of checking transfers not to count the same type of operators. .
FILE * stdoutMPI
File pointer to the standard output defined in InitializeMPI()
void FinalizeMPI()
MPI Finitialization wrapper.
void splash()
Print logo mark and version number.
int CalcByTEM(const int ExpecInterval, struct EDMainCalStruct *X)
main function of time evolution calculation
int output_list(struct BindStruct *X)
Output list_1 for canonical ensembles.
int CalcByLOBPCG(struct EDMainCalStruct *X)
Driver routine for LOB(P)CG method.
void setmem_HEAD(struct BindStruct *X)
Set size of memories headers of output files.
int diagonalcalc(struct BindStruct *X)
Calculate diagonal components and obtain the list, list_diagonal.
void StdFace_main(char *fname)
Main routine for the standard mode.
int sz(struct BindStruct *X, long int *list_1_, long int *list_2_1_, long int *list_2_2_)
generating Hilbert space
void InitTimer()
function for initializing Timer[]
void InitializeMPI(int argc, char *argv[])
MPI initialization wrapper Process ID (myrank), Number of processes (nproc), Number of threads (nthre...
void setmem_def(struct BindStruct *X, struct BoostList *xBoost)
Set size of memories for Def and Phys in BindStruct.
int myrank
Process ID, defined in InitializeMPI()
void OutputTimer(struct BindStruct *X)
function for outputting elapse time for each function
int CalcByTPQ(const int NumAve, const int ExpecInterval, struct EDMainCalStruct *X)
A main function to calculate physical quqntities by TPQ method.
void StopTimer(int n)
function for calculating elapse time [elapse time=StartTimer-StopTimer]
int CalcSpectrum(struct EDMainCalStruct *X)
A main function to calculate spectrum.
int check(struct BindStruct *X)
A program to check size of dimension for Hilbert-space.
int ReadDefFileIdxPara(struct DefineList *X, struct BoostList *xBoost)
function of reading def files to get keyword index
int setmem_large(struct BindStruct *X)
Set size of memories for vectors(vg, v0, v1, v2, vec, alpha, beta), lists (list_1, list_2_1, list_2_2, list_Diagonal) and Phys(BindStruct.PhysList) struct in the case of Full Diag mode.
int TimeKeeper(struct BindStruct *X, const char *cFileName, const char *cTimeKeeper_Message, const char *cWriteType)
Functions for writing a time log.
int ReadDefFileNInt(char *xNameListFile, struct DefineList *X, struct BoostList *xBoost)
Function of reading information about "ModPara" file and total number of parameters from other def fi...
void StartTimer(int n)
function for initializing elapse time [start]
int CalcByFullDiag(struct EDMainCalStruct *X)
Parent function for FullDiag mode.