19 #include <HPhiTrans.hpp> 20 #include <output_list.hpp> 21 #include <diagonalcalc.hpp> 22 #include <CalcByLOBPCG.hpp> 23 #include <CalcByFullDiag.hpp> 24 #include <CalcByTPQ.hpp> 25 #include <CalcSpectrum.hpp> 27 #include "CalcByTEM.hpp" 28 #include "readdef.hpp" 29 #include "StdFace_main.hpp" 30 #include "wrapperMPI.hpp" 32 #include "CalcTime.hpp" 33 #include "common/setmemory.hpp" 177 int main(
int argc,
char* argv[]){
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");
229 fprintf(stdoutMPI,
"%s",
"Error: nvec should be smaller than exct are incorrect.\n");
230 fprintf(stdoutMPI,
"Error: nvec = %d, exct=%d.\n",
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");
268 fprintf(stdoutMPI,
"Error: Fail for memory allocation.");
296 fprintf(stdoutMPI,
"Error: Full Diagonalization by LAPACK is only allowed for one process.\n");
void exitMPI(int errorcode)
MPI Abortation wrapper.
void SetConvergenceFactor(struct DefineList *X)
function to set convergence factors
struct DefineList Def
Definision of system (Hamiltonian) etc.
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 main(int argc, char *argv[])
Main program for HPhi.
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 nvec
Read from Calcmod in readdef.h.
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 iFlgScaLAPACK
ScaLAPACK mode ( only for FullDiag )
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[]
struct BoostList Boost
For Boost.
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 WRITE
It is ALWAYS 0 ???
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...
int iFlgCalcSpec
Input parameter CalcSpec in teh CalcMod file.
int k_exct
Read from Calcmod in readdef.h.
struct BindStruct Bind
Binded struct.
int iCalcType
Switch for calculation type. 0:Lanczos, 1:TPQCalc, 2:FullDiag.
void StartTimer(int n)
function for initializing elapse time [start]
int CalcByFullDiag(struct EDMainCalStruct *X)
Parent function for FullDiag mode.