Skip to content

Commit

Permalink
added logging for resubmits
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffkinnison committed Jul 14, 2016
1 parent abe5d10 commit af0df02
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions awe/aweclasses.py
Expand Up @@ -467,6 +467,8 @@ def _try_duplicate_tasks(self):
def _resubmit(self):
invalid = self.system.filter_by_valid()
while invalid != {}:
if self.verbose:
print("Resubmitting invalid models")
for cid in invalid:
valid = self.system.get_valid_walker(cid)
if valid is None:
Expand Down
5 changes: 4 additions & 1 deletion awe/workqueue.py
Expand Up @@ -541,7 +541,7 @@ class WorkQueue(object):
"""

# @awe.typecheck(Config)
def __init__(self, cfg, statslogger=None, taskoutputlogger=None, log_it=False):
def __init__(self, cfg, statslogger=None, taskoutputlogger=None, verbose=False, log_it=False):
"""
Initialize a new instance of WorkQueue for managing the cctools
work_queue.WorkQueue object with the necessary parameters for running
Expand Down Expand Up @@ -579,6 +579,7 @@ def __init__(self, cfg, statslogger=None, taskoutputlogger=None, log_it=False):
self.statslogger = statslogger or awe.stats.StatsLogger(buffersize=42)
self.taskoutputlogger = taskoutputlogger or awe.stats.StatsLogger(path='debug/task_output.log.gz', buffersize=42)
self._log = log_it
self.verbose = verbose

@property
def empty(self):
Expand Down Expand Up @@ -921,6 +922,8 @@ def recv(self, marshall, mark_invalid):
elif task and not task.result == 0:
# Check the task output for a bad model
if task.output.find('Exception: Particle coordinate is NaN'):
if self.verbose:
print(''.join([task.tag, ': Particle coordinate is NaN']))
mark_invalid(task)
continue
# Kill the task if it cannot be restarted.
Expand Down

0 comments on commit af0df02

Please sign in to comment.