MCPcopy Create free account
hub / github.com/dask/dask / get_async

Function get_async

dask/local.py:384–563  ·  view source on GitHub ↗

Asynchronous get function This is a general version of various asynchronous schedulers for dask. It takes a ``concurrent.futures.Executor.submit`` function to form a more specific ``get`` method that walks through the dask array with parallel workers, avoiding repeat computation an

(
    submit,
    num_workers,
    dsk,
    result,
    cache=None,
    get_id=default_get_id,
    rerun_exceptions_locally=None,
    pack_exception=default_pack_exception,
    raise_exception=reraise,
    callbacks=None,
    dumps=identity,
    loads=identity,
    chunksize=None,
    **kwargs,
)

Source from the content-addressed store, hash-verified

382
383
384def get_async(
385 submit,
386 num_workers,
387 dsk,
388 result,
389 cache=None,
390 get_id=default_get_id,
391 rerun_exceptions_locally=None,
392 pack_exception=default_pack_exception,
393 raise_exception=reraise,
394 callbacks=None,
395 dumps=identity,
396 loads=identity,
397 chunksize=None,
398 **kwargs,
399):
400 """Asynchronous get function
401
402 This is a general version of various asynchronous schedulers for dask. It
403 takes a ``concurrent.futures.Executor.submit`` function to form a more
404 specific ``get`` method that walks through the dask array with parallel
405 workers, avoiding repeat computation and minimizing memory use.
406
407 Parameters
408 ----------
409 submit : function
410 A ``concurrent.futures.Executor.submit`` function
411 num_workers : int
412 The number of workers that task submissions can be spread over
413 dsk : dict
414 A dask dictionary specifying a workflow
415 result : key or list of keys
416 Keys corresponding to desired data
417 cache : dict-like, optional
418 Temporary storage of results
419 get_id : callable, optional
420 Function to return the worker id, takes no arguments. Examples are
421 `threading.current_thread` and `multiprocessing.current_process`.
422 rerun_exceptions_locally : bool, optional
423 Whether to rerun failing tasks in local process to enable debugging
424 (False by default)
425 pack_exception : callable, optional
426 Function to take an exception and ``dumps`` method, and return a
427 serialized tuple of ``(exception, traceback)`` to send back to the
428 scheduler. Default is to just raise the exception.
429 raise_exception : callable, optional
430 Function that takes an exception and a traceback, and raises an error.
431 callbacks : tuple or list of tuples, optional
432 Callbacks are passed in as tuples of length 5. Multiple sets of
433 callbacks may be passed in as a list of tuples. For more information,
434 see the dask.diagnostics documentation.
435 dumps: callable, optional
436 Function to serialize task data and results to communicate between
437 worker and parent. Defaults to identity.
438 loads: callable, optional
439 Inverse function of `dumps`. Defaults to identity.
440 chunksize: int, optional
441 Size of chunks to use when dispatching work. Defaults to 1.

Callers 4

getFunction · 0.90
getFunction · 0.90
get_syncFunction · 0.85
get_apply_asyncFunction · 0.85

Calls 15

flattenFunction · 0.90
convert_legacy_graphFunction · 0.90
local_callbacksFunction · 0.90
unpack_callbacksFunction · 0.90
orderFunction · 0.90
get_dependenciesFunction · 0.90
setClass · 0.85
start_state_from_daskFunction · 0.85
fire_tasksFunction · 0.85
queue_getFunction · 0.85
raise_exceptionFunction · 0.85
finish_taskFunction · 0.85

Tested by

no test coverage detected