Skip to content

Commit

Permalink
Initial attempt at an anything_new flag
Browse files Browse the repository at this point in the history
  • Loading branch information
jmlarson1 committed Nov 5, 2020
1 parent 5ea6877 commit 8c214e8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libensemble/libE_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ def __init__(self, hist, libE_specs, alloc_specs,
timer.start()
self.date_start = timer.date_start.replace(' ', '_')
self.safe_mode = libE_specs.get('safe_mode', True)
self.anything_new = True # Set to True so alloc_f is called the first time
self.hist = hist
self.libE_specs = libE_specs
self.alloc_specs = alloc_specs
Expand Down Expand Up @@ -323,6 +324,7 @@ def _receive_from_workers(self, persis_info):
if self.wcomms[w-1].mail_flag():
new_stuff = True
self._handle_msg_from_worker(persis_info, w)
self.anything_new = True

if 'save_every_k_sims' in self.libE_specs:
self._save_every_k_sims()
Expand Down Expand Up @@ -462,7 +464,8 @@ def run(self, persis_info):
try:
while not self.term_test():
persis_info = self._receive_from_workers(persis_info)
if any(self.W['active'] == 0):
if self.anything_new:
self.anything_new = False
Work, persis_info, flag = self._alloc_work(self.hist.trim_H(),
persis_info)
if flag:
Expand Down

0 comments on commit 8c214e8

Please sign in to comment.