def can_process_in_parallel(self, filenames):
# type: (List[str]) -> bool
"""
Returns False if one of the files is too large to be processed in parallel
with another file.
Returns True if all files are small enough.
"""
result = True
for filename in filenames:
sourcedata = get_cached_file(filename)
if len(sourcedata) > MAX_FILESIZE_FOR_MULTIPROCESSING:
reportwarning('Warning: %s has a size of %s bytes.' % (filename,
len(sourcedata)))
reportwarning(' This may cause memory swapping so we only use'
' a single processor core.')
result = False
return result
评论列表
文章目录