#include "Common.h"
#include "FileIO.h"
#include "CalcTime.h"
#include <mpi.h>
Go to the source code of this file.
◆ InitTimer()
function for initializing Timer[] 
- Version
- 2.0 
Definition at line 53 of file time.c.
References Timer, and TimerStart.
Referenced by main().
   57   Timer       = (
double*)malloc((NTimer)*
sizeof(double));
    58   TimerStart  = (
double*)malloc((NTimer)*
sizeof(double));
    59   for(i=0;i<NTimer;i++) 
Timer[i]=0.0;
 
 
 
◆ OutputTimer()
function for outputting elapse time for each function 
- Version
- 2.0 
Definition at line 95 of file time.c.
References childfopenMPI(), D_FileNameMax, StampTime(), Timer, TimerStart, and X.
Referenced by main().
  100   sprintf(fileName, 
"CalcTimer.dat"); 
   107   if(
X->Def.iFlgCalcSpec == CALCSPEC_NOT){
   108     if(
X->Def.iCalcType==TPQCalc) {
   111       StampTime(fp, 
"      rand   in FirstMultiply", 3101);
   112       StampTime(fp, 
"      mltply in FirstMultiply", 3102);
   113       StampTime(fp, 
"    expec_energy_flct        ", 3200);
   114       StampTime(fp, 
"      calc flctuation in expec_energy_flct ", 3201);
   115       StampTime(fp, 
"      mltply in expec_energy_flct ", 3202);
   121     else if(
X->Def.iCalcType==Lanczos){
   123       StampTime(fp, 
"    LanczosEigenValue", 4100);
   124       StampTime(fp, 
"      mltply      in LanczosEigenValue", 4101);
   125       StampTime(fp, 
"      vec12       in LanczosEigenValue", 4102);
   126       StampTime(fp, 
"      DSEVvalue   in LanczosEigenValue", 4103);
   127       StampTime(fp, 
"    LanczosEigenVector", 4200);
   128       StampTime(fp, 
"      mltply      in LanczosEigenVector", 4201);
   129       StampTime(fp, 
"    expec_energy_flct", 4300);
   130       StampTime(fp, 
"      calc flctuation in expec_energy_flct ", 4301);
   131       StampTime(fp, 
"      mltply in expec_energy_flct ", 4302);
   133       StampTime(fp, 
"      mltply in CGEigenVector ", 4401);
   138       StampTime(fp, 
"      Read Input Eigenvec ", 4801);    
   140     else if(
X->Def.iCalcType==FullDiag){
   145     StampTime(fp, 
"      calc flctuation in expec_energy_flct ", 5301);
   146     StampTime(fp, 
"      mltply in expec_energy_flct ", 5302);
   152     StampTime(fp, 
"  CalcSpectrum by Lanczos method", 6000);
   153     StampTime(fp, 
"    Make excited state", 6100);
   154     StampTime(fp, 
"      Read origin state", 6101);
   155     StampTime(fp, 
"      Multiply excited operator", 6102);
   156     StampTime(fp, 
"    Calculate spectrum", 6200);
   157     if(
X->Def.iCalcType==Lanczos){
   158       StampTime(fp, 
"      Read vector for recalculation", 6201);
   159       StampTime(fp, 
"      Read tridiagonal components for recalculation", 6202);
   160       StampTime(fp, 
"      Calculate tridiagonal components", 6203);
   161       StampTime(fp, 
"      Output tridiagonal components", 6204);
   162       StampTime(fp, 
"      Calculate spectrum by Lanczos method", 6205);
   163       StampTime(fp, 
"      Output vectors for recalculation", 6206);
   165     else if(
X->Def.iCalcType==FullDiag){
   169       StampTime(fp, 
"      Calculate spectrum", 6304);
   173   fprintf(fp,
"================================================\n");
   178   switch(
X->Def.iCalcModel){
   181     StampTime(fp,
"    trans    in HubbardGC", 210);
   185     StampTime(fp,
"    interall in HubbardGC", 220);
   188     StampTime(fp,
"    pairhopp in HubbardGC", 230);
   191     StampTime(fp,
"    exchange in HubbardGC", 240);
   202     StampTime(fp,
"    interall in Hubbard", 320);
   205     StampTime(fp,
"    pairhopp in Hubbard", 330);
   208     StampTime(fp,
"    exchange in Hubbard", 340);
   233     StampTime(fp,
"    interall in SpinGC", 520);
   237     StampTime(fp,
"    exchange in SpinGC", 530);
   241     StampTime(fp,
"    pairlift in SpinGC", 540);
   250   fprintf(fp,
"================================================\n");
 
int childfopenMPI(const char *_cPathChild, const char *_cmode, FILE **_fp)
Only the root process open file in output/ directory. 
void StampTime(FILE *fp, char *str, int num)
function for displaying elapse time 
 
 
◆ StampTime()
      
        
          | void StampTime | ( | FILE * | fp, | 
        
          |  |  | char * | str, | 
        
          |  |  | int | num | 
        
          |  | ) |  |  | 
      
 
function for displaying elapse time 
- Version
- 2.0 
Definition at line 39 of file time.c.
References Timer.
Referenced by OutputTimer().
   42   sprintf(str1, 
"%-50s [%04d] %12.5lf\n", str, num, 
Timer[num]);
    43   fprintf(fp, 
"%s", str1);
 
 
 
◆ StartTimer()
function for initializing elapse time [start] 
- Version
- 2.0 
Definition at line 71 of file time.c.
References TimerStart.
Referenced by CalcByFullDiag(), CalcByLanczos(), CalcByTPQ(), CalcSpectrum(), CalcSpectrumByFullDiag(), CG_EigenVector(), expec_energy_flct(), Lanczos_EigenValue(), Lanczos_EigenVector(), main(), mltply(), mltplyGeneralSpin(), mltplyGeneralSpinGC(), mltplyHalfSpin(), mltplyHalfSpinGC(), mltplyHubbard(), mltplyHubbardGC(), and mltplySpinGCBoost().
 
 
◆ StopTimer()
function for calculating elapse time [elapse time=StartTimer-StopTimer] 
- Version
- 2.0 
Definition at line 83 of file time.c.
References Timer, and TimerStart.
Referenced by CalcByFullDiag(), CalcByLanczos(), CalcByTPQ(), CalcSpectrum(), CalcSpectrumByFullDiag(), CG_EigenVector(), expec_energy_flct(), Lanczos_EigenValue(), Lanczos_EigenVector(), main(), mltply(), mltplyGeneralSpin(), mltplyGeneralSpinGC(), mltplyHalfSpin(), mltplyHalfSpinGC(), mltplyHubbard(), mltplyHubbardGC(), and mltplySpinGCBoost().