Skip to content

Commit 5a15b0a

Browse files
committed
Tracing refined
1 parent f67d91a commit 5a15b0a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

mpepool.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ def viewMethod(obj, method):
9191
import psutil
9292
except ImportError as err:
9393
_LIMIT_WORKERS_RAM = False
94+
# Note: import occurs before the execution of the main application, so show
95+
# the timestamp to outline when the error occurred and separate reexecutions
96+
print(time.strftime('%Y-%m-%d %H:%M:%S ' + '-'*32, time.gmtime()), file=sys.stderr)
9497
print('WARNING, RAM constraints are disabled because the psutil module import failed: ', err, file=sys.stderr)
9598

9699
# Use chained constraints (timeout and memory limitation) in jobs to terminate
@@ -584,7 +587,7 @@ def __init__(self, wksnum=cpu_count(), afnstep=None, vmlimit=0., latency=0.):
584587
self._killCount = 3 # 3 cycles of self._latency, termination wait time
585588
self.__termlock = Lock() # Lock for the __terminate() to avoid simultaneous call by the signal and normal execution flow
586589

587-
if self._vmlimit != vmlimit:
590+
if self._vmlimit and self._vmlimit != vmlimit:
588591
print('WARNING, total memory limit is reduced to guarantee the in-RAM'
589592
' computations: {:.6f} -> {:.6f} Gb'.format(vmlimit, self._vmlimit), file=sys.stderr)
590593

0 commit comments

Comments
 (0)