From 9de7aa36aae56e1fc1277c15314bf645e1d38146 Mon Sep 17 00:00:00 2001 From: ltimmerman3 Date: Wed, 4 Dec 2024 15:02:05 -0500 Subject: [PATCH 1/2] Adding catch for Calcualte_local_kpoints. Updating OFDFT printing --- ChangeLog | 7 +++++++ src/electronicGroundState.c | 2 +- src/md.c | 4 +++- src/ofdft/ofdft.c | 8 ++++++++ src/relax.c | 4 +++- src/socket/driver.c | 5 ++++- 6 files changed, 26 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index a6550b44..95ed8c16 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,13 @@ -Date -Name -changes +-------------- +Dec 4, 2024 +Name: Lucas Timmerman +Changes: (md.c, ofdft.c, relax.c, driver.c) +1. Add catch for Calculate_local_kpoints +2. Update printing in ofdft + -------------- Nov 28, 2024 Name: Tian Tian diff --git a/src/electronicGroundState.c b/src/electronicGroundState.c index 57c289ac..e48e2cf0 100644 --- a/src/electronicGroundState.c +++ b/src/electronicGroundState.c @@ -572,7 +572,7 @@ void scf(SPARC_OBJ *pSPARC) pSPARC->RelaxCount + pSPARC->restartCount + (pSPARC->RestartFlag == 0)); #ifdef USE_SOCKET else if(pSPARC->SocketFlag == 1) - fprintf(output_fp," Self Consistent Field (SCF#%d) \n", pSPARC->SocketSCFCount); + fprintf(output_fp," Self Consistent Field (SCF#%d) \n", pSPARC->SocketSCFCount); #endif else fprintf(output_fp," Self Consistent Field (SCF#%d) \n",1); diff --git a/src/md.c b/src/md.c index 028c0281..0707fdc0 100644 --- a/src/md.c +++ b/src/md.c @@ -1249,7 +1249,9 @@ void reinitialize_mesh_NPT(SPARC_OBJ *pSPARC) // re-calculate local k-points array if (pSPARC->Nkpts >= 1 && pSPARC->kptcomm_index != -1) { - Calculate_local_kpoints(pSPARC); + if (pSPARC->sqAmbientFlag == 0 && pSPARC->sqHighTFlag == 0 && pSPARC->OFDFTFlag == 0) { + Calculate_local_kpoints(pSPARC); + } } #ifdef DEBUG diff --git a/src/ofdft/ofdft.c b/src/ofdft/ofdft.c index d1f62118..8c9f5b76 100644 --- a/src/ofdft/ofdft.c +++ b/src/ofdft/ofdft.c @@ -82,6 +82,14 @@ void OFDFT_NLCG_TETER(SPARC_OBJ *pSPARC) { if(pSPARC->RelaxFlag >= 1) fprintf(output_fp," Orbital Free DFT NLCG (OFDFT-NLCG#%d) \n", pSPARC->RelaxCount + pSPARC->restartCount + (pSPARC->RestartFlag == 0)); + else if (pSPARC->MDFlag == 1) + fprintf(output_fp," Orbital Free DFT NLCG (OFDFT-NLCG#%d) \n", + pSPARC->MDCount + pSPARC->restartCount + (pSPARC->RestartFlag == 0)); +#ifdef USE_SOCKET + else if(pSPARC->SocketFlag == 1) + fprintf(output_fp," Orbital Free DFT NLCG (OFDFT-NLCG#%d) \n", + pSPARC->SocketSCFCount); +#endif else fprintf(output_fp," Orbital Free DFT NLCG (OFDFT-NLCG#%d) \n",1); diff --git a/src/relax.c b/src/relax.c index 59c53157..33eb90b5 100644 --- a/src/relax.c +++ b/src/relax.c @@ -1269,7 +1269,9 @@ void reinitialize_cell_mesh(SPARC_OBJ *pSPARC, double vol) // re-calculate local k-points array if (pSPARC->Nkpts >= 1 && pSPARC->kptcomm_index != -1) { - Calculate_local_kpoints(pSPARC); + if (pSPARC->sqAmbientFlag == 0 && pSPARC->sqHighTFlag == 0 && pSPARC->OFDFTFlag == 0) { + Calculate_local_kpoints(pSPARC); + } } #ifdef DEBUG diff --git a/src/socket/driver.c b/src/socket/driver.c index 2edb074d..516521a2 100644 --- a/src/socket/driver.c +++ b/src/socket/driver.c @@ -468,7 +468,10 @@ void reinit_mesh(SPARC_OBJ *pSPARC){ Calculate_kpoints(pSPARC); if (pSPARC->Nkpts >= 1 && pSPARC->kptcomm_index != -1) { - Calculate_local_kpoints(pSPARC); + // set up sub-communicators + if (pSPARC->sqAmbientFlag == 0 && pSPARC->sqHighTFlag == 0 && pSPARC->OFDFTFlag == 0) { + Calculate_local_kpoints(pSPARC); + } } Calculate_PseudochargeCutoff(pSPARC); From d821e188262df1aef39d8b825fb34b44193d8676 Mon Sep 17 00:00:00 2001 From: ltimmerman3 Date: Wed, 4 Dec 2024 15:08:46 -0500 Subject: [PATCH 2/2] Updating SPARC version date --- src/initialization.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/initialization.c b/src/initialization.c index cad7dc0b..4225d72e 100644 --- a/src/initialization.c +++ b/src/initialization.c @@ -3649,7 +3649,7 @@ void write_output_init(SPARC_OBJ *pSPARC) { } fprintf(output_fp,"***************************************************************************\n"); - fprintf(output_fp,"* SPARC (version Nov 28, 2024) *\n"); + fprintf(output_fp,"* SPARC (version Dec 4, 2024) *\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);