Skip to content

Commit

Permalink
Merge pull request #52 from issp-center-dev/release
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
k-yoshimi authored Oct 25, 2018
2 parents 30d0791 + fbce5ab commit bdf7d22
Show file tree
Hide file tree
Showing 11 changed files with 3,483 additions and 3,461 deletions.
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,10 @@ if(CMAKE_C_COMPILER_ID STREQUAL "Intel")
else()
set(OMP_FLAG_Intel "-qopenmp")
endif()
add_definitions(-D_OPENMP)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OMP_FLAG_Intel}")
else()
find_package(OpenMP)
if(OPENMP_FOUND)
add_definitions(-D_OPENMP)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
endif(OPENMP_FOUND)
endif()
Expand Down
12 changes: 9 additions & 3 deletions src/CalcByLOBPCG.c
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,11 @@ int LOBPCG_Main(
/**@brief
<li>Output resulting vectors for restart</li>
*/
if (X->Def.iReStart == RESTART_OUT || X->Def.iReStart == RESTART_INOUT) Output_restart(X, wxp[1]);
if (X->Def.iReStart == RESTART_OUT || X->Def.iReStart == RESTART_INOUT){
Output_restart(X, wxp[1]);
sprintf(sdt, "%s", cLogLanczos_EigenValueNotConverged);
return 1;
}
/**@brief
<li>Just Move wxp[1] into ::L_vec. The latter must be start from 0-index (the same as FullDiag)</li>
</ul>
Expand Down Expand Up @@ -674,9 +678,11 @@ int CalcByLOBPCG(
exitMPI(-1);
}

if (LOBPCG_Main(&(X->Bind)) != 0) {
int iret = LOBPCG_Main(&(X->Bind));
if (iret != 0) {
fprintf(stdoutMPI, " LOBPCG is not converged in this process.\n");
return(FALSE);
if(iret ==1) return (TRUE);
else return(FALSE);
}
}/*if (X->Bind.Def.iInputEigenVec == FALSE)*/
else {// X->Bind.Def.iInputEigenVec=true :input v1:
Expand Down
3 changes: 2 additions & 1 deletion src/CalcByLanczos.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ int CalcByLanczos(
int iret=0;
iret=Lanczos_EigenValue(&(X->Bind));
StopTimer(4100);
if(iret != 0) return(FALSE);
if(iret == 1) return(TRUE);//restart mode.
else if(iret != 0) return(FALSE);

if(X->Bind.Def.iCalcEigenVec==CALCVEC_NOT){
fprintf(stdoutMPI, " Lanczos EigenValue = %.10lf \n ",X->Bind.Phys.Target_energy);
Expand Down
41 changes: 15 additions & 26 deletions src/HPhiMain.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,8 @@ int main(int argc, char* argv[]){

stdoutMPI = stdout;
if(JudgeDefType(argc, argv, &mode)!=0){
FinalizeMPI();
return 0;
}
exitMPI(-1);
}

if (mode == STANDARD_DRY_MODE) {
myrank = 0;
Expand Down Expand Up @@ -222,16 +221,14 @@ int main(int argc, char* argv[]){
setmem_HEAD(&X.Bind);
if(ReadDefFileNInt(cFileListName, &(X.Bind.Def), &(X.Bind.Boost))!=0){
fprintf(stdoutMPI, "%s", cErrDefFile);
FinalizeMPI();
return -1;
exitMPI(-1);
}

if (X.Bind.Def.nvec < X.Bind.Def.k_exct){
fprintf(stdoutMPI, "%s", cErrnvec);
fprintf(stdoutMPI, cErrnvecShow, X.Bind.Def.nvec, X.Bind.Def.k_exct);
FinalizeMPI();
return -1;
}
exitMPI(-1);
}
fprintf(stdoutMPI, "%s", cProFinishDefFiles);

/*ALLOCATE-------------------------------------------*/
Expand All @@ -242,8 +239,7 @@ int main(int argc, char* argv[]){
TimeKeeper(&(X.Bind), cFileNameTimeKeep, cReadDefStart, "w");
if(ReadDefFileIdxPara(&(X.Bind.Def), &(X.Bind.Boost))!=0){
fprintf(stdoutMPI, "%s", cErrIndices);
FinalizeMPI();
return -1;
exitMPI(-1);
}
TimeKeeper(&(X.Bind), cFileNameTimeKeep, cReadDefFinish, "a");
fprintf(stdoutMPI, "%s", cProFinishDefCheck);
Expand All @@ -260,8 +256,7 @@ int main(int argc, char* argv[]){
if(X.Bind.Def.iFlgCalcSpec == CALCSPEC_NOT) {

if(check(&(X.Bind))==MPIFALSE){
FinalizeMPI();
return -1;
exitMPI(-1);
}

/*LARGE VECTORS ARE ALLOCATED*/
Expand All @@ -278,8 +273,7 @@ int main(int argc, char* argv[]){
StopTimer(1000);
if(X.Bind.Def.WRITE==1){
output_list(&(X.Bind));
FinalizeMPI();
return 0;
exitMPI(-2);
}
StartTimer(2000);
diagonalcalc(&(X.Bind));
Expand All @@ -289,17 +283,15 @@ int main(int argc, char* argv[]){
case Lanczos:
StartTimer(4000);
if (CalcByLanczos(&X) != TRUE) {
FinalizeMPI();
StopTimer(4000);
return 0;
exitMPI(-3);
}
StopTimer(4000);
break;

case CG:
if (CalcByLOBPCG(&X) != TRUE) {
FinalizeMPI();
return 0;
exitMPI(-3);
}
break;

Expand All @@ -318,31 +310,28 @@ int main(int argc, char* argv[]){
case TPQCalc:
StartTimer(3000);
if (CalcByTPQ(NumAve, X.Bind.Def.Param.ExpecInterval, &X) != TRUE) {
FinalizeMPI();
StopTimer(3000);
return 0;
exitMPI(-3);
}
StopTimer(3000);
break;

case TimeEvolution:
if(CalcByTEM(X.Bind.Def.Param.ExpecInterval, &X)!=0){
FinalizeMPI();
return 0;
exitMPI(-3);
}
break;

default:
FinalizeMPI();
StopTimer(0);
return 0;
exitMPI(-3);
}
}
else{
StartTimer(6000);
if (CalcSpectrum(&X) != TRUE) {
FinalizeMPI();
StopTimer(6000);
return 0;
exitMPI(-3);
}
StopTimer(6000);
}
Expand Down
4 changes: 3 additions & 1 deletion src/Lanczos_EigenValue.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,9 @@ int Lanczos_EigenValue(struct BindStruct *X) {
OutputTMComponents(X, alpha, beta, dnorm, stp - 1);
OutputLanczosVector(X, v0, v1, stp - 1);
}
//return 0;
sprintf(sdt, "%s", cLogLanczos_EigenValueNotConverged);
fprintf(stdoutMPI, " Lanczos Eigenvalue is not converged in this process.\n");
return 1;
}

sprintf(sdt, cFileNameTimeKeep, X->Def.CDataFileHead);
Expand Down
2 changes: 1 addition & 1 deletion src/include/version_patch.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0
2
2 changes: 1 addition & 1 deletion src/mltplyMPISpin.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ void GC_child_general_int_GeneralSpin_MPIdouble(
}
else if (X->Def.InterAll_OffDiagonal[i_int][1] != X->Def.InterAll_OffDiagonal[i_int][3] &&
X->Def.InterAll_OffDiagonal[i_int][5] == X->Def.InterAll_OffDiagonal[i_int][7]) {
dam_pr = X_GC_child_CisAitCjuAju_GeneralSpin_MPIsingle(
dam_pr = X_GC_child_CisAitCjuAju_GeneralSpin_MPIdouble(
X->Def.InterAll_OffDiagonal[i_int][0], X->Def.InterAll_OffDiagonal[i_int][1],
X->Def.InterAll_OffDiagonal[i_int][3], X->Def.InterAll_OffDiagonal[i_int][4],
X->Def.InterAll_OffDiagonal[i_int][5], X->Def.ParaInterAll_OffDiagonal[i_int], X, tmp_v0, tmp_v1);
Expand Down
67 changes: 35 additions & 32 deletions src/mltplyMPISpinCore.c
Original file line number Diff line number Diff line change
Expand Up @@ -842,30 +842,23 @@ double complex X_GC_child_CisAisCjuAjv_GeneralSpin_MPIdouble(
return 0.0;
}

if (GetOffCompGeneralSpin((unsigned long int) myrank, org_isite3 + 1, org_ispin4, org_ispin3,
&off, X->Def.SiteToBit, X->Def.Tpow) == TRUE) {
if (BitCheckGeneral(off, org_isite1 + 1, org_ispin1, X->Def.SiteToBit, X->Def.Tpow) == TRUE) {
tmp_V = tmp_J;
}
else {
ihermite = FALSE;
}
}
if (BitCheckGeneral(myrank, org_isite1 + 1, org_ispin1, X->Def.SiteToBit, X->Def.Tpow) == TRUE
&& GetOffCompGeneralSpin((unsigned long int) myrank, org_isite3 + 1, org_ispin3, org_ispin4,
&off, X->Def.SiteToBit, X->Def.Tpow) == TRUE)
tmp_V = tmp_J;
else {
ihermite = FALSE;
}

if (ihermite == FALSE) {
if (BitCheckGeneral((unsigned long int) myrank, org_isite1 + 1, org_ispin1, X->Def.SiteToBit, X->Def.Tpow) ==
TRUE &&
GetOffCompGeneralSpin((unsigned long int) myrank, org_isite3 + 1, org_ispin3, org_ispin4, &off,
X->Def.SiteToBit, X->Def.Tpow) == TRUE) {
tmp_V = conj(tmp_J);
if (X->Large.mode == M_CORR || X->Large.mode == M_CALCSPEC) tmp_V = 0.0;
}
else {
return 0.0;
}
if (GetOffCompGeneralSpin((unsigned long int) myrank, org_isite3 + 1, org_ispin4, org_ispin3,
&off, X->Def.SiteToBit, X->Def.Tpow) == TRUE)
{
if (BitCheckGeneral((unsigned long int)off, org_isite1 + 1, org_ispin1, X->Def.SiteToBit,
X->Def.Tpow) == TRUE)
{
tmp_V = conj(tmp_J);
if(X->Large.mode == M_CORR || X->Large.mode == M_CALCSPEC) tmp_V = 0.0;
}/*BitCheckGeneral(off, org_isite1 + 1, org_ispin1)*/
else return 0.0;
}/*GetOffCompGeneralSpin(myrank, org_isite3 + 1, org_ispin4, org_ispin3, &off)*/
else return 0.0;
}
origin = (int)off;
ierr = MPI_Sendrecv(tmp_v1, X->Check.idim_max + 1, MPI_DOUBLE_COMPLEX, origin, 0,
Expand Down Expand Up @@ -924,16 +917,19 @@ double complex X_GC_child_CisAitCjuAju_GeneralSpin_MPIdouble(
return 0.0;
}

if (BitCheckGeneral((unsigned long int) myrank, org_isite3 + 1, org_ispin3, X->Def.SiteToBit, X->Def.Tpow) == TRUE
&& GetOffCompGeneralSpin((unsigned long int) myrank, org_isite1 + 1, org_ispin2, org_ispin1,
&off, X->Def.SiteToBit, X->Def.Tpow) == TRUE) {
tmp_V = tmp_J;
if (BitCheckGeneral(myrank, org_isite3 + 1, org_ispin3, X->Def.SiteToBit, X->Def.Tpow) == TRUE
&& GetOffCompGeneralSpin((unsigned long int) myrank, org_isite1 + 1, org_ispin2, org_ispin1, &off,
X->Def.SiteToBit, X->Def.Tpow) == TRUE)
{
tmp_V = conj(tmp_J);
if (X->Large.mode == M_CORR || X->Large.mode == M_CALCSPEC) tmp_V = 0.0;
}
else if (GetOffCompGeneralSpin((unsigned long int) myrank, org_isite1 + 1, org_ispin1, org_ispin2, &off,
X->Def.SiteToBit, X->Def.Tpow) == TRUE) {
if (BitCheckGeneral(off, org_isite3 + 1, org_ispin3, X->Def.SiteToBit, X->Def.Tpow) == TRUE) {
tmp_V = conj(tmp_J);
if (X->Large.mode == M_CORR || X->Large.mode == M_CALCSPEC) tmp_V = 0.0;
else if (GetOffCompGeneralSpin((unsigned long int) myrank, org_isite1 + 1, org_ispin1, org_ispin2,
&off, X->Def.SiteToBit, X->Def.Tpow) == TRUE)
{
if (BitCheckGeneral((unsigned long int)off, org_isite3 + 1, org_ispin3,
X->Def.SiteToBit, X->Def.Tpow) == TRUE) {
tmp_V = tmp_J;
}
else return 0.0;
}
Expand Down Expand Up @@ -1482,6 +1478,13 @@ shared (tmp_v0, tmp_v1, v1buf)
tmp_v0[off + 1] += dmv;
dam_pr += conj(tmp_v1[off + 1]) * dmv;
}
else if (GetOffCompGeneralSpin(j - 1, isite, FinSpin, IniSpin, &off,
X->Def.SiteToBit, X->Def.Tpow) == TRUE)
{
dmv = tmp_v1[j] * conj(tmp_V);
tmp_v0[off + 1] += dmv;
dam_pr += conj(tmp_v1[off + 1]) * dmv;
}
}/*for (j = 1; j <= X->Check.idim_max; j++)*/
}
else {
Expand Down
19 changes: 13 additions & 6 deletions src/phys.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,19 @@ void phys(struct BindStruct *X, //!<[inout]
v0[j + 1] = 0.0;
}
}
} else{
if(myrank == 0){
for (j = 0; j < i_max; j++) {
v0[j + 1] = L_vec[i][j];
}
}
} else {
if (X->Def.iCalcType == FullDiag) {
if (myrank == 0) {
for (j = 0; j < i_max; j++) {
v0[j + 1] = L_vec[i][j];
}
}
} else {
for (j = 0; j < i_max; j++) {
v0[j + 1] = L_vec[i][j];
}

}
}
#else
for (j = 0; j < i_max; j++) {
Expand Down
2 changes: 1 addition & 1 deletion src/sz.c
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ int sz
list_jb[ib]=jb;
i2Sz=0;
for(j=1;j<=(N-irghtsite); j++){
i2Sz += GetLocal2Sz(j,ib, X->Def.SiteToBit, X->Def.Tpow);
i2Sz += GetLocal2Sz(j+irghtsite,ib*ihfbit, X->Def.SiteToBit, X->Def.Tpow);
}
list_2_2_Sz[ib]=i2Sz;
if((X->Def.Total2Sz- i2Sz +(int)Max2Sz)>=0 && (X->Def.Total2Sz- i2Sz) <= (int)Max2Sz){
Expand Down
Loading

0 comments on commit bdf7d22

Please sign in to comment.