Skip to content

Commit

Permalink
suppressing obs header for continuation runs
Browse files Browse the repository at this point in the history
  • Loading branch information
skasamatsu committed Oct 4, 2023
1 parent 471cbc4 commit 3d7a78f
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions abics/sampling/rxmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ def run(
observer: ObserverBase = ObserverBase(),
subdirs: bool = True,
save_obs: bool = True,
continue_run: bool = False,
):
"""
Expand Down Expand Up @@ -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):
Expand All @@ -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
Expand Down

0 comments on commit 3d7a78f

Please sign in to comment.