lithops-cloud / lithops

A multi-cloud framework for big data analytics and embarrassingly parallel jobs, that provides an universal API for building parallel applications in the cloud ☁️🚀
http://lithops.cloud
Apache License 2.0
319 stars 105 forks source link

partitioner's logic throws exception with 1 chunk operation #93

Closed omerb01 closed 5 years ago

omerb01 commented 5 years ago

when I try to run map_reduce() operation with chunk_size bigger than the size of the file which I'm working on, an exception throws: (for example - run map_reduce() with chunk_size=4MB on a file that its size is 2MB)

Traceback (most recent call last):
  File "/Users/omerbelh/IdeaProjects/WORK/metabolomics-cloudbutton/examples/pywren-reads-input-chucks.py", line 58, in <module>

    spectra = pw.get_result()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pywren_ibm_cloud-1.0.3-py3.6.egg/pywren_ibm_cloud/wren.py", line 338, in get_result
    WAIT_DUR_SEC=WAIT_DUR_SEC)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pywren_ibm_cloud-1.0.3-py3.6.egg/pywren_ibm_cloud/wait.py", line 83, in wait
    pbar=pbar)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pywren_ibm_cloud-1.0.3-py3.6.egg/pywren_ibm_cloud/wait.py", line 293, in _wait_storage
    pool.map(get_result, f_to_wait_on)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 260, in map
    return self._map_async(func, iterable, mapstar, chunksize).get()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 608, in get
    raise self._value
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 119, in worker
    result = (True, func(*args, **kwds))
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 44, in mapstar
    return list(map(*args))
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pywren_ibm_cloud-1.0.3-py3.6.egg/pywren_ibm_cloud/wait.py", line 287, in get_result
    f.result(throw_except=throw_except, internal_storage=internal_storage)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pywren_ibm_cloud-1.0.3-py3.6.egg/pywren_ibm_cloud/future.py", line 289, in result
    reraise(*self._traceback)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/six.py", line 692, in reraise
    raise value.with_traceback(tb)
  File "pywren_ibm_cloud/action/jobrunner.py", line 213, in run_function
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pywren_ibm_cloud-1.0.3-py3.6.egg/pywren_ibm_cloud/executor.py", line 373, in reduce_function_wrapper
    wait(fut_list, executor_id, internal_storage, download_results=True)
  File "/action/pywren_ibm_cloud/wait.py", line 83, in wait
  File "/action/pywren_ibm_cloud/wait.py", line 293, in _wait_storage
  File "/usr/local/lib/python3.6/multiprocessing/pool.py", line 288, in map
  File "/usr/local/lib/python3.6/multiprocessing/pool.py", line 670, in get
  File "/usr/local/lib/python3.6/multiprocessing/pool.py", line 119, in worker
  File "/usr/local/lib/python3.6/multiprocessing/pool.py", line 44, in mapstar
  File "/action/pywren_ibm_cloud/wait.py", line 287, in get_result
  File "/action/pywren_ibm_cloud/future.py", line 289, in result
  File "/usr/local/lib/python3.6/site-packages/six.py", line 692, in reraise
    raise value.with_traceback(tb)
  File "pywren_ibm_cloud/action/jobrunner.py", line 213, in run_function
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pywren_ibm_cloud-1.0.3-py3.6.egg/pywren_ibm_cloud/partitioner.py", line 40, in object_processing_wrapper
    wsb = WrappedStreamingBodyPartition(sb, chunk_size, data_byte_range)
  File "/action/pywren_ibm_cloud/partitioner.py", line 266, in __init__
TypeError: 'NoneType' object is not subscriptable
gilv commented 5 years ago

@JosepSampe this happens with latest commit. Can you please check this?

JosepSampe commented 5 years ago

@gilv Fixed in #94

gilv commented 5 years ago

@JosepSampe thanks