From 7e4e460085b785abaaf71cea575710a0e398a7da Mon Sep 17 00:00:00 2001 From: "Kurt A. O'Hearn" <ohearnku@msu.edu> Date: Mon, 28 Jun 2021 12:11:56 -0400 Subject: [PATCH] sPuReMD: ensure reallocation for multi-simulation runs happens correctly for the charge solver codepath. --- sPuReMD/src/reax_types.h | 3 ++- sPuReMD/src/spuremd.c | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sPuReMD/src/reax_types.h b/sPuReMD/src/reax_types.h index 2179e26..6653061 100644 --- a/sPuReMD/src/reax_types.h +++ b/sPuReMD/src/reax_types.h @@ -1803,7 +1803,8 @@ struct spuremd_handle output_controls *out_control; /* TRUE if file I/O for simulation output enabled, FALSE otherwise */ int output_enabled; - /* TRUE if reallocation is required due to num. atoms increasing, FALSE otherwise */ + /* TRUE if reallocation is required due to num. atoms increasing + * (this includes first simulation run), FALSE otherwise */ int realloc; /* Callback for getting simulation state at the end of each time step */ callback_function callback; diff --git a/sPuReMD/src/spuremd.c b/sPuReMD/src/spuremd.c index 22b93fd..9c9097f 100644 --- a/sPuReMD/src/spuremd.c +++ b/sPuReMD/src/spuremd.c @@ -369,8 +369,6 @@ int simulate( const void * const handle ) spmd_handle->output_enabled, spmd_handle->realloc ); - spmd_handle->realloc = FALSE; - /* compute f_0 */ //if( control.restart == FALSE ) { Reset( spmd_handle->system, spmd_handle->control, spmd_handle->data, @@ -476,6 +474,7 @@ int simulate( const void * const handle ) fprintf( spmd_handle->out_control->log, "total: %.2f secs\n", spmd_handle->data->timing.elapsed ); } + spmd_handle->realloc = FALSE; ret = SPUREMD_SUCCESS; } -- GitLab