diff --git a/abics/sampling/rxmc.py b/abics/sampling/rxmc.py index b11f1bcb..1a43a47d 100644 --- a/abics/sampling/rxmc.py +++ b/abics/sampling/rxmc.py @@ -275,6 +275,7 @@ def run( observer: ObserverBase = ObserverBase(), subdirs: bool = True, save_obs: bool = True, + continue_run: bool = False, ): """ @@ -325,7 +326,8 @@ def run( nsample = 0 XCscheme = 0 with open("obs.dat", "a") as output: - write_obs_header(output, self.mycalc, observer) + if self.write_node and not continue_run: + write_obs_header(output, self.mycalc, observer) ntrials = self.mycalc.ntrials naccepted = self.mycalc.naccepted for i in range(1, nsteps + 1): @@ -347,12 +349,13 @@ def run( self.obs_save.append(obs_step) self.Trank_hist.append(self.rank_to_T[self.rank]) self.kT_hist.append(self.mycalc.kT) - if self.write_node: - self.save( - save_obs=save_obs, - subdirs=subdirs, - ) + nsample += 1 + if self.write_node: + self.save( + save_obs=save_obs, + subdirs=subdirs, + ) iT = self.rank_to_T[self.rank] self.ntrials[iT] += self.mycalc.ntrials - ntrials self.naccepted[iT] += self.mycalc.naccepted - naccepted