diff --git a/ChangeLog b/ChangeLog index 93f665f4..6f4e2578 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,13 @@ -Name -changes +-------------- +Sep 23, 2023 +Name: Xin Jing +Changes: (eigenSolver.c, eigenSolverKpt.c, force.c, stress.c, pressure.c) +1. changes for GPU hooks +2. fix bug in exact exchange energy density + -------------- Sep 22, 2023 Name: Qimen Xu, Ziao Tang, Yu Zhang diff --git a/src/eigenSolver.c b/src/eigenSolver.c index 6624d73e..141033e2 100644 --- a/src/eigenSolver.c +++ b/src/eigenSolver.c @@ -312,12 +312,12 @@ void CheFSI(SPARC_OBJ *pSPARC, double lambda_cutoff, double *x0, int count, int } else { #endif #ifdef SPARCX_ACCEL - if (pSPARC->useACCEL == 1 && pSPARC->cell_typ < 20 && pSPARC->usefock <=1 && pSPARC->Nd_d_dmcomm == pSPARC->Nd) + if (pSPARC->useACCEL == 1 && pSPARC->cell_typ < 20 && pSPARC->spin_typ <= 1 && pSPARC->usefock <=1 && pSPARC->Nd_d_dmcomm == pSPARC->Nd) { - ACCEL_ChebyshevFiltering(pSPARC, pSPARC->DMVertices_dmcomm, pSPARC->Xorb + spn_i*size_s, - pSPARC->Yorb, pSPARC->Nband_bandcomm, - pSPARC->ChebDegree, lambda_cutoff, pSPARC->eigmax[spn_i], pSPARC->eigmin[spn_i], k, spn_i, - pSPARC->dmcomm); + ACCEL_ChebyshevFiltering(pSPARC, pSPARC->DMVertices_dmcomm, pSPARC->Xorb + spn_i*DMnd, DMndsp, + pSPARC->Yorb + spn_i*DMnd, DMndsp, pSPARC->Nband_bandcomm, + pSPARC->ChebDegree, lambda_cutoff, pSPARC->eigmax[spn_i], pSPARC->eigmin[spn_i], k, spn_i, + pSPARC->dmcomm); } else #endif // SPARCX_ACCEL @@ -951,7 +951,7 @@ void DP_Project_Hamiltonian(SPARC_OBJ *pSPARC, int *DMVertices, double *Y, int l double *Veff_loc_sg = pSPARC->Veff_loc_dmcomm + sg * pSPARC->Nd_d_dmcomm; st = MPI_Wtime(); #ifdef SPARCX_ACCEL - if (pSPARC->useACCEL == 1 && pSPARC->cell_typ < 20 && pSPARC->usefock <=1 && pSPARC->Nd_d_dmcomm == pSPARC->Nd) + if (pSPARC->useACCEL == 1 && pSPARC->cell_typ < 20 && pSPARC->spin_typ <= 1 && pSPARC->usefock <=1 && pSPARC->Nd_d_dmcomm == pSPARC->Nd) { } else diff --git a/src/eigenSolverKpt.c b/src/eigenSolverKpt.c index 51c90882..96d51fb3 100644 --- a/src/eigenSolverKpt.c +++ b/src/eigenSolverKpt.c @@ -233,12 +233,12 @@ void CheFSI_kpt(SPARC_OBJ *pSPARC, double lambda_cutoff, double _Complex *x0, in t1 = MPI_Wtime(); #ifdef SPARCX_ACCEL - if (pSPARC->useACCEL == 1 && pSPARC->cell_typ < 20 && pSPARC->usefock <=1 && pSPARC->SOC_Flag == 0 && pSPARC->Nd_d_dmcomm == pSPARC->Nd) + if (pSPARC->useACCEL == 1 && pSPARC->cell_typ < 20 && pSPARC->spin_typ <= 1 && pSPARC->usefock <=1 && pSPARC->SOC_Flag == 0 && pSPARC->Nd_d_dmcomm == pSPARC->Nd) { - ACCEL_ChebyshevFiltering_kpt(pSPARC, pSPARC->DMVertices_dmcomm, pSPARC->Xorb_kpt + kpt*size_k + spn_i*DMnd, - pSPARC->Yorb_kpt, pSPARC->Nband_bandcomm, - pSPARC->ChebDegree, lambda_cutoff, pSPARC->eigmax[spn_i*pSPARC->Nkpts_kptcomm + kpt], pSPARC->eigmin[spn_i*pSPARC->Nkpts_kptcomm + kpt], kpt, spn_i, - pSPARC->dmcomm); + ACCEL_ChebyshevFiltering_kpt(pSPARC, pSPARC->DMVertices_dmcomm, pSPARC->Xorb_kpt + kpt*size_k + spn_i*DMnd, DMndsp, + pSPARC->Yorb_kpt + spn_i*DMnd, DMndsp, pSPARC->Nband_bandcomm, + pSPARC->ChebDegree, lambda_cutoff, pSPARC->eigmax[spn_i*pSPARC->Nkpts_kptcomm + kpt], pSPARC->eigmin[spn_i*pSPARC->Nkpts_kptcomm + kpt], kpt, spn_i, + pSPARC->dmcomm); } else #endif // SPARCX_ACCEL @@ -690,7 +690,7 @@ void DP_Project_Hamiltonian_kpt(SPARC_OBJ *pSPARC, int *DMVertices, double _Comp double *Veff_loc_sg = pSPARC->Veff_loc_dmcomm + sg * pSPARC->Nd_d_dmcomm; st = MPI_Wtime(); #ifdef SPARCX_ACCEL - if (pSPARC->useACCEL == 1 && pSPARC->cell_typ < 20 && pSPARC->usefock <=1 && pSPARC->SOC_Flag == 0 && pSPARC->Nd_d_dmcomm == pSPARC->Nd) + if (pSPARC->useACCEL == 1 && pSPARC->cell_typ < 20 && pSPARC->spin_typ <= 1 && pSPARC->usefock <=1 && pSPARC->SOC_Flag == 0 && pSPARC->Nd_d_dmcomm == pSPARC->Nd) { } else diff --git a/src/forces.c b/src/forces.c index 5b373f61..ce9cb40a 100644 --- a/src/forces.c +++ b/src/forces.c @@ -727,7 +727,7 @@ void Calculate_nonlocal_forces(SPARC_OBJ *pSPARC) Calculate_nonlocal_forces_SQ(pSPARC); } else if (pSPARC->isGammaPoint) { #ifdef SPARCX_ACCEL - if (pSPARC->useACCEL == 1 && pSPARC->cell_typ < 20 && pSPARC->Nd_d_dmcomm == pSPARC->Nd) + if (pSPARC->useACCEL == 1 && pSPARC->cell_typ < 20 && pSPARC->spin_typ <= 1 && pSPARC->Nd_d_dmcomm == pSPARC->Nd) { ACCEL_Calculate_nonlocal_forces_linear(pSPARC); } else @@ -737,7 +737,7 @@ void Calculate_nonlocal_forces(SPARC_OBJ *pSPARC) } } else { #ifdef SPARCX_ACCEL - if (pSPARC->useACCEL == 1 && pSPARC->cell_typ < 20 && pSPARC->Nd_d_dmcomm == pSPARC->Nd) + if (pSPARC->useACCEL == 1 && pSPARC->cell_typ < 20 && pSPARC->spin_typ <= 1 && pSPARC->Nd_d_dmcomm == pSPARC->Nd) { ACCEL_Calculate_nonlocal_forces_kpt(pSPARC); } else diff --git a/src/initialization.c b/src/initialization.c index 313f4475..8070b3a6 100644 --- a/src/initialization.c +++ b/src/initialization.c @@ -3338,7 +3338,7 @@ void write_output_init(SPARC_OBJ *pSPARC) { } fprintf(output_fp,"***************************************************************************\n"); - fprintf(output_fp,"* SPARC (version Sept 22, 2023) *\n"); + fprintf(output_fp,"* SPARC (version Sep 23, 2023) *\n"); fprintf(output_fp,"* Copyright (c) 2020 Material Physics & Mechanics Group, Georgia Tech *\n"); fprintf(output_fp,"* Distributed under GNU General Public License 3 (GPL) *\n"); fprintf(output_fp,"* Start time: %s *\n",c_time_str); diff --git a/src/pressure.c b/src/pressure.c index f598dbf5..b72d9761 100644 --- a/src/pressure.c +++ b/src/pressure.c @@ -774,7 +774,7 @@ void Calculate_nonlocal_pressure(SPARC_OBJ *pSPARC) { Calculate_nonlocal_pressure_SQ(pSPARC); } else if (pSPARC->isGammaPoint) { #ifdef SPARCX_ACCEL - if (pSPARC->useACCEL == 1 && pSPARC->cell_typ < 20 && pSPARC->Nd_d_dmcomm == pSPARC->Nd) + if (pSPARC->useACCEL == 1 && pSPARC->cell_typ < 20 && pSPARC->spin_typ <= 1 && pSPARC->Nd_d_dmcomm == pSPARC->Nd) { ACCEL_Calculate_nonlocal_pressure_linear(pSPARC); } else @@ -784,9 +784,9 @@ void Calculate_nonlocal_pressure(SPARC_OBJ *pSPARC) { } } else { #ifdef SPARCX_ACCEL - if (pSPARC->useACCEL == 1 && pSPARC->cell_typ < 20 && pSPARC->Nd_d_dmcomm == pSPARC->Nd) + if (pSPARC->useACCEL == 1 && pSPARC->cell_typ < 20 && pSPARC->spin_typ <= 1 && pSPARC->Nd_d_dmcomm == pSPARC->Nd) { - ACCEL_Calculate_nonlocal_pressure_kpt_linear(pSPARC); + ACCEL_Calculate_nonlocal_pressure_kpt(pSPARC); } else #endif { diff --git a/src/stress.c b/src/stress.c index 697b0eea..26176693 100644 --- a/src/stress.c +++ b/src/stress.c @@ -1062,7 +1062,7 @@ void Calculate_nonlocal_kinetic_stress(SPARC_OBJ *pSPARC) { Calculate_nonlocal_kinetic_stress_SQ(pSPARC); } else if (pSPARC->isGammaPoint) { #ifdef SPARCX_ACCEL - if (pSPARC->useACCEL == 1 && pSPARC->cell_typ < 20 && pSPARC->Nd_d_dmcomm == pSPARC->Nd) + if (pSPARC->useACCEL == 1 && pSPARC->cell_typ < 20 && pSPARC->spin_typ <= 1 && pSPARC->Nd_d_dmcomm == pSPARC->Nd) { ACCEL_Calculate_nonlocal_kinetic_stress_linear(pSPARC); } else @@ -1072,7 +1072,7 @@ void Calculate_nonlocal_kinetic_stress(SPARC_OBJ *pSPARC) { } } else { #ifdef SPARCX_ACCEL - if (pSPARC->useACCEL == 1 && pSPARC->cell_typ < 20 && pSPARC->Nd_d_dmcomm == pSPARC->Nd) + if (pSPARC->useACCEL == 1 && pSPARC->cell_typ < 20 && pSPARC->spin_typ <= 1 && pSPARC->Nd_d_dmcomm == pSPARC->Nd) { ACCEL_Calculate_nonlocal_kinetic_stress_kpt(pSPARC); } else diff --git a/src/xc/exx/exactExchangeEnergyDensity.c b/src/xc/exx/exactExchangeEnergyDensity.c index 1a5949ff..2377f30f 100644 --- a/src/xc/exx/exactExchangeEnergyDensity.c +++ b/src/xc/exx/exactExchangeEnergyDensity.c @@ -145,7 +145,7 @@ void computeExactExchangeEnergyDensity(SPARC_OBJ *pSPARC, double *Exxrho) #endif } - double vscal = 1.0 / pSPARC->dV * pSPARC->exx_frac; + double vscal = 1.0 / pSPARC->dV; if (pSPARC->spin_typ == 0) { for (i = 0; i < DMnd; i++) { Exxrho[i] *= vscal; @@ -170,6 +170,6 @@ void computeExactExchangeEnergyDensity(SPARC_OBJ *pSPARC, double *Exxrho) } Exx *= pSPARC->dV; if (!rank) printf("\nExact exchange energy from energy density: %f\n" - "Exact exchange energy calculated directly: %f\n", Exx, pSPARC->exx_frac*pSPARC->Eexx); + "Exact exchange energy calculated directly: %f\n", Exx, pSPARC->Eexx); #endif } \ No newline at end of file